iphone Programming Glossary: unarchiver
How to implement Deep copy for the Class in UIKit? http://stackoverflow.com/questions/10188387/how-to-implement-deep-copy-for-the-class-in-uikit data archiver encodeObject self forKey @ imageViewDeepCopy archiver finishEncoding archiver release NSKeyedUnarchiver unarchiver NSKeyedUnarchiver alloc initForReadingWithData data UIImageView imgView unarchiver decodeObjectForKey @ imageViewDeepCopy.. archiver release NSKeyedUnarchiver unarchiver NSKeyedUnarchiver alloc initForReadingWithData data UIImageView imgView unarchiver decodeObjectForKey @ imageViewDeepCopy unarchiver release data release return imgView @end Usage Import your UIImageView.. alloc initForReadingWithData data UIImageView imgView unarchiver decodeObjectForKey @ imageViewDeepCopy unarchiver release data release return imgView @end Usage Import your UIImageView DeepCopy.h UIImageView imgView1 UIImageView alloc..
How to serialize a UIView? http://stackoverflow.com/questions/1169061/how-to-serialize-a-uiview forKey @ view archiver finishEncoding archiver release return id data UIView viewForData NSData data NSKeyedUnarchiver unarchiver NSKeyedUnarchiver alloc initForReadingWithData data UIView view unarchiver decodeObjectForKey @ view unarchiver finishDecoding..
Persisting Custom Objects http://stackoverflow.com/questions/648143/persisting-custom-objects NSString path orWithMyStuff MyStuff myStuff NSData data NSData alloc initWithContentsOfFile path NSKeyedUnarchiver unarchiver NSKeyedUnarchiver alloc initForReadingWithData data MyArchive myArchive unarchiver decodeObjectForKey myArchiveKey unarchiver.. path NSKeyedUnarchiver unarchiver NSKeyedUnarchiver alloc initForReadingWithData data MyArchive myArchive unarchiver decodeObjectForKey myArchiveKey unarchiver finishDecoding if myArchive myArchive retain else myArchive MyArchive alloc initWithStuff.. NSKeyedUnarchiver alloc initForReadingWithData data MyArchive myArchive unarchiver decodeObjectForKey myArchiveKey unarchiver finishDecoding if myArchive myArchive retain else myArchive MyArchive alloc initWithStuff myStuff unarchiver release data..
|