moving back from Xcode 4 to Xcode 3.2.6 - iphone

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

Related

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 crashes on opening xib files

I have problems with xcode and can't open xib files. Everytime I click on the xib file, xcode crashes. This happens on the xcode3.2 as well as the xcode4.
Is there anything I can do to it? I have un-installed and re-installed but still not working.
Any help would really be appreciable.
If it helps, I am using xcode4 and bought it from the app store.
My problem was custom fonts in XIB file. I had to install missing fonts on my computer and problem was solved.
The solution to this problem was to re-install my operating system. Basically, I had to re-install Lion and after that everything worked fine. I think the problem had something to do with some library files that were missing.
NOTE: If you have this problem then re-installing your OS might not be the only solution as easier solutions may present themselves. Some of the answers on this question could be of help and in other cases, a simple google or stackoverflow search could be of great aid. You could also try the Xcode mailing list. I would advice resorting to re-installing your OS only if you have tried 'everything' and no one is able to help, hence your plan-Z.
I had this same problem in Xcode 4.3 today. It is definitely a bug in Xcode and it has something to do with opening xib files saved with older versions of Xcode. To work around it, I did the following, some of which may not be necessary, but I'll list it all here just in case:
quit Xcode
copied my xib file foo.xib to foo2.xib
svn rm foo.xib
svn commit
svn update (now foo.xib is not on disk)
open my xcode project, foo.xib shows up in red since it can't find the file. delete foo.xib from the project.
drag foo2.xib from the finder into my project
click on foo2.xib -- for me it opened just fine
At this point I'm pretty sure it's either a subversion conflict with xcode or xcode is keeping a stale reference to a filename around. But now that I have the file open, I do the following:
Show the right-hand-side IDE settings pane (where you can set NIB options).
Click the top left icon in the right-pane (tooltip says "Show the File Inspector").
There is a section called "Interface Builder Document" and under there is a "Document Versioning" popup/combo box. My file shows Xcode 4.2.1, so I changed it to Xcode 4.3.
At this point I also fiddled with a few other settings in my nib, for example changing the title of a Window. The point of this was to make sure the nib would be re-saved.
Now in the left-hand pane that lists the project files, I clicked on "foo2.xib" and renamed it to "foo.xib" -- Xcode automatically adds it back to the subversion repository.
And everything just magically worked after that.
I will point out that I went through and changed all of my nib files after that to save as "Xcode 4.3" under the Document Versioning pane.
I sent a crash report and the nib contents to apple in a bug report but if anyone wants to see what actually happened I pasted it here:
http://pastebin.com/sC0pBUfu
I hope this helps someone, it took me about four hours to sort this out. Recreating nib files doesn't work, its a problem with the filename and IDE-version saved into the nib file I suspect.
Just Install one xcode at a time. Means use Xcode 4 or Xcode 3.2 alone. This may solve your problem. Try that.
Edited with new suggestion from http://www.cocoabuilder.com/archive/xcode/305032-xcode-help.html :
If you have entirely uninstalled and then reinstalled XCode, and by
uninstalled I mean running
sudo /Developer/Library/uninstall-devtools -mode=all
and then trashing /Developer and then reinstalled and it's STILL not
working then from the error I have to think you have a corrupted OSX
or a stray library.
I googled and found a couple of people who succeeded by reinstalled
SnowLeopard (and then upgrading it all the way to latest patch level,
then reinstalling XCode), and there were a few people who had found
stray libraries in /usr/local/include and /usr/local/lib, so you might
want to go look for odd files there, or perhaps TEMPORARILY rename
them and try reinstalling XCode, I'm not sure how much of what's in
there you really need. The particular post I found they guy had
installed ImageMagic and he had removed those libraries from
/usr/local/lib and was working again.
At this point I'd be looking beyond XCode itself and assuming my
system was corrupt.
There's more suggestions on Google, just put in CFXMLNodeGetInfoPtr
and there are loads of posts, more asking than answering.
and Don't use the App Store version. Use the one on Apple.com/Developer for iOS SDK's.
Create a new XIB. Click once. If not:
Don't just open the xib, right click Open As : Source. See if you can see anything, if it still crashes:
Does not seem to a Xcode.pbxproject error
Well, one way can be..:
type interface builder in spotlight
open it.
go to your project and drag & drop your xib to the interface builder on the dock.
It will open.
This problem may be because of multiple versions of xcode on different locations on your mac.
Can't open any xib file for iOS? In your crash log,
Details: Interface Builder encountered an error communicating with the iOS Simulator. "Interface Builder Cocoa Touch Tool" (5963) failed to launch and exited with status (null), signal 5. Please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" for further information.
Have you checked your console log using Console.app? Anyway, it sounds like that your Xcode environment is corrupted.
sudo /Developer/Library/uninstall-devtools -mode=all
If you put any files into /Developer, back it up.
sudo rm -rf /Developer
reboot.
install Xcode.
Its an XCode bug.
Creating a new .storyboard and opening it before opening .xib will fix the crash, at least temporarily.

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

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.

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

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.