Ios 使用sqlite数据在地图上显示线

Ios 使用sqlite数据在地图上显示线,ios,cocoa-touch,sqlite,mkmapview,Ios,Cocoa Touch,Sqlite,Mkmapview,我想从sqlite数据中检索经度和纬度,然后将这些数据添加到数组中,并使用这些数组数据作为假位置来显示用户的位置 为了解决这个问题,我发送了我所有的类TLocationManager.m文件代码 -(id)init{ pointsArray=[[result componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]保留]; NSLog(@“这是一个好主意,应该有%@”,point

我想从sqlite数据中检索经度和纬度,然后将这些数据添加到数组中,并使用这些数组数据作为假位置来显示用户的位置

为了解决这个问题,我发送了我所有的类TLocationManager.m文件代码 -(id)init{ pointsArray=[[result componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]保留];
NSLog(@“这是一个好主意,应该有%@”,pointsArray); pointsArrayIndex=0; //NSLog(@“%@”,PointsRayIndex); oldLocationsIndex=0

    [result release];

    oldLocations = [[NSMutableArray alloc] init];
    return self;
}
作为你的第一个警告

[locations addObject:[NSString stringWithFormat:"%@,%@",dLongitude,dLatitude]];//over here i am getting warring  passing argument 1 of 'stringWithFormat:'from incompatible pointer type
换成

[locations addObject:[NSString stringWithFormat:@"%@,%@",dLongitude,dLatitude]];//over here i am getting warring  passing argument 1 of 'stringWithFormat:'from incompatible pointer type
result = [locations componentsJoinedByString:@" "];
第二,您从哪里获得NSMutableArray的componentsByJoiningString函数

 //Over here getting warring 'NSMutableArray' may not respond to'-componentsByJoiningString'    
 result = [locations componentsByJoiningString:@" "]; // same as `fake_location`function
换成

[locations addObject:[NSString stringWithFormat:@"%@,%@",dLongitude,dLatitude]];//over here i am getting warring  passing argument 1 of 'stringWithFormat:'from incompatible pointer type
result = [locations componentsJoinedByString:@" "];

请参见NSArray..

这是一个好主意(空)它显示在控制台中我的数组仍在获取空值我想显示sqlite数据,如下42.336845,-71.12623942.336953,-71.1263942.337103,-71.1265442.337275,-71.126711 42.337457,-71.126883 42.337629,-71.127076 42.3378,-71.12726942.337908,-71.127419 42.338026,-71.12757 42.338079,-71.127656在结果中你的意思是这样吗“result=[locations componentsJoinedByString:@(”);“请参阅我的编辑..如果要插入coma(,)put',”。如果要插入空格put space(”),仍然显示空值。我认为sqlite数据获取空值的方式存在问题。它没有执行sqlite select语句。”