< Home
Objective-C use of pointers

When do you and when dont you need the * symbol (which is because in objective-c all variables like NSString are pointer variables)?

For example when do you need to do "NSString *" instead of just "NSString"?

by Devoted
on 6/30/2009 11:54:28 PM

In Objective-C, all object references are pointers, so you always need the pointer operator when you declare with an Objective-C object.

For other types, the use is exactly the same as in C. Use pointers when you want to pass data structures or primitive types by reference.

by Jason Coco on 6/30/2009 11:57:25 PM

Stackoverflow.mobi is not affiliated with stackoverflow.com but uses their public data dump to provide mobile access to stackoverflow.com's data