Unable to find a document class... com.apple.InterfaceBuilder3.CocoaTouch.XIB - iphone

I have two versions of Xcode installed: Xcode 4 in /Developer/ and Xcode 3 in /User/Xcode3/.
While working on an iPhone app in Xcode 4 I suddenly got this error:
I have no idea where or why this has started. I thought it might be related to this post, but the main solution which has received 32 up votes does not work for me. I did notice that my Xcode 4 folder was missing the InterfaceBuilder app for some reason which I then copied and pasted from my Xcode 3 folder. Not that it made any difference.
Any ideas?
EDIT 1
Also, I should note that even though when I 'get info' on the project and it states that it defaults open to Xcode 4 when I double click on the project it opens with Xcode 3. Therefore I choose to open with Xcode 4. Still doesn't help.
EDIT 2
Also, when I click on the .xib files, I just see string values, no GUI.

I completely reinstalled Xcode 4 and that seemed to do the trick. But I must say I am quite paranoid when I open up projects. I have the impression that if I use the wrong version of Xcode with the wrong project this problem will come back.
Any illumination on this bug would be greatly appreciated.

Related

upgrading to iOS 7 and Xcode 5 - having issues with UIAccelerator, UIStringDrawing and NSObject

I updated my iPad to iOS 7, and discovered that the Enterprise app that I have been working on for over a year crashes. OK, no problem, I'll see where in Xcode it's crashing.
OK, Problem: I have to upgrade to Xcode 5 to debug iOS 7. OK, no problem, I'll upgrade to Xcode 5.
OK, Problem: The source code in Xcode 5 now shows 19 errors: One in NSObject.h, three in UIStringDrawing.h, and the rest in UIAccelerometer.h.
And, for a bonus, it adds one at the bottom, "Too many errors emitted, stopping now." Which is not all that comforting.
I've really scoured the internet for answers, but I must be using the wrong search terms because I am finding nothing that addresses this. Surely I am not the only one.
I have been developing iOS apps for almost two years now, I think, but I am still pretty stupid when it comes down to the nitty-gritty stuff. I usually just hit "Run" and hope it works. So far that has been a pretty effective strategy, but now I am stumped.
Can anyone tell me what I am doing wrong? Except the obvious, being that I should have left everything well enough alone.
I will also have to update my previous app, because it has iOS 7 issues too, but it scares me to even think of it.
I appreciate any help anyone can give.
I found the answer here: http://blog.spacemanlabs.com/2013/09/how-to-support-old-ios-sdks-in-xcode-5/#comment-1056917662
After figuring out how to do all this, the app showed a couple more errors unrelated to the original problem. Turns out I had a couple of XIBs set for Autolayout. Those being disabled, the app worked great on my iOS 6 phone with Xcode 5.
Glad you were able to switch back to the iOS 6 SDK. I had the same errors in UIAccelerometer.h and NSObject.h, but wanted to stick with the iOS 7 SDK.
For me, these errors were the result of stray copies of UIKit.framework, Foundation.framework (And a couple of other frameworks) inside my project folder. These were seen by the linker, hence the "duplicate symbol" error messages thrown. As soon as I got rid of the frameworks in the project folder and re-linked to the frameworks in "Build Phases" -> "Link Binary With Libraries," everything built.

IOS Static Library Product is always red

I've been struggling with this for a few days now. When I create a new Static Library project under IOS in XCode 4 I am running into an issue. With or without adding files as headers or to be compiled I am able to successfully build but the .a file is always red. This happens in both Debug and Release. I've read about similar issues but haven't found someone who has fixed the problem. Any help would be appreciated. Thanks
XCode seems to have a bug in this regard when building for the simulator. Build once for device, right-click the library to show in finder, back up a level, and navigate to the simulator one. Your library will be there. (The path will look something like this: /Users/You/Library/Developer/Xcode/DerivedData/LibName-fylbqugtzucxyndtdddrjmbbdnet/Build/Products/Debug-iphonesimulator)
I wasn't able to figure out the answer to this problem but I did find a work around. I installed the XCode 4 project template to build universal frameworks from https://github.com/kstenerud/iOS-Universal-Framework. This allowed me to build a framework which fit my needs.

Xcode 4 not launching application?

Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?
I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.
Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.
Okay, so here's the underlying problem, and my solution:
My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.
Here's how to found out:
Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:
Debug
Distribution
Release
Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.
This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.
I skimmed the post and these seem to be the two solutions thus far:
I think I figured out the problem:
I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?
Anyways, the app now boots in the simulator. Yay!
And the other solution in that post is:
Did your project by any chance have a folder reference with images in it?
For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.
This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.
I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.
I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.
After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.
Ensure you are starting a proper scheme.
I. e. when using CocoaPods, running Pods scheme would not start emulator.
It's a known issue. Have a look at this thread in the official forum.
Hey, update Xcode to 4.0.2. Problem solved :)
I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.
Restarting the simulator worked for me

moving back from Xcode 4 to Xcode 3.2.6

I tried Xcode 4 a bit. Found it frustrating and am currently returning to Xcode 3.2.6. But now my project can't find any of its frameworks. How do I fix that?
I had similar issue when I moved from 3.2.5 to 3.2.6.. all framework became red, not found error.
I tried restarting xcode, changing base sdk, etc, and didn't seem to fix it :(
To fix this, I had to do below (from some thread online, can't find the source now).
1) go to your project directory/proj.xcodeproj (proj is your project name)
2) open up project.pbxproj file, using any text editor
3) search for "SDKROOT =", and modify it to point to your framework directory.
For me, I had to edit them to: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/
Save your pbxproj file before you modify it, as just in case.
have fun!
Try changing the Base SDK project option to something else than it is now, restarting XCode (might not be necessary) and changing the aforementioned option back again.
It happened to me before (in Xcode 3) a few times while moving project between different Xcode versions (even with the same iOS SDK).

Property List Editor after installing Xcode 4

I cannot find where it is after I installing Xcode 4. Does any one know where it is ?
Edit:
I had installed another app for editing XML file. It is named XMLEditor and located here. Because I need to edit a plist file with an extension which is not end with .plist, so finally I googled another solutions about XML editor.
In XCode 4 the property list editor is integrated. It should appear in the XCode application.
I put together a frankenstien version of the Property List Editor a while ago. Its totally self contained and should work as a stand alone app.
Find it here:
https://www.dropbox.com/s/k6knivza9dramb5/Stand%20Alone%20Property%20List%20Editor.app.zip
I found in xcode 4 when you create a new plist file, the editor opens as blank. If you right click in the blank editor space, you can "add row". Begin from there.
I wish I'd seen this before installing Xcode 4 - the Property List Editor.app was so nice and lightweight and fast - now having to launch Xcode.app just to edit a plist file ... ugh.
I'm going to dig it back out of my old Xcode 3 DMG ... this is just not cool.
You can install the Snow Leopard Property List Editor application on Mac OS X 10.7 Lion by following this tutorial:
http://sveinbjorn.org/install_property_list_editor_app_on_mac_os_x_lion
The application continues to work just fine in Lion, as long as you also install the now-deprecated framework it relies on. It's just that Apple isn't including it, presumably because they want us to use bloated XCode 4.