可能有什么问题?名称和bool值被加载但是图像和坐标没有。所有值都存储在plist中我检查过。感谢您的建议
-(NSDictionary *)makePropertyListDictionary{
NSMutableDictionary *plistTrick = [[NSMutableDictionary alloc] init];
NSData *data = UIImageJPEGRepresentation(self.trickPhoto,0.8);
if(data){
[plistTrick setObject:data forKey:@"image"];
}
[plistTrick setObject:self.trickName forKey:@"name"];
[plistTrick setObject:@(self.pinNotation.coordinate.latitude) forKey:@"latitude"];
[plistTrick setObject:@(self.pinNotation.coordinate.longitude) forKey:@"longtitude"];
[plistTrick setObject:@(self.landed) forKey:@"landed"];
return plistTrick;
}
-(void)readPlistDictionary:(NSDictionary *)trickFormPlist
{
NSArray *imageArray = [trickFormPlist objectForKey:@"image"];
if(self.trickPhoto){
self.trickPhoto = [UIImage imageNamed:[imageArray objectAtIndex:0]];
}
self.landed = [[trickFormPlist valueForKey:@"landed"]intValue];
self.trickName = [trickFormPlist objectForKey:@"name"];
double latitude = [[trickFormPlist objectForKey:@"latitude"] doubleValue];
double longitude = [[trickFormPlist objectForKey:@"longtitude"]doubleValue];
self.pinNotation.coordinate = CLLocationCoordinate2DMake(latitude, longitude);
}