Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Meriana

macrumors member
Original poster
Aug 31, 2009
83
0
Hi everyone

I'm sure if read it, but i can't find it in the book about Objective-C 2.0 i'm using anymore:

What means the * infront of a the name of a new instance of an class:

Code:
NSObjects [B]*[/B]newObject 

or in cases like this:
-(void)setName:(NSString [B]*[/B])newName

thanks in advance.
 
In Objective-C every object is stored on the heap, with pointers on the stack used to access them (via message passing). Because of this, every object instance you're dealing with will be via pointer. You can also have pointers to primitive types, just as in C, but these are going to be treated differently. They will be manipulated using * to dereference, etc instead of having messages passed. You can probably get by without it, but this is a major reason I think a foundation in C helps when learning Objective-C.

-Lee
 
Well thanks. :)

Though either i have a really good book or Objective-C 2.0 is really easy to learn.

Do you think i should get myself a book with a quick introduction to C?
 
I do. Other people disagree. I think a foundation in C is helpful, but it's probably not strictly necessary. I feel like knowing C is a net positive, I don't think anything you learn will be useless in other languages.

-Lee
 
You might want to have a look at this tutorial. It has a really great section on how memory works, that should prove helpful. I don't think you need to be a C guru to work through introductory Cocoa books, but a solid understanding of the fundamental concepts (such as memory management, pointers, variable scope etc.) is pretty essential.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.