需要删除.m文件的引用,然后再次添加它们iOS

时间:2013-12-19 05:39:20

标签: objective-c ios7 xcode5

我在几个地方的Xcode项目中更改了我的.h文件的prefix header名称,然后将标题更改回原始名称。似乎我搞砸了我的消息来源。尝试从UIButton控制点击拖动到我的.h文件以创建 IBAction 时,

我收到以下错误:

Could not insert new action connection: Could not insert source code into document at 
URL file://localhost/Users/Myuser/file/filename/projectname/SGLoginHomeViewController.m 
because it does not contain a class interface for the class named SGLoginHomeViewController

我再一次尝试在类文件SGLoginHomeViewController.h中创建一个新的 IBAction

我相信我需要删除引用然后再添加它们,但是我该怎么做呢?

1 个答案:

答案 0 :(得分:2)

请遵循: -

To Delete reference:_
1. Right click on your .h or .m file. 
2. Click on "Delete". A pop up will open.
3. Click on "Remove reference". Your file reference has been deleted.

To add it again:-
1. Right click on your project. 
2. Click on "Add files to 'YourProjectName'". 
3. A pop up will open. Select you file & Click Add.
Note:- Make sure "Copy items into destination group's folder(if needed)" is unchecked.