1
我有一个NSObject
类叫做Post
。 A post
有财产URL
。当我的应用程序开始时,使用URL创建新帖子并添加到名为_objects的数组中。当选择表格单元格时,我想在_objects[indexPath.row]
中设置post.url
。从数组中获取对象的属性它在
添加到表:
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;
如果我打电话的时候,选择了小区返回什么simular _objects[indexPath.row]
。