Search code examples
iosuiimagenskeyedarchiver

Saving pictures in IPhone apps


I have an app with array of objects, which i archived and unarchived

-(id)initWithCoder:(NSCoder *)aDecoder{
    title = [aDecoder decodeObjectForKey:@"Title"];
    image = [aDecoder decodeObjectForKey:@"Image"];
    return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:title forKey:@"Title"];
    [aCoder encodeObject:image forKey:@"Image"];
}

will UIImage store okay in this way?


Solution

  • Coder and Decoder , which was implement in the question are OK