Assuming you have:

1)

@interface Car:NSObject{
    NSString *name;
}

//name is private

2)
@interface Car:NSObject{
    NSString *name;
}
@property(nonatomic, retain) NSString *name;

//name is public

//nonatomic means that there is are no problems with multithreading

//reatin means that the setter is now owing the new value ; Usually this
what will be used.
//assign might be used for non object types like BOOL
//copy might be used for NSString

3) Adding:
@synthesize name 

//No need to implement getName / setName

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 W2OM - iPhone by code Suffusion theme by Sayontan Sinha