当前位置: 动力学知识库 > 问答 > 编程问答 >

xamarin.ios - XCode has lost associating from xib to .h file (MonoTouch)

问题描述:

When I am editing an XIB in XCode I don't get the associated .h file to show up in the assistant editor window. Other XIB's work fine.

This is a problem as it's the way I create outlets by dragging onto the assistant window. If I open the .h file manually in another window I can't associate an outlet this way either. The .h file exists.

Also, my project is MonoTouch and therefore I invoke the opening of the file from MonoTouch. I assume it's a problem originating in MonoTouch and not Xcode.

Someone please help, or I will be forced to learn Objective C soon and quit with this MonoTouch business.

网友答案:

As Stuart mentioned in his comment, deleting the /obj folder under the project which contains the .xib files, force MT to regenerate .h files

网友答案:

Sometimes there is a different solution, such as when the controller file is RENAMED.

When this happens, edit the .XIB file with the Source Control Editor (right click on .xib, Open With->Source Control Editor), and make sure that all references to the name of the controller are correct and that the path and name of the .h file are correct.

Look in the "IBClassDescriber" element specifically. The "className" under the "IBPartialClassDescription" element and the "minorKey" under the "IBClassDescriptionSource" element must be correct. MT will generate a .h file with the same name as the controller.

After making the changes, save the file, choose Build->Clean All, then double-click the .XIB file to open it in XCode.

It may or may not work for you, but it worked for me when everything else failed.

网友答案:

Came across the same issue and removing the /obj directory and restarting did the trick.

MonoDevelop 3.0.3.5 with XCode 4.4.

Was rather confusing as I am came across issue whilst on first MonoDevelop iOS Helloworld tutorial.

分享给朋友:
您可能感兴趣的文章:
随机阅读: