2013-02-05 38 views
0

我得到這個警告「Incopatible指針整數轉換髮送nsstring到參數類型'NSUIInteger'(aka unsigned Int)」在下面的語句中如何解決這請指導提前致謝。Incopatible整數轉換指針發送nsstring到類型'NSUIInteger'的參數

DetailTitLbl.text=[lat_long_Array objectAtIndex:parTbl.placemark_Title]; 

parTbl.placemark_Title - >是存儲在覈心數據表中的字符串類型。 任何指導將不勝感激。

回答

1
DetailTitLbl.text=[lat_long_Array objectAtIndex:[parTbl.placemark_Title intValue]]; 

試試這個

+0

是感謝您的快速reply..and多了一個疑問,我怎麼可以更新標籤(我只有一個標籤),當我點擊MK註釋詳細披露按鈕時,標籤應顯示地名(我存儲在覈心數據表中),那麼如果我點擊另一個披露按鈕,它應該更新該標籤上的地名。 – suvarna

+0

任何人都可以給我這個想法。謝謝。 – suvarna

0

法 'objectAtIndex' 必須有一個是NSInteger的參數。

您可以轉換該變量。

NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init] 
NSInteger index = [[numberFormatter numberFromString:parTbl.placemark_Title] intValue] 
DetailTitLbl.text=[lat_long_Array objectAtIndex:index]; 
相關問題