1
Post
이라는 NSObject
클래스가 있습니다. post
의 속성은 URL
입니다. 응용 프로그램이 시작되면 URL로 새 게시물이 만들어지고 _objects라는 배열에 추가됩니다. 표 셀을 선택하면 post.url
을 _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]
를 호출하면