I have a weak property:
@property (nonatomic,weak) NSManagedObjectID *locatedMessageID;
App will crash when calling -(void)setLocatedMessageId
. The error is:
EXC_BAD_INSTRUCTION(code=EXC_I386_INVOP).
To solve this problem, only replace 'weak' keyword to 'assign'.
@property (nonatomic,assign) NSManagedObjectID *locatedMessageID;
But is it safe? Why I cannot use weak property here?