Friday, April 1, 2011

Objective-c Getting Started ".objc_class_name_NSObject", referenced from

Following the http://www.otierney.net/objective-c.html#gettingstarted tutorial, I got the following error:

".objc_class_name_NSObject", referenced from:
.objc_class_name_Fraction in Fraction.o
"_objc_msgSend", referenced from:

It was caused because there was missing a link to a framework: "Foundation.framework".

So, you can add existing frameworks to you project in XCode4 following these steps:

  1. In the project navigator, select your project
  2. Double click your target
  3. Select the 'Build Phases' tab
  4. Open 'Link Binaries With Libraries' expander
  5. Click the '+' button
  6. Select your framework (Foundation.framework)
Done.

references:
http://forums.macnn.com/79/developer-center/391122/newby-trying-learn-obj-c-xcode/
http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4

No comments: