Monodevelop migrate 2.8 didn't add .h files - xcode

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".

Related

How to move files in Xcode without causing "Cannot find 'FileName' in Scope"?

I want to make my project more organized, so I created new groups and dragged files into those groups. I am doing all of this in Xcode, not finder or terminal. However, now, Xcode shows "Cannot find 'FileName' in Scope" errors next to references to classes in those files.
How do I solve this problem?
I tried building the project and cleaning the build folder.
I ran into the same issue today with Xcode 12.2 and an iOS 14.2 project. I created a file for a new struct, wrote some code in ViewController that created instances of the struct, and then for housecleaning I moved the struct's .swift file. At that point I saw the error "Cannot find [type] in scope."
Product | Clean Build Folder didn't do the trick.
Closing and reopening Xcode worked for me.
I'm not sure if the initial clean helped or not.
There are more detailed answers here, and your particular case may be covered:
SwiftUI 2.0 CoreData issues with new project - 'Cannot find type 'Item' in scope'
I fixed a similar issue today using Xcode 12.3 (12C33):
Solution
Removed the impacted files from Xcode (without trashing them)
Tried adding the files back with the create folder references option selected
Found that this action generated Cannot find 'type' in scope error
Resolved the error by removing the files references and select the create groups option when copying the files back into the project.
BTW - I found these methods work while using either the Add Files option or dragging the files/folders into the project.
I found some "hack" to fix it.
Lets say you wanna move folder Models to your project. Open AppCode and create Model group using IDE tools. Then open XCode, select Model folder and perform Add files to "Model" action. It worked out in my case.
From my understanding, the problem is with forlders, not with files.

Mistakenly remove reference of the whole project in Xcode

I am working on an iOS project but mistakenly I just remove reference of the whole project in Xcode. After that, I have tried to add all of these folders and files but now the scheme is gone that's why I can't build the project anymore. Can we fix this horrible problem?
This is an ugly work-around, but it has been known to work.
Start a new project with the same name (just stored in a different place)
Remove all the code from the project navigator, including the storyboard
Import all the files and the storyboard from the original project.
Double-check the storyboard (I had problems with loss of segue IDs)
It took time, but at least it made the codesign problem go away.

Issue with Xcode in Main.Storyboard

I've been working on a project the last few weeks in Xcode and everything's been great. Main.Storyboard all of a sudden, will not load or open. Other projects open fine. There hasn't been any significant changes in this project. The last thing I tried doing was adding a navigation bar to one of my view controllers, to add buttons or items. I also tried adding a navigation item. Things started to complicate after trying to do these things. I have the latest version of Xcode, my project settings are linked correctly and tried rebooting my Mac but it doesn't solve anything. Does anybody know what may have caused this error and how to resolve?
The easy way:
Check out the latest working version of the storyboard file and try the changes again. Likely something odd and transient happened that corrupted the existing storyboard file (I've seen it happen with managed object model files before which are also XML underneath).
If there are too many changes to redo them:
Make a copy of the current storyboard file outside the repo and then checkout the latest working version of the file from the repo.
Diff the two files moving over changes that make sense from the troublesome file keeping an eye out for balanced tags (i.e. if a view has an opening tag but no closing tag Xcode will get confused).
Try opening the modified storyboard in Xcode. With luck it will open and be fine. Otherwise you will need to do a bit more digging or go back to option one and redo the changes.
I downloaded your repo and I can open Main.storyboard just fine:

Migrate xib file to Xcode 4.4

This should be an easy one, but surprisingly I could not find any information about it being or not being possible to do.
I have some .xib files created in older versions of Xcode/Interface Builder and I would like to use Xcode 4.4's new features but so far I've only been able to achieve this by deleting the older .xib files and creating new ones from scratch.
You may need to update the older xib files' development target. Select the xib file from the project navigator and open the file inspector. In the file inspector's Interface Builder Document section is a Development menu. Try updating the development target to Xcode 4.4 and see if that allows you to take advantage of the new Xcode 4.4 features.
If updating the development target doesn't work, you'll have to provide some more information about the problems you're having and the features you haven't been able to access.

MonoDevelop is not generating IB outlets for my MonoMac project

I am getting back in to MonoMac, and straight away, experiencing problems.
I have added my outlets and actions to my XIB files, and linked them with IB controls, saved my XIB, and returned to MonoMac, and it is not regenerating the C# files, so the bindings are not linked - I cannot use them.
What happening? I am using the latest stable versions of everything (MonoMac did all its updates).
Thanks
This happens sometimes. I you are using a XIB file generated by MonoMac as default resources, you just need to close both MonoDevelop and Xcode, go to your project folder and clear the bin and object folders. Run the MonoMac, double click your XIB file, edit it in Xcode, press the Command+S buttons 2 or 3 times to make sure the files get changed so MonoDevelop will sync them, and your C# files will get generated...
But I had a situation that this didn't work and I couldn't figure it out and that was when I started an Empty MonoMac Project and added an Empty XIB file to it! The C# files do not get Sync after 5 tries and I didn't waste my time trying to fix it. Created a Document MonoMac project, deleted unneeded files and continued my work.
Hope it helps.

Resources