0

有什么问题??名称和布尔值被加载,但图像和坐标没有。所有值都存储在 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);

}
4

0 回答 0