Let’s say that I define a ClassA , that implements NSCoding protocol (this class contains several variables such as NSString, NSArray etc.).
I also create a ClassB, that has a variable of type ClassA in it.
Something like this:
@interface ClassB: NSObject <NSCoding>
{
NSString *str;
NSDate *date;
int x;
ClassA *sc;
}
In my program, I’d like to archive a variable of type ClassB.
Is it possible to recursiverly archive custom objects? If so, how?
Thanks!
You need to implement the NSCoding interface for your ClassB:
ClassA must implement the NSCoding protocol as well.