1.检查当前ViewController是present 还是push
- (BOOL)isModalPresent {
return self.presentingViewController.presentedViewController == self
|| self.navigationController.presentingViewController.presentedViewController == self.navigationController
|| [self.tabBarController.presentingViewController isKindOfClass:[UITabBarController class]];
}
2.NSDictionary 和 NSData 转换
NSDictionary -> NSData:
NSData *myData = [NSKeyedArchiver archivedDataWithRootObject:myDictionary];
NSData -> NSDictionary:
NSDictionary *myDictionary = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:myData];
|
|