내 프로젝트에서 데이터베이스에서 읽은 데이터는 할당 된 객체에 할당됩니다. 객체가 NSMutableArray에 추가 된 후 그리고 나서 객체가 해제됩니다. 이런 식으로 어떤 문제가 있습니까? 내 소스 코드 :NSMutable 배열에 객체 추가 및
while (sqlite3_step(statement) == SQLITE_ROW)
{
TopicEntry *temp = [[TopicEntry alloc] init];
ruleName = (char *)sqlite3_column_text(statement, 2);
[temp setTopicName:(ruleName) ?[NSString stringWithUTF8String:ruleName] :@""];
[temp setParentID:(int)sqlite3_column_int(statement, 2)];
[rules addObject:temp];
[temp release];
}
의심의 여지가 있습니다. 제발 도와주세요. 만약 내가 쓴다면 : TopicEntry * t = [TopicEntry alloc] init]; t = [topicActIndex : 0]; // 일부 작업을 수행했습니다 [t release]; 이 코드는 NSMutableArray에서 실제 객체를 릴리스 할 예정입니까? 제발 도와주세요, 전이 분야에 더 신선합니다. –