Objective C Primitive Types

150 views Asked by At

I've been reading about the Objective-C datatypes and all the primitive types it inherits from C.

Data types like bool are inherited but type-def to BOOL, so declared like:

BOOL myBOOL;

Where as NSString is declared like:

NSString * myString;

My doubt is how do I know when to use * and when not to? Primitive types don't need *, I know that, but that's a little confusing because

Eg:

NSString * myString;

Where as

NSInteger myInt;

So the doubt really is, I understand using * with Objective C's own data types but no * for primitive types.

But in this example above NSInteger is a primitive type. So how do I differentiate between primitive and non-primitive data types ? (NS prefix clearly isn't the correct answer)

0

There are 0 answers