I want to store custom objects in NSUserDefaults. I read the Apple doc and know NSUserDefaults can store only property lists such as
NSArray, NSNumber, NSData, NSDate, NSDictionary and NSString.
If I want to store custom object, then I need to implement NSCoding protocol.
I need someone can clarify a little bit for the following class:
@interface MyDrawBlock : BlockInfo
{
CGPoint _blockUpLeft;
CAShapeLayer* _shapeLayer;
int _blockColorFlag;
int _strokeColorFlag;
}
I have CAShapeLayer* _shaperLayer in my class. How can I store MyDrawBlock in NSUserDefaults?
If I implement NSCoding protocol, then how I can store CAShapeLayer* _shapeLayer.