I have a Singleton class called Constants and I need to set some app wide constants in there. Id like these constants to be readonly. So I did the following in the Constants.h file
@interface Constants : NSObject
{
}
@property (nonatomic, readonly)double U_LAT;
@property (nonatomic, readonly)double U_LNG;
Then in my .m fileI got this method
-(id)init
{
self = [super init];
self.U_LAT = 49.2765;
self.U_LNG = -123.2177;
return self;
}
I get this error from this code:
Assignment to readonly property
Can I not initialize my readonly variable in the init method? If not how do I initialize them?