Amazon.com Widgets Very First Problem
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 09:56:04 AM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Newbie Corner
| | |-+  Very First Problem
Pages: [1]   Go Down
Print
Author Topic: Very First Problem  (Read 352 times)
mitcho
Newbie
*
Posts: 1


Email




« on: November 15, 2011, 05:22:02 PM »

I just started learning from the 3rd edition and immediately I've run into a problem.  When I try to compile the little piece of code called the First program example, xCode returns a 'NSAutoreleasepool is unavailable'.  It would be nice if the 3rd edition had some kind of troubleshooting appendix, so let's hope it gets into the 4th.  In the meantime, any help in getting me to run this ridiculously little program is appreciated.
Logged
Jemcik
Newbie
*
Posts: 22



Email




« Reply #1 on: November 16, 2011, 08:05:36 AM »

You, obviously, are using the last version of Xcode 4.2
So it has some new features, including ARC (Automatic Reference Counting).
This may help you: http://classroomm.com/objective-c/index.php?topic=5763.0
Read it carefully!
Logged
Fred
Newbie
*
Posts: 46






« Reply #2 on: November 17, 2011, 07:45:24 AM »

As alternative, you can just uncheck Use ARC when creating the project and then use the code as written in the book. 

I chose to use ARC since that is the way of the future.  It really only required remembering to keep the code inside the new NSAutoreleasePool template, not use the memory management terms, and leaving out the code dealing with memory management like release, dealloc, and replacing retain with strong.  All else seemed to work just fine.

Your choice.  I know making any changes from the book code can be difficult when first starting.

Fred
Logged

Fred
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.