I've got a SIGABRT
when I assign value to the property "myLocal" of the class CMRequestManager
in a Singleton
Init. What's wrong?
@interface CMRequestManager (private)
@property (nonatomic,strong) NSString* myLocal;
@end
@implementation CMRequestManager
#pragma mark Singleton Methods
+ (id)Manager {
static CMRequestManager *sharedMyManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedMyManager = [[self alloc] init];
sharedMyManager.myLocal = @"test test"; //SIGABRT !!!!
});
return sharedMyManager;
}
- (id)init {
if (self = [super init]) {
}
return self;
}
@end
EDIT:
Ok, I've found a solution: move property "myLocal" in the header file outside the class extension:
@interface CMRequestManager
@property (nonatomic,strong) NSString* myLocal;
@end
This work, but I don't understand why. So the question remain: What's wrong in my previous code?