Simple Properties in Objective-C Classes

Posted by tarnfeld on Stack Overflow See other posts from Stack Overflow or by tarnfeld
Published on 2010-12-26T16:00:15Z Indexed on 2010/12/26 18:54 UTC
Read the original article Hit count: 386

Filed under:
|
|
|

Hey,

I've bene working with Objective-C for a while now, and so far I have never really needed to craft my own classes, properly.

I am a bit confused with the two arguments you can give the @property(a, b) declaration in a header file. When creating outlets to Interface Builder I usually do @property(nonatomic, retain) but I have no idea what this means.

I'm writing a simple class which has a set of properties which will be set from the outside, like [instance setName:@"Bla Bla Bla"]; or I guess like instance.name = @"Bla@" but I would rather the first option.

How would I declare this kind of property on a class?

Thanks in advanced! Sorry for the n00bish question :-)

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about class