-2

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??

Prerna chavan
  • 3,179
  • 7
  • 35
  • 77
  • 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 Answers1

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.

How to serialize a UIView?

&

Ofcourse you can check the, insanely great Apple Documentation

Good luck!

Community
  • 1
  • 1
TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
  • 1
    Technically 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