1
반환하기 때문에 내 JSON 문자열을 다운로드하려면 객체를 만들고 NSMutableArray allPartners
에 넣으십시오. 어떻게 든 download
방법을 차단할 수 있습니까?"블록"방법은 numberOfRowsInSection 내 .H 파일이 0
업데이트 : allPartners
이 방법으로 작성됩니다
[serviceConnector download];
-(void)download{
//build up the request that is to be sent to the server
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.bala.com"]];
[request setHTTPMethod:@"GET"];
[request addValue:@"getValues" forHTTPHeaderField:@"METHOD"]; //selects what task the server will perform
//initialize an NSURLConnection with the request
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if(!connection){
NSLog(@"Connection Failed");
}
}
ServiceConnector가 델리게이트를 통해 사용자에게 [table reloadData]를 수행 한 데이터가 있음을 사용자에게 알릴 때; 그리고 그게 다야. 그 사이에 빈 테이블이 생겨 거기에 대기중인 HUD가 표시되거나 "[allPartners count]가 0이면 1을 반환하고 셀에 일부 특수 내용을 채 웁니다."와 같은 논리를 수행 할 수 있습니다. – demosten
다운로드 방법에 대한 코드를 추가하십시오. –
[table reloadData]를 호출하는 방법을 알려 줄 수 있습니까? 다른 반 에서요? – doonot