0
다음 코드는 개인 목록을 반환하지 않습니다 :iOS5로 트위터에서 비공개 목록을 얻는 방법?
NSURL* url=[NSURL URLWithString:@"http://api.twitter.com/1/noppefoxwolf/lists.json"];
NSDictionary* params=[NSDictionary dictionaryWithObjectsAndKeys:nil];
TWRequest* timeline=[[TWRequest alloc] initWithURL:url parameters:params requestMethod:TWRequestMethodGET];
timeline.account=_account;
[timeline performRequestWithHandler:^(NSData* responseData,
NSHTTPURLResponse* urlResponse,NSError* error) {
NSError* jsonError=nil;
id data=[NSJSONSerialization JSONObjectWithData:responseData
options:0 error:&jsonError];
if (error!=nil) {
[self showAlert:@"" text:@"Error1"];
} else if (jsonError!=nil) {
[self showAlert:@"" text:@"Error2"];
} else {
NSArray * listsArray = [data objectForKey:@"lists"];
for (int i=0;i<listsArray.count;i++) {
NSDictionary* listDic=[listsArray objectAtIndex:i];
NSLog(@"NAME:%@\nMODE:%@",[listDic objectForKey:@"name"],[listDic objectForKey:@"mode"]);
}
}
}];
결과
NAME:list1
MODE:public
NAME:list2
MODE:public
개인 목록을 표시하지 ↑. documentation 가입일