NSMutableArray の反復処理がどのように機能するのか疑問に思っていましたが、objectAtIndex を呼び出すと、「*** -[NSCFSet objectAtIndex:]: unrecognized selector sent to instance 0x...」で失敗します。
ここにいくつかのサンプル コードがあります。プログラムは大きすぎて全体を共有できないので、これで十分だと思います。コードは、XCode の最新の iPhone シミュレーターで実行されます。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
RDLogString(@"Creating cell @ row no. %d", indexPath.row);
CPPlayerAppDelegate * appDelegate = [[UIApplication sharedApplication] delegate];
RDLogString(@"Conversations: %p. Item count: %d", appDelegate.distribution.conversations, appDelegate.distribution.conversations.count);
//This works
for(CPConversation * x in appDelegate.distribution.conversations){
RDLogString(@"Pointer: %p with name %@", x, x.name);
}
//This fails with aforementioned error
CPConversation * conversationAtCurrentIndex = [appDelegate.distribution.conversations objectAtIndex: indexPath.row];
フォーマットが悪くて申し訳ありませんが、まだそれを理解しています。:)
前もってありがとう、ニック