비록 내가이 일에 매우 익숙해도 내가하고있는 일을 너와 함께 나누도록하겠다.
먼저 엔진을 만듭니다 (여기서 내가 호출하는 서비스가 있습니다). 내가 서비스 전화 할게 기능에서 다음
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
engine_= [[MKNetworkEngine alloc] initWithHostName:@"www.xxx.gr"];
// Custom initialization
}
return self;
}
: 내 초기화에서
@interface INGMainViewController(){
MKNetworkEngine *engine_;
}
:
내 인터페이스에서
NSDictionary *formParams = [NSDictionary dictionaryWithObjectsAndKeys:
theClientCode, @"ClientCode",
theContractNumber, @"ContractCode",
theAppleID, @"AppleID",
@" ", @"AndroidID",
@" ", @"WindowsID",
uid, @"AppleDeviceID",
@" ", @"AndroidDeviceID",
@" ", @"WindowsDeviceID",
theCellPhone, @"TelephoneNumber"
, nil];
MKNetworkOperation *operation = [self.engine operationWithPath:@"/services/Authentication.ashx"
params: formParams
httpMethod:@"POST"];
[operation addCompletionHandler:
^(MKNetworkOperation *operation)
{
NSLog(@" Operation succeds: %@", [operation responseString]);
}
errorHandler:^(MKNetworkOperation *errorOperation, NSError *error)
{
NSLog(@" Errors occured: %@", error);
}];
[self.engine enqueueOperation:operation];
}
을 ... 그리고 그 모두입니다.
물론 나는 여전히 몇 가지 문제점에 직면 해 있습니다. 그러나 나는 키트에서 오지 않는다고 생각합니다.
나는 당신을 도왔기를 바랍니다.