UII need copy, self controller or self.view, i have tried:
UIView* viewOfSelf =[self.view copy];
UIViewController* controller = [self copy];
UIView* viewOfSelf =[self.view mutableCopy];
UIViewController* controller = [self mutableCopy];
The error is:
-[UIViewController mutableCopyWithZone:]: unrecognized selector sent to instance 0xb803490
-[UIView copyWithZone:]: unrecognized selector sent to instance 0x6e0acb0
Use -
NSData *tempArchiveView = [NSKeyedArchiver archivedDataWithRootObject:self.view];
UIView *viewOfSelf = [NSKeyedUnarchiver unarchiveObjectWithData:tempArchiveView];
Similarly -
NSData *tempArchiveViewController = [NSKeyedArchiver archivedDataWithRootObject:self];
UIViewController *controller = [NSKeyedUnarchiver unarchiveObjectWithData:tempArchiveViewController];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With