I deleted PopoverContentViewController m, h, and xib files I no longer needed. When I ran, the program stopped with the error message on the console
“Unknown class PopoverContentViewController in Interface Builder file”
I looked up the problem in these pages and tried one fix. I added the files back again (with File New). The program ran past the problem, loaded the default.png, then stopped at int retVal in main.m with
Thread 1: Program received signal: "SIGABRT."
No error message on the console.
Any idea what I should try now?
(Do I ever wish I hadn't deleted those viewcontrollers I was no longer using!)
Any ideas of what I can do now?
Solution to the SIGABRT problem:
On my main VC xib, I had moved some labels off the view, or buried them behind others, that I no longer needed. I couldn't see them. When I deleted (commented out) the IBOutlet for the label in the .h, the program bombed with that rather uninformative message.
Fix: bring up the xib. Click the little rewind button at the bottom left, or go Editor/Show Document Outline. Expand View from the pane that appears. Find the name of the label or outlet you don't want. Press delete. Now you can safely remove it from the .h file.
Huge relief, and a little self-congratulations for creating a snapshot before I had begun the tidying of the code, and removing code by commenting out and running before deleting it permanently.
Related
Hi I was coding and I deleted my view controller. I added a new one but when I started coding in the next day, I wasn't able to open the assistant editor and when I opened my other projects they were also having the same error. Also the new ones that I made, also had the same error. therefore I wasn't able to establish a connection between view controller and story board,
and there was a lock icon on the side of the assistant editor that I tried to open
when I tried to unlock the lock icon it showed
The file is a remote resource. Try making a local copy.
this is the screenshot of how it looked like
please help
sorry for trouble, I found that there was problem in my derived data I simply deleted it,
the bar that shows you, your build fails and successes at the top center was showing indexing and when I clicked on run button it showed build failed the error was in my derived data.
If somebody is having the same trouble try to delete the current derived data.
maybe this error was produced because you deleted your view controller and made a new one here see what it was showing me
the error was no such directory and showed me the address of the derived data I had reported to Xcode
So this is just bizarre. If I create a custom Table View Controller as a subclass of UITableViewController, I can't reliably edit the .m file. When I click on it, I can see everything in the file, but I can't actually drop the cursor in to edit the code; it stays fixed in the top-left of the screen. Anything I type will appear, and any code already in .m that happens to be on that line will randomly appear. It's like a static image of the .m contents are on the screen, but the actual text is hidden.
Eventually the entire editor just goes blank. Everything else works fine. I wiped Xcode with app cleaner to pick up all the loose com files, restarted, re-installed Xcode from the dmg and re-created the project and still have the same problem (this is under Mavericks, by the way).
Granted, Xcode 5 doesn't seem to have this issue, but I'm quite new to programming and am following a course that's based on Xcode 4. And at this point the issue is just so stupidly weird that I want to figure out what's going wrong. Any insights?
I've given up. If for some strange reason someone happens on this question and has the same problem, it's not worth the energy; just head to Xcode 5 and live your life bizarre-error free (for now, heh).
I was having the same problem. I just cleaned the Build Folder and everything seems to be working perfectly now. You clean the build folder by selecting Product, hold Alt, and then "Clean Build Folder.
I too had this problem after upgrading to XCode 5, then downloading and installing XCode 4.5 (without removing Xcode 5). What I wound up doing was to create all my new UITableViewController files (File->New File->Objective C Class) as UIViewController files, then modifying the parent class to UITableViewController in the .h file.
I'm working through "Cocoa Programming: A Quick-Start Guide for Developers." One of the examples is to create a basic browser by inserting a WebView object into a window. Whenever I do that, it causes the program to crash (compiles alright, though) with the message:
Thread 1: SIGABRT
tagged to the line:
return NSApplicationMain(argc, (const char **)argv);
I know that it is the WebView object because when I remove it, the problem goes away. I saw a similar question here that suggested adding the following lines to the preprocessor:
#import <webKit/webview.h>
#import <webKit/webkit.h>
but the result is the same. I've written no actual code, only manipulated the MainMenu.xib in the Interface Builder GUI.
WebKit.framework needs to be included in the build.
Go to MacHD>System>Library>Frameworks and drag the WebKit.framework folder into the project icon in XCode. A window will pop up and ask if you want to add the files to the project. Click finish and it will work.
This feels weird to not be including library files by typing in that they should be included.
This is a real 'WTF?' moment for me.
I copied some classes out from another project, including copy and pasting the code and some UIBulder components. What did NOT get copied was the XIB file (I went from XIB to storyboard).
My tab / swipe recognizers aren't activating, and when I drill down the only thing I can discover that can explain it is that somehow, someway, I'm hooking up against the XIB file. (When I click on the little button next to the IBAction/IBOutlet lines in the header, it shows me both the storyboard and the xib file as connected).
I'm not referencing that file anywhere that I can find, it's just somehow magically recognized in Xcode. I don't know what to do, how to fix this.
Anyone have any ideas?
Edit: The really annoying bit is that the file doesn't appear to be in my files list when I check there, I can't just delete the reference that way. And since it's referencing the file in the original project, I can't just delete it. (Any changes made in either project cause changes in BOTH projects; their both using the same xib file for some reason). I should be able to simply delete the reference to the xib file, but I can't find the reference.
If you copy the view controller code from one project into another project you will notice a strange thing happening with the outlet. It is referencing the view from the first project without you ever connecting any outlets.
If you left click the little circle and click the reference link you will even be taken to the storyboard view in the other project. Trying to figure out how to get rid of this reference can drive you crazy.
Well, the good news is that there is really nothing for you to fix. You didn't copy over some deep, hard to find referencing link. Xcode is just getting confused because the View Controller and the outlet name are the same in both projects. Basically just ignore what that little circle says. You can close the first project and Xcode will figure things out eventually. Right click your views in the storyboard to see what referencing outlets really exist in the current project. (See my fuller answer for more details.)
No need to delete Derived Data. That doesn't solve the problem anyway. Just try opening both projects at the same time again and you will get the same strange behavior.
The way I figured this out was to separately create two new projects that had view controllers with the same name and a referencing outlet with the same name. I never copied anything but Xcode showed one was referencing the other. Like I said, ignore the little circle.
I just had the same problem. What solved it for me was to close both projects, delete the derived data from both and then reopen the destination project.
I agree, it's a crazy problem.
I'm sure that this problem could happen and I fix it deleting the content of the Derived data folder of XCode.
I just want to add the steps of how to delete those files:
Don't Delete the DerivedData folder.
Go to preferences (Command ,) > Locations Tab
On Derived Data you are going to see the path, clic the right pointing arrow (that will open that location in Finder)
Close XCode
Select all the files inside the DerivedData Folder (do NOT select parent folder) and (Command Delete) or move them to the Trash and then Empty Trash
Open the project and you are done
I hope it helps someone
unless the xib file is in the project. it should not have a link to it.
the xib file connects to the .h file. not the other way around.
You may want to remove the connections in the storyboard and re-connect them.
Also make sure that the storyboard is the UI being started and that the item on the navigation stack is actually the storyboard page. But you should be able to connect both the storyboard and the xib file to the class at the same time. You just cannot connect one IBOutlet to more than one object in a single ui component (e.g. two buttons on the storyboard cannot both be connected to #property IBOutlet UIButton *myCurrentButton you must have a separate IBOutlet for each connection. On the other hand, any number of actions can be connected to an IBAction. which is why you get (id) sender on each action.
I dont know if this is exactly what you are experiencing, but I hope that understanding helps you debug your issue.
Help me un-fubar interface-builder in XCode4.
I created a button in interface-builder and defined an IBAction method for it in the view's code. It ran fine. Then I renamed the button's action method using XCode's refactor / rename tool. It ran fine.
Then I deleted the button in interface-builder by selecting the button and hitting the delete key. When I rebuilt the project the button is still there in the simulator. Back in interface-builder, the button is gone. There is no reference to the button in the code, but the button's IBAction method is still there.
To make matters worse, the button's original action method is getting called which of course throws a runtime exception of selector not found. When I do a project search for name of the original action method nothing is found, but the runtime is still trying to call it. I did a "clean" and rebuild but no joy.
If I try to open the .xib file as ASCII Property list, it tells me the data has been corrupted. (I figured that out.)
Other than deleting the .xib file and creating a new view, is there any way to fix this?
And what does "clean" do if it doesn't delete the binaries?
Thanks for your help!
Try iOS Simulator -> Reset Content and Settings. (To save time, Xcode tries to copy resources before launch only if those resources have changed, but if things have gone screwy…)
Clean did not work for me. In my experience, Xcode keeps a cache of the "compiled .xib" without regard to timestamps (try switching out a xib for one with the same name). My fix was to modify each view that needed to be refreshed. Very frustrating, but it works.
Try going in Xcode to Build > Clean All targets, it should fix it