xCode woes—project will not build or run


#1

I am having difficulties getting this assignment to run on xCode 4.2.1 and the iPhone simulator.

At first it would get stuck at “Attaching…” and the display of the simulator would remain black.

After closing the project, quitting xCode and the simulator, restarting xCode and running anew, I now get the following error:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_BNRAppDelegate", referenced from: objc-class-ref in main.o

And no binary is produced.

Please also note that I created a new blank iOS project and running it also yields the “Attaching” problem.

Please help! This is exasperating and prevents me from continuing my working. Thank you!


#2

It looks like your BNRAppDelegate.m file is not being compiled.

Go into the target’s Build Phases. The one that says “Compile Sources” should include your BNRAppDelegate.m file with all the other .m files. If it does not, drag the file in there.


#3

Thanks, Aaron, this solved the “undefined symbol” problem. However, I am still failing to get the simulator to work. xCode perpetually says that it is “Attaching iTahDoodle,” whereupon my Macbook fans go nuts. I created a blank iPhone project, ran it, and got the same result. Turning off the debugger (GDB) prevents the “Attaching” problem but causes the application to just terminate immediately, with nothing displayed on the simulator screen. I cannot even turn on the simulated phone using the “home” button. The simulator is set to “iPhone” (I have tried both retina and non-retina versions).

It may be relevant that iTahDoodle.app under “Products” in the product navigator is red. Perhaps no executable is produced?

Thank you very much.


#4

UPDATE

I checked out the MacOS console and found out that the installation of the app into the simulator fails:

10/02/12 09:09:17,517 iPhone Simulator: NSUnscaledWindowMask is deprecated and will be ignored. 10/02/12 09:09:18,407 [0x0-0x363363].com.apple.iphonesimulator: launch_msg(): Socket is not connected 10/02/12 09:09:20,065 [0x0-0x363363].com.apple.iphonesimulator: transport_open: Unable to find bootstrap port 10/02/12 09:09:20,066 [0x0-0x363363].com.apple.iphonesimulator: perform_command: Could not create transport connection 10/02/12 09:09:20,066 [0x0-0x363363].com.apple.iphonesimulator: MobileInstallationLookup: failed with -1 10/02/12 09:09:20,081 [0x0-0x363363].com.apple.iphonesimulator: transport_open: Unable to find bootstrap port 10/02/12 09:09:20,091 [0x0-0x363363].com.apple.iphonesimulator: perform_command: Could not create transport connection 10/02/12 09:09:20,091 [0x0-0x363363].com.apple.iphonesimulator: MobileInstallationInstall: failed with -1 10/02/12 09:09:20,157 Xcode: Error launching simulated application: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 … DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}

Any help would be greatly appreciated.


#5

How ironic, a MacOS restart seems to have solved the issue. If you have any idea what may have caused (and solved!) it, please share it.
Thank you for following!