iphone - How to serialize a UIView? -
Is it possible to serialize the UIView
object? If yes, how can I do this?
UIView
applicable NSCoding
protocol, so that you You can use encodeWithCoder:
to get a serialized presentation, and represent the initWithCoder:
from a UIView
to rebuild this way . You can find a lot of details in
This is a quick example of how to do this:
- (NSDTA *) Datatourview: (UIUUE) * See {NSMutableData * Data = [NSMutableData Data]; NSKeyedArchiver * archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data]; [Collector encoded object: see for: @ "view"]; [Archive end encoding]; [Archival release]; Return data; } - (UIView *) ViewForadata: (NSData *) Data {NSKAdUserAzer * Anarkaizar = [[NSKAdUnchijar Elok] InitfourdatDataDataData Data]; UIView * View = [Anarchive decoded objectForcae: @ "view"]; [Autocomplete finish decoding]; [Unchanged release]; Return view; }
Comments
Post a Comment