How to archive UIView and its subviews using NSCoding protocol and NSKeyedAchiever? I have seen many examples for archiving NSObject class object but i am not able to archive the UIView and its subviews and their properties and state. Can any body help me??
Asked
Active
Viewed 1,244 times
-2
-
read this if it helps you http://stackoverflow.com/questions/8722067/archiving-uiview-object-which-holds-uiimageview-and-uiimage-as-a-subview-of-it-i http://stackoverflow.com/questions/9494685/archive-the-uiview-controls-uiimageview-uiscrollview-uitableview-uibutton – Saad Jun 14 '12 at 09:40
-
Can you give me some examples. – Prerna chavan Jun 14 '12 at 09:43
-
there are examples on links above – Saad Jun 14 '12 at 09:47
1 Answers
0
It doesn't matter whether the example is for NSObject
or UIView
, Because every object in iOS has inherited from NSObject
. So you can apple same tutorial with UIView
or any other "Object" in iOS.
This previously asked question has answer with sample code in it.
&
Ofcourse you can check the, insanely great Apple Documentation
Good luck!
-
1Technically the inheriting from NSObject is not enough. It needs to conform to NSCoding to work with an archive. – chadbag Oct 10 '12 at 20:11