回答
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