回答
Below is the function which i m using to fill array with the help of Database
RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate getallrecords];
self.namesArray=appDelegate.rs;
///filling array with database
for (int i=0; i<namesArray.count; i++) {
Food *product = (Food *)[self.namesArray objectAtIndex:i];
NSLog(@"%d",i);
appDelegate.mylatitude=product.Latitude;
appDelegate.mylongitude=product.Longitude;
/// this function is use to call the class which is use to drop pin on map
BridgeAnnotation *BridgePin = [[BridgeAnnotation alloc] init];
[self.mapAnnotations insertObject:BridgePin atIndex:kBridgeAnnotationIndex];
[BridgePin release];
}
/////CLASS BRIDGE ANNOTATION below is the function getting cordinate from above function n droping pin
- (CLLocationCoordinate2D)coordinate;
{
RecipieAppDelegate *appDelegate = (RecipieAppDelegate *)[[UIApplication sharedApplication] delegate];
Food *product;
CLLocationCoordinate2D theCoordinate;
// theCoordinate.latitude = 37.810000;
// theCoordinate.longitude = -122.477989;
theCoordinate.latitude = [appDelegate.mylatitude doubleValue];
NSLog(@"%f", theCoordinate.latitude);
theCoordinate.longitude = [appDelegate.mylongitude doubleValue];
NSLog(@"%f", theCoordinate.longitude);
return theCoordinate;
}
好,我完全在阵列5次运行循环,但其传递的最后一个值,以第二功能
等待你回复
您不会更改kBridgeAnnotionIndex的值。您的所有BridgePin都插入到相同的索引中! 你在哪里调用方法坐标? – MathieuF 2010-10-01 11:54:36
以及我定义bridgeannotionindex像这样enum { kBridgeAnnotationIndex }; (IBAction)cityAction:(id)sender { [self.mapView addAnnotation:[self.mapAnnotations objectAtIndex:kCityAnnotationIndex]]; } 您能否请我改正我的代码 – 2010-10-01 18:04:04
尝试改变以更改kBridgeAnnotationIndex与我。但是如果没有更多的代码就很困难。 – MathieuF 2010-10-06 21:22:12
- 1. Mapkit多注释
- 2. IPhone SDK MapKIt多重点和注释
- 3. MapKit地图 - 注释上的模拟器
- 4. 具有多个注释的Mapkit
- 5. iPhone - 在mapkit中更新注释字幕
- 6. iPhone 3.0 MapKit - 同一位置的多个注释
- 7. 当前位置的iPhone mapKit注释
- 8. 有多个引脚注释? MapKit
- 9. 如何在iPhone上的地图注释标注上创建多个字幕
- 10. 在MapKit视图上管理超过10000个注释
- 11. IOS 4.3.2 MapKit注释
- 12. 在mapkit中搜索注释
- 13. 将uipopovercontroller的箭头放在mapkit上的注释点
- 14. Postion在没有segue锚的mapkit注释上出现segue popover
- 15. MapKit MapView在真实设备上重叠的注释
- 16. 在地图上放弃多个针脚给定坐标Mapkit iPhone
- 17. 带注释和IBAction的Mapkit加载针脚上的新视图
- 18. 有关mapkit注释的多个图像的帮助
- 19. mapkit显示注释默认
- 20. Mapkit显示注释区域
- 21. 自动显示MapKit注释
- 22. MapKit注释未出现
- 23. 无法在iPhone上显示地图上的自定义注释
- 24. Iphone Mapkit:在地图上显示图像
- 25. iPhone - 在mapkit上保存为kml文件
- 26. mapkit标注纠错iphone
- 27. MapKit从核心数据中添加多个注释
- 28. iOS SDK - MapKit MKAnnotationView问题 - 位置和多个注释?
- 29. iPhone MapKit多注释问题。这是继续进行的正确方法吗?
- 30. 如何添加多个注释为iPhone
我想我知道。但没有看到你的代码,它是不可能找到你的错误... – Vladimir 2010-10-01 07:50:17
只是回应弗拉基米尔的请求 - 请张贴您的代码。 – dannywartnaby 2010-10-01 08:16:55