Is this a good place to learn some of the language if I have minimal C++ experience? Where would you refer me to online?
Online is really a nightmare (been that route over the last year), unless you just have a quick question. If you have a quick question, a Cocoa forum is a great place to go. Check out Apples cocoa lists. Subscribe. But you don't aways get an answer. Everyone seems to be talking about advanced stuff.
Get Steve Kochans book. It teaches you Objective-C and gives a reference to the C too. It takes you through the foundation but leaves out networking and a few other interesting topics, but it's a great place to start. I've checked the bookshelves and online. There really isn't anything that out does what his book does for beginners. One of it's down sides is that once you get through it, it's not the best reference, because Kochan's examples are progressive. I.e., let's say you read the whole book and started writing programs, but you needed to review your memory management. So you turn to where he talks about memory management. You look at his explanation. His explanation requires that you look back to previous chapters to understand the code example in that chapter. Although, as you get better at understanding the language, assumptions can help you with that problem, but this is really not a good way for beginners, because you spend time on his personal implementation rather than on the concept you are trying to reference.
Once you get familiar with Objective-C, then Cocoa is your next step. Aarons book has the best examples to get you going. "Cocoa Programming for Mac OS X by Aaron Hillegrass" Although, Interface Builder can confuse you because it hides alot of stuff you learn in Objective-C, so when you get to Interface Builder using Cocoa (All Cocoa books use Interface Builder) you'll have to really think about what is happening, because it's easy to get lost with what it hides from you.
The asterik is used in several places:
In your class interface:
Code:
@interface MyClass : NSObject
{
NSArray *myArray;
}
@end
The asterisk here represents myArray as a pointer to an instance of an NSArray object.
It is also used when you declare methods:
In the -myNumber method, it returns a pointer to an instance of NSNumber class.
It is also used in methods that take arguments:
Code:
- (void)setMyNumber:(NSNumber *)number;
the number variable is a pointer to an instance of NSNumber class.
If you don't put that asterisk in there, the compiler will complain you are trying to
"statically allocate an instance of Objective-C class `NSNumber'.