0

我正在尝试将位置对象(标题、描述、CLLocation)存储在 NSMutableArray 中,但是只有描述被添加到数组中。所有属性都可用,但只有描述文本被添加到数组而不是对象。我究竟做错了什么?

        NSMutableArray *locArray= [[NSMutableArray alloc]init];
        ...

        NSLog(@"myLoc : %@", myLoc);
        NSString *title = myLoc [@"title"];
        NSString *desc = myLoc [@"description"]; 
        PFGeoPoint *geoPoint = [[PFGeoPoint alloc]init];
        geoPoint = [myLoc objectForKey:@"location"];//location; 
        NSLog(@"GEO POINT : %f", geoPoint.latitude);


        PDLocation *PDLoc = [[PDLocation alloc]initWithName:title description:desc andLocation:CLLocationCoordinate2DMake(geoPoint.latitude, geoPoint.longitude)];
        NSLog (@"PDLOC : %@", PDLoc.name);
        NSLog (@"PDLOC : %@", PDLoc.description);
        NSLog (@"PDLOC : %f", PDLoc.location.latitude);
        [locArray addObject:PDLoc] ;
4

0 回答 0