나는 contact
이라는 사용자 정의 클래스가 있습니다. 이 클래스에는 name, address
등의 속성이 있습니다. contact
유형의 배열을 만들고 UItableview의 사용자 정의 셀에 각 속성 값을 표시하고 싶습니다. 코드 배열에 데이터를 저장하기 :NSString 대신 [myarray objectAtIndex : indexPath.row]에서 객체 가져 오기
[0]->name
[0]->address
[1]->name
[1]->address ....
:
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
// Read the data from the result row
NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
myContact.nm = aName;
NSString *aAddress = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
myContact.address = aAddress;
NSLog(@"%@",aName);
[list.details addObject:myContact];
NSLog(@"%@", list.details);
}
여기 자세한 사항
가 .H내 질문에 @property(nonatomic,retain)NSMutableArray *details;
로 선언 된 배열 것은 어떻게 내가 좋아하는 각 인덱스에 값을 검색 할 것입니다 tableview.m에서
내 코드 : 어떻게
cell.name.text = [details objectAtIndex:indexPath.row]; // not working
내가 해결할 수 있을까?
[details objectAtIndex : indexPath.row] .name을 시도해 보셨습니까? – HKTonyLee