내 PHP 스크립트와 대화하고 내 데이터베이스에서 데이터를 가져 오는 데 사용할 모든 메서드가 포함될 nsobject를 만들고 싶습니다.nsObject ASIHTTPRequests를 사용하기 위해
나를 위해이 작업을 수행하는 ASIHTTPRequest 래퍼를 사용하고 싶습니다. 그러나 다른 PHP 스크립트 (또는 다른 함수가있는 동일한 PHP)를 호출하는 여러 메서드가 있으므로이 nsobject를 구조화하는 방법을 잘 모르겠습니다.
어디에서 데이터를 가져올 지 모르겠으므로 뷰에서 nsobject 메서드를 호출하는 것에 대해 생각할 때 abit이 손실됩니다. - (void) requestFinished : (ASIHTTPRequest *) request {method. 예를 들어
는 NSObject의이
//...
-(IBAction) method1
{
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
}
-(IBAction) method2
{
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
}
-(IBAction) method3
{
NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
}
//Then catch each method request with one
- (void)requestFinished:(ASIHTTPRequest *)request{ //etc
//and use one failed request
- (void)requestFailed:(ASIHTTPRequest *)request{ //etc
같은 것 또는 당신은 당신의 정보를 표시 할 뷰 내부의 requestFinished 방법을 배치해야합니까?
그래 맞지만 도전적으로 말이됩니다. 나는 uitableviews에 대한 제한된 경험을 가지고 있습니다. 언제 어디서나 데이터를 전달할 수있는 능력이 향상되고 있습니다. –