我正在開發中,我已宣佈伊娃作爲NSIndexPath對象一個應用程序,但它表明在didSelectRowAtIndexPath方法NSArray的對象。它是如何表現的,我身邊發生了什麼錯誤。 請幫幫我。 在此先感謝。NSIndexPath對象顯示爲NSArray對象?
示例代碼:
//.h file:
NSIndexPath *lastIndexPath;
//.m file:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if([[default1 objectForKey:@"keyToRepeatString"] isEqualToString:[arrayRepeat objectAtIndex:i]])
{
lastIndexPath=indexPath;
repeatString=[default1 objectForKey:@"keyToRepeatString"];
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int newRow = [indexPath row];
int oldRow = [lastIndexPath row];
}
int oldRow = [lastIndexPath row];........//Here lastIndexPath shows as NSArray obj?
NSIndex或NSIndexPath? – Ilanchezhian
可以ü請張貼一些示例代碼 – maheswaran
可能是,你忘了保留你的伊娃嗎? –