私はiVarを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
あなたの象牙を保持することを忘れているかもしれませんか? –