initializing a readonly property. Object c
- by tak
i was trying to create a property which is readonly. i wanted to initialize with a value from the class creating an instance of this class.e.g
@property (readonly) NSString *firstName;
And wanted to initialize it like
-(id)initWithName:(NSString *)n{
self.firstName = n;
}
Once i do this, this compiler shows an error that the readonly property…