【发布时间】:2012-08-16 12:09:51
【问题描述】:
我正在尝试使用我的注释数组填充我的表格视图,但 XCode 似乎在我添加此代码时给了我一个断点。
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSMutableArray *annotations = [[NSMutableArray alloc] init];
if(indexPath.section == 0)
{
for(Location *annotation in [(MKMapView *)self annotations])
{
if(![annotation isKindOfClass:[MKUserLocation class]])
{
}
}
cell.textLabel.text = [[annotations objectAtIndex:indexPath.row] title];
}
return cell;
我的注释:
CLLocationCoordinate2D thecoordinate59;
thecoordinate59.latitude = 51.520504;
thecoordinate59.longitude = -0.106725;
Location *ann1 = [[Location alloc] init];
ann1.title =@"Antwerp";
ann1.coordinate = thecoordinate1;
NSMutableArray *annotations = [NSMutableArray arraywithObjects: ann.. ann59, nil];
[map addAnnotations:annotations];
【问题讨论】:
-
在这里发布整个
tableView:cellForRowAtIndexPath:方法。这有点乱。 -
for(Location *annotation in [(MKMapview *)self annotations 上的断点
-
控制台说你有什么错误? (断点不是错误)。
-
在详细视图中显示注释数组是如何声明和初始化的。
-
@AnnaKarenina 我有 59 个注释
标签: objective-c ios uitableview mkmapview