-
代码
12345678- (
void
)getUserInfo {
NSMutableDictionary
*params = [
NSMutableDictionary
dictionaryWithCapacity:2];
[params setObject:
self
.wbtoken forKey:@
"access_token"
];
[params setObject:
self
.uid forKey:@
"uid"
];
NSLog
(@
"params:%@"
, params);
WBHttpRequest * asiRequest = [WBHttpRequest requestWithURL:@
"https://api.weibo.com/2/users/show.json"
httpMethod:@
"GET"
params:params delegate:
self
withTag:@
"getUserInfo"
];
}
响应函数
1234567891011121314151617181920212223242526272829- (
void
)request:(WBHttpRequest *)request didFinishLoadingWithResult:(
NSString
*)result
{
NSError
*error;
NSData
*data = [result dataUsingEncoding:
NSUTF8StringEncoding
];
NSDictionary
*json = [
NSJSONSerialization
JSONObjectWithData:data options:kNilOptions error:&error];
if
(json ==
nil
)
{
NSLog
(@
"json parse failed \r\n"
);
return
;
}
self
.screenname = [json objectForKey:@
"screen_name"
];
self
.picture = [json objectForKey:@
"profile_image_url"
];
NSLog
(
self
.screenname);
NSLog
(
self
.picture);
m_observer->NotifyAvatarsReceived(avatarData);
NSString
*title =
nil
;
UIAlertView *alert =
nil
;
title = @
"收到网络回调"
;
alert = [[UIAlertView alloc] initWithTitle:title
message:[
NSString
stringWithFormat:@
"%@"
,result]
delegate:
nil
cancelButtonTitle:@
"确定"
otherButtonTitles:
nil
];
[alert show];
[alert release];
}
相关文章
- 07-03iOS之 接入新浪微博 SDK(微信支付) 的坑(registerApp 的问题)
- 07-03新浪微博iOS SDK UIImage+WBSDKResize.o
- 07-03Jquery 类似新浪微博,鼠标移到头像,用浮动窗口显示用户信息,已做成一个jquery插件
- 07-03IOS第四天-新浪微博 -存储优化OAuth授权账号信息,下拉刷新,字典转模型
- 07-03《转》iOS 平台 Cocos2d-x 项目接入新浪微博 SDK 的坑
- 07-03[iOS微博项目 - 2.1] - 获得新浪授权接口
- 07-03[iOS微博项目 - 3.4] - 获取用户信息
- 07-03[python爬虫] Selenium爬取新浪微博内容及用户信息
- 07-03专访新浪微博黄波:千人千面,机器学习赋能用户信息流消费
- 07-03Python爬取新浪微博用户信息及微博内容