というNSObject
クラスがありPost
ます。Apost
はプロパティ を持っていますURL
。私のアプリケーションが起動すると、新しい投稿が URL で作成され、_objects という配列に追加されます。post.url
表のセルが選択されているときに、何かをinに設定したい_objects[indexPath.row]
。
テーブルへの追加:
NSMutableArray *newPosts = [[NSMutableArray alloc] initWithCapacity:0];
for (SomeElement *element in postNodes) {
Post *post = [[Post alloc] init];
[newPosts addObject:post];
post.title = [[element firstChild] content];
post.url = [element objectForKey:@"href"];
}
_objects = newPosts;
セルが選択されたときに呼び出す_objects[indexPath.row]
と、セルが返されるか、何か似たようなものになります。