//阻塞
創(chuàng)新互聯(lián)建站是一家專注于網(wǎng)站建設(shè)、網(wǎng)站制作與策劃設(shè)計(jì),盧氏網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)建站做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:盧氏等地區(qū)。盧氏做網(wǎng)站價(jià)格咨詢:13518219792
- (User *)findUser:(NSNumber *)userID
{
NSString *url = [NSString stringWithFormat:@"%@/s/account/find-user/",ServerBaseURL];
NSMutableDictionary *requestParms = [[NSMutableDictionary alloc] init];
[requestParms setObject:userID forKey:@"userId"];
AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];
NSMutableURLRequest *request = [requestSerializer requestWithMethod:@"POST" URLString:url parameters:requestParms error:nil];
AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
AFHTTPResponseSerializer *responseSerializer = [AFJSONResponseSerializer serializer];
[requestOperation setResponseSerializer:responseSerializer];
[requestOperation start];
[requestOperation waitUntilFinished];
NSDictionary *userInfo = [[requestOperation responseObject] objectForKey:@"user"];
if (userInfo != nil) {
這里對(duì)結(jié)果處理
return xxxx
}
return nil;
}
//異步
NSString *url = [NSString stringWithFormat:@"%@/s/account/signin/", ServerBaseURL];
NSMutableDictionary *requestParms = [[NSMutableDictionary alloc] init];
//設(shè)置參數(shù)
[requestParms setObject:loginName forKey:@"loginname"];
[httpManager POST:url parameters:requestParms
success:^(AFHTTPRequestOperation *operation, id responseObject) {
//成功
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//失敗
}];
本文題目:iOSAFNetWorking下同步異步請(qǐng)求
本文來源:http://m.rwnh.cn/article46/jcgihg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供、服務(wù)器托管、建站公司、關(guān)鍵詞優(yōu)化、網(wǎng)站建設(shè)、做網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)