using sqlite data for dispalying the line on the map [closed]
I want to retrieve the longitudes and latitudes from sqlite data, and then add this data into the array and use this array data as fake_location for displaying the location of the user.
For solving this problem I am sending all my class TLocationManager.m file code -(id)init{ pointsArray = [[result componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] retain]; NSLog(@"This is the good think to have %@",pointsArray); pointsArrayIndex = 0; //NSLog(@"%@",pointsArrayIndex); oldLocationsIndex = 0;
[result release];
oldLocations = [[NSMutableArray alloc] init];
return self;
}
For your first warning
[locations addObject:[NSString stringWithFormat:"%@,%@",dLongitude,dLatitude]];//over here i am getting warring passing argument 1 of 'stringWithFormat:'from incompatible pointer type
replace it with
[locations addObject:[NSString stringWithFormat:@"%@,%@",dLongitude,dLatitude]];//over here i am getting warring passing argument 1 of 'stringWithFormat:'from incompatible pointer type
Second, Where did you get componentsByJoiningString function for NSMutableArray.
//Over here getting warring 'NSMutableArray' may not respond to'-componentsByJoiningString'
result = [locations componentsByJoiningString:@" "]; // same as `fake_location`function
replace it with
result = [locations componentsJoinedByString:@" "];
See NSArray Documentation..
精彩评论