NSLog(@"%@",NSStringFromSelector(_cmd));
// NSData 转至 UIImage
NSData *imageData = [NSDatadataWithContentsOfFile: imagePath];
UIImage *aimage = [UIImageimageWithData: imageData];
//UIImage 转至 NSData
NSData *imageData = UIImagePNGRepresentation(aimae);
//===== 读取串行化文件 =====
NSString *resourcePath = [[NSBundlemainBundle]resourcePath];
NSString *path = [[NSStringalloc]initWithFormat:@"%@/president.plist",resourcePath];
NSData *data = [[NSDataalloc]initWithContentsOfFile:path];
President *thePres = [NSKeyedUnarchiverunarchiveObjectWithData:data];
//===== 读取串行化文件 =====
//===== 保存串行化文件 =====
NSString *resourcePath = [[NSBundlemainBundle]resourcePath];
NSString *path = [[NSStringalloc]initWithFormat:@"%@/president.plist",resourcePath];
NSData *data = [NSKeyedArchiverarchivedDataWithRootObject:self.president];
if([data writeToFile:pathatomically:NO])
{
UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"System"message:@"保存成功!" delegate:nilcancelButtonTitle:@"OK"otherButtonTitles:nil,nil];
[alertshow];
[alertrelease];
}
//===== 保存串行化文件 =====
//访问主控委托
AppDelegate *delegate = [[UIApplicationsharedApplication]delegate];
//访问主程序
UIApplication *app = [UIApplicationsharedApplication];