Cocoa Programming book by Aaron Hillegas question

Status
Not open for further replies.
Joined
Feb 15, 2009
Messages
6
Reaction score
0
Points
1
Hi,

I'm a C / C++ / Java programmer and a few years ago I picked up a copy of the Cocoa Programming book by Aaron Hillegas as it looked as if I had to develop applications for the OS X platform. The book was highly recommended. It did not turn out that way though and I never had time to read the book or learn obj C and Cocoa.

Now I do have to develop for the OS X platform, I have the second edition of the book but noticed that a third one has come out, as I don't have a lot of money I wonder if it's worth the expense to get the new edition or if I can read up on obj C 2, garbage collector and new core features on other places just as well and build from the second edition of the book? :)

Thanks in advance! :)
 
Joined
Jan 23, 2009
Messages
162
Reaction score
1
Points
18
Location
Indiana
Your Mac's Specs
Soon to own
It depends, do you feel that the newest version is necessary for you?

Or is the older version enough for you to enjoy programming?
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
Apple has changed the development environment enough that the new book is likely worth it for you, if you are getting paid for this development.
 
Joined
Mar 15, 2007
Messages
161
Reaction score
4
Points
18
Your Mac's Specs
17" MacBook Pro, 2.33GHz C2D, 2GB RAM
I also had the 2nd edition of the book, but didn't get around to really digging into it myself until after I'd upgraded to Leopard and Xcode 3. I even started trying to go through the 2nd edition with Xcode 3, exactly like what you are thinking, but it didn't take long for me to realize that enough things had changed that I was just going to get frustrated unless I got the 3rd edition of the book as well. So I did get the newer edition, and never regretted it.

(This of course is assuming that you're going to be asked to develop using Xcode 3.x, rather than Xcode 2.x.)
 
OP
S
Joined
Feb 15, 2009
Messages
6
Reaction score
0
Points
1
I am indeed going to have to develop using xcode 3.x, I suppose there is no way out of it but to buy the new edition of the book. It'll most likely repay itself in saved time.

Thanks to everyone who answered :)
 
Joined
Apr 13, 2009
Messages
3
Reaction score
0
Points
1
I wish Aaron had a site where we could ask questions about code snippets he talks about doesn't seem to work. I'm obviously missing something but it very frustrating when an example doesn't work and there doesn't seem to be an explanation. On Pg 90 of his Third edition book there is a code snippet that shows how to programatically add a target selector to a button. When I add the code I get an error message saying "Error: 'Testbutton undeclared first use of this function" here's the code snippet. I have a button labeled TestButton in interface builder as well as the appController object and sayIt: function.

SEL mySelector;
//mySelector = NSSelectorFromString(@"sayIt:");
mySelector = @selector(sayIt:);
[TestButton setTarget:AppController];

[TestButton setAction:mySelector];

as anybody run into this?



PS> My vote is for the new book
 
Joined
Apr 13, 2009
Messages
3
Reaction score
0
Points
1
No need to wish for it, it's right here: http://techstra.bignerdranch.com/

Thanks for the link. I did see that site but for some reason I didn't make the connection that i could leave messages there regarding his book. I posted my problem there on Pg 90 of his book but so far have not seen a response. Could you or someone here perhaps answer my question.
I'm trying to understand how to add an action and target programmatically using the code snippet he provided. I seem to be missing the link to the TestButton I created in Interface builder. Is there a .h file I need to include. Is this error telling me that it does not recognize the button I created? It seem that it does since as soon as I start to enter "TestB" the auto complete kicks in and adds the "utton".
 
Joined
Apr 13, 2009
Messages
3
Reaction score
0
Points
1
OK, Nobody seems to be jumping in here. Am I posting in the wrong place? I am making some progress though so I'll divulge what I'v done so far. I seem to have gotten rid of the error by declaring an "IBOutlet NSButton *testButton;" and linked it from my appController class to the TestButton in interface builder. I also moved "SEL mySelector;" to the .h file. I notice though that if I stopped the debugger at the line before "[TestButton setAction:mySelector];" I do not see an address assigned to TestButton.

I know I may be doing this all wrong but that why I need some direction. Please help!!
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
TheCat007, you may not be getting a response to you question because you high jacked a thread. It is best to start a new one. The only reason I saw this is because I'm subscribed to this thread, for now.

The error suggests that you haven't declared (or perhaps initialized) TestButton. Perhaps the capitalizaion is wrong; lower case b in the message and upper case B in name in your code sample.
 
Status
Not open for further replies.

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top