views:

1238

answers:

7

I have an iPhone (Xcode) Project that was working fine. Something must have been changed, because all of a sudden I am getting errors that pertain to NSLog, UIActionSheet, and several other items I have been using JUST FINE until now. What am I missing? Any assistance would be GREATLY appreciated!

Checking Dependencies

Ld /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator/iPhone_PNP.app/iPhone_PNP normal i386
    cd /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk -L/Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator -F/Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator -filelist /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/iPhone_PNP.build/Debug-iphonesimulator/iPhone_PNP.build/Objects-normal/i386/iPhone_PNP.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator/iPhone_PNP.app/iPhone_PNP
Undefined symbols:
  ".objc_class_name_SettingsWindowViewController", referenced from:
      literal-pointer@__OBJC@__cls_refs@SettingsWindowViewController in iPhone_PNPAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
+1  A: 

Try a clean build.

GoatRider
Please see post below.
Dutchie432
A: 

Ok - so I tried a clean build I am down to one error. It is similar to the other errors in the the error occurs only upon build. There are no visible red-marker errors in my code...

framework UIKit -framework CoreGraphics -o /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator/iPhone_PNP.app/iPhone_PNP

Undefined symbols:
  ".objc_class_name_SettingsWindowViewController", referenced from:
      literal-pointer@__OBJC@__cls_refs@SettingsWindowViewController in iPhone_PNPAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Dutchie432
Looks like a missing library. Don't have my references open right now to help you figure out which one. You might try re-installing the SDK.
GoatRider
I will try that. Thank You.
Dutchie432
No good. Thanks for the suggestion tho.
Dutchie432
+1  A: 

You have not defined the class SettingsWindowViewController anywhere.

From your solution (remove SettingsWindowViewController.m from the project and re-add it) it looks like they were not included in the target's "compile sources" stage Ias suggested by cdespinosa). You can check this by opening the "compile Sources" twistie in the target item in the "Groups and Files" pane.

In addition to the methods cdespinosa suggests for setting target membership, you can aslo show an extra column with "target memebership" in the "groups and files" pane by left clicking on the header.

Roger Nolan
Or the file isn't included in the build.
Jesse Rusak
Please see my posted code below... this is my appdelegate code. There is also a 'SettingsWindowViewController.h' and '.m" file in my project.
Dutchie432
Its not formatting properly on here...can I email you?
Dutchie432
Actually you can check out my project (if you would be so kind).http://www.jasongoldberg.com/files/iPhone_PNP.zip
Dutchie432
A: 

Would anyone mind checking out my project? Its very small and basic. I would love an explanation as to why I am getting the error that I am, being I am new to the environment.. You've all been very helpful so far! thanks!

http://www.jasongoldberg.com/files/iPhone_PNP.zip

Dutchie432
A: 

OK - I found the problem from this URL: http://forums.macrumors.com/showthread.php?t=475818

I simply had to remove my SettingsWindowViewController.h & SettingsWindowViewController.m files from my project and re-add them. Problem resolved.

Thank you all!

Dutchie432
I suspect that means they were not included in the target.
Roger Nolan
Im not sure how thats possible, the files were clearly in the project to begin with, and I didn't change any code to get it working. Sounds like a bug to me..
Dutchie432
+3  A: 

You resolved the problem, but you probably don't know why. It's probably important to know what was wrong and why doing what you did fixed it, so you can make it not happen again.

The problem was most likely that your SettingsWindowViewController.m file was not a member of the iPhone_PNP target you were building. Projects are just containers; targets actually build things, and if a file is in the project but not assigned to a target, it won't get built.

Removing the files and re-adding it defaulted to adding it to the current target. You might have seen a list with a check box in it and paid no attention to it, but that check box is what fixed the problem.

The easier way to do this in the future is to just drag the source file into the target, or choose Get Info on it and click the target's check box in the General tab.

cdespinosa
Thanks for the explanation. Once I resolved the problem, I did do a bit of research as to why it occurred, but your explanation is much better. I am still getting used to the IDE provided (I am a VB programmer) and people like you are what get me by!
Dutchie432
A: 

Man, thanks to everyone who replied on this. I had the same issue and it was driving me up the wall. I did the same thing...removed the suspect files and re-added them.

I love this site. I hope experts-exchange withers.

Nathan187