个人信息获得
@interface UserInfoViewController : UIViewController<SinaWeiboRequestDelegate>//实现请求代理 BOOL authValid = self.sina.isAuthValid;//判断是否授权了 if (authValid){ [self.sina requestWithURL:@"users/show.json" params:[NSMutableDictionarydictionaryWithObject:self.sina.userID forKey:@"uid"] httpMethod:@"GET" delegate:self]; } //请求失败回调方法 - (void)request:(SinaWeiboRequest *)request didFailWithError:(NSError *)error{ if ([request.url hasSuffix:@"users/show.json"]){ [self.userInfoDic release], self.userInfoDic = nil; } } //请求成功回调方法 - (void)request:(SinaWeiboRequest *)request didFinishLoadingWithResult:(id)result{ if ([request.url hasSuffix:@"users/show.json"]){ [self.userInfoDic release]; self.userInfoDic = [result retain]; //NSLog(@"用户信息字典:%@", self.userInfoDic); 字典数据 返回字段下面 } }
返回字段说明
以上就是iOS新浪微博分享功能的全部内容,希望对大家的学习有所帮助,也希望大家多多支持五二脚本。