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.
Related
I have a little bit of a situation here. A few days ago, I accidentally deleted my storyboard, so immediately went into my trash and dragged the storyboard back into the project. Everything worked fine. But then I just emptied my trash and the storyboard no longer appears to be in my project; the storyboard file is showing up red and when I click on it, nothing loads. To my dismay, I thought all was lost so I started building a new storyboard and connecting the classes, outlets and actions.
I then went to build the project on the simulator, and it's building with the OLD storyboard. I thought it might just be loading it from memory so I deleted the app on the simulator and built the project again. Same thing again. So then I built it to my iPhone and somehow the old storyboard is still there even though I can't find it anywhere in my project.
What's going on here? Does this mean I'll be able to recover my storyboard?
Also, when I open the project inspector and go to Build Phases > Copy Bundle Resources, and right click on Storyboard.storyboard, and click show in finder, It shows my new storyboard.
1 - There is a place in Derived Data with following path:
/Users/<Your user name>/Library/Developer/Xcode/DerivedData/<Your App Name>/Build/Products/Debug-iphonesimulator/<app Name.app>
Browse to that location.
2 - On your .app file, right click -> Show Package Contents.
3 - In resulting directory list, browse the folder Base.lproj. Under that you are likely to find your old storyboard.
If you have done Delete Derived Data from XCode organizer, you are not likely to find anything up here. But fortunately, XCode doesn't delete it twice against your own wishes.
So try your luck.
I also faced same problem in Xcode 7.
But when I copy and paste it from Derived Data. I got
"Interface Builder cannot open compiled nibs"
So If you delete storyboard by reference. First, check your project folder (using the Finder). If it's there, you can drag it back into your project in Xcode, or you can use the “Add Files to …” menu option. that file is work perfectly.
Right after building for the simulator I got an error message saying MonoTouch stopped unexpectedly and it shut down. So I closed Xcode and reloaded both. Now, I can't see my .xib files inside the MonoTouch file tree. I can open the .xib files directly in Xcode, but none of the resources need for the files are visible (for instance, images stored in the Resource folder).
How can I get these .xib files associated correctly again?
I fixed this. Had to go back and add each of my existing .xib files back into the project by right clicking on the appropriate folder and then finding the .xib file in the project folder. Once I added them all back, everything worked as expected
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.
This question is the same as this Missing h-files and Assistant Editor not working because of it (monoTouch/MonoDevelop) but none of the answers work for me. When I double-click the XIB file from monodevelop no header file is created in XCode 4.2, even after I edit the XIB in Xcode and re-save, or when I quit Xcode and monodevelop and re-open. I have expanded every folder in Xcode and there is no ViewController.h file anywhere.
I've had this happen quite a few times :( The solution is to manually create the partial class in MonoDevelop, inherit from the UI class you need, and finally add the Register attribute.
[Register("MyCustomView")]
public partial class MyCustomView : UIViewController {
....
}
Once you do that, and save your code in MonoDevelop it should automatically rebuild the xcode project file for you.
I had this same issue, and as of 5 minutes ago it seems to have resolved itself. I don't know what the direct reasoning for this was, but it started after I closed xcode, monodevelop and restarted my mac. It didn't work the first time I rebooted, but I noticed that there was another xcode project open when I double-clicked on the xib in monodevelop. So I closed the project and xcode again. Next time I double-clicked on the xib it was there!
So, my guess is it is some kind of fluke or system caching issue. If you haven't been able to resolve it yet maybe try doing a reboot so the system cache can be cleared and make sure you don't have another project open in xcode when you try to open the xib from monodevelop?
I have noticed that deleting the "obj" folder of your project often helps. In there MD is storing all the helper fiels required by Xcode. This folder is not properly cleaned if you "clean" your solution from the build menu.
Quit Xcode, delete the folder, double click your XIB and the folder will be recreated.
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.