XCode: Project Files no longer linked with project/storyboard - xcode

Recently, some revision was done to one of my projects and the project had to be re-imported from SVN. All of the files are there, but I get weird issues when trying to use some of the project files.
For example, when selecting a view in IB, the assistant view would automatically show the associated header file for that view. Now, there is nothing under the 'Automatic' tab in the assistant view.
Also, when trying to #import certain files and create instances of them, xcode returns the error Unknown type name

I seemed to have resolve the issue. I had to create a new .h and .m file and copy the contents of the old .h and .m into the new one. Once I set the view in storyboard to use this file I no longer received any errors.

Related

XCode Editing Issue

I am having an issue when editing Storyboard views. When I click on a ViewController and attempt to assign it a custom class, nothing appears except UIViewController.
I have ensured the .m files appear in Compile Sources.
Here is the strange thing: If I store the project in my users /Documents/ directory, this issue happens randomly to all projects saved in there. If I copy the project folder to my Desktop and open it in XCode, my custom classes show up. I have the same issue on my Macbook as well.

Xcode suddenly corrupted my xib file

Last thing I did with it was adding a checkbox and creating an outlet using assistant view. Since then Xcode doesn't compile my project, gives me this error and I don't know what to do with it...
Do a complete clean and rebuild of the project.
Also, does your console log indicate any potential problems?
If that does not work and you have a backup, copy your backup to a new location and see whether you have the same problem.
If none of the above worked, then you just have to copy the xib and associated .m and .h somewhere, delete them from the project. Then re-add them. You can copy and paste the .m and .h but you need to remake the xib from the start then link all the outlets and actions.

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.
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.
As Stuart mentioned in his comment, deleting the /obj folder under the project which contains the .xib files, force MT to regenerate .h files
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.
In my case, this issue has appeared when I change a namespace in .cs view controller file according to the file location. But after that, I caught this issue. When I have returned namespace to incorrect variant I got back my .h file.
Update:
You need to change the namespace in view.cs and in view.designer.cs, then Xcode .h file will be generated correctly.

XCode 4 stopped highlight and recognizing UIKit classes on project

Hi i get problem with xCode 4.
I develope project with XCode4 on home and on work.
And i store it on my USB flash drive.
Today i get some problem.
I open xib file for add outlet to code and get next error "Could not insert new outlet connection: Could not find any information for the class named ..."
Class exist and property of xib file setted correctly.
Could not insert new outlet connection: Could not find any information for the class named
Ok, think i, i write code and the connect using Files owner.
Next step i open code editor of .h class file and try to write UI... and see nothing. i dont get list of classes UI types
Next i saw what XCode code editor does not highlighting classes of UIKit and else frameworks too.
But i dont have this error on another projects and on it project but on home computer.
Some body have same problem?
Try this: Close your project. Choose Window > Organizer from the main menu. Select the Projects panel. Select and delete all copies of your project from the list. Open the project again (Xcode will rebuild the necessary information).
This will not delete your project, but the index and other information Xcode discovers about your project. As I said, Xcode will rebuild the information as soon as you re-open the project.
We had a really similar problem happen to us and none of the help out there worked. What did end up fixing it was deleting the .m and .h file from xcode (resource only) and then dragging them back into the project from the project folder. It seemed to relink everything and make it work again.
Just add .m files in Compile Sources under:
<My Project>
-- TARGETS <My App Name>
-- Build Phase tab
-- Compile Sources
It fix the problem.
I noticed that .m file was moved inside en.lproj folder.
Just delete (reference only) the .m file from the Xcode and moved .m out of the en.lproj.
Add it again.Don't worry, you will get all your connections back.
It will fix the issue.

Monodevelop migrate 2.8 didn't add .h files

I just upgrade my MonoDevelop to the latest version (2.8). I also installed XCode4, since it's fully supported now. When opening my solution (which consists of several projects) I was asked to migrate my solution. I did this and saved everything.
However, I think something is missing. When I open the .xib file, the project on the right doesn't show .h files, like shown in the tutorial.
It also shows warnings that the outlets were not found in XCode.
When I add a new screen, it creates the .h file as it should and shows this in XCode. However all existing screens don't have these files, which makes it impossible to add/change outlets.
How can I fix this.
Check that your classes you expect to see in Xcode have explicit [Register("SomeName")] attributes, which register them with a name usable from Xcode/Obj-C/IB.
I would expect an imported project to have those attributes already, since they're required for xibs to be able to load the classes by name, but you could maybe have got away without those attributes by using outlets on "File's Owner".

Resources