Twitter 검색에서 JSON 데이터를 가져 오는 UITableView가 있습니다. 보기를 자동 새로 고치기 위해 폴링을 사용하고 있습니다.UITableView 새로 고침 충돌
[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(autoTweets:) userInfo:nil repeats:YES];
을하고 내가 가진 : 내있는 viewDidLoad에서
, 내가 가진
-(void) autoTweets : (NSTimer *)theTweets
{
NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/search.json?q=%23hatlive%20-%22RT%20%40%22"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
connection = [NSURLConnection connectionWithRequest:request delegate:self];
if (connection)
{
webData = [[NSMutableData alloc] init];
}
[[self myTableView]setDelegate:self];
[[self myTableView]setDataSource:self];
array = [[NSMutableArray alloc] init];
}
가하고이 데이터를 10 초마다 새로 고쳐집니다. 문제는 코드가 실행될 때 10 초 스크롤하면 앱이 충돌한다는 것입니다. 스크롤하지 않으면 잘 업데이트됩니다. 아무도 이유를 아나요?
위임 구현을 게시 할 수 있습니까? 어디에서 추락합니까? 여러 스레드를 사용합니까? –