gpt4 book ai didi

iphone - 无法解析 SA_OAuthTwitterEngine/MGTwitterEngine 发送的 JSON

转载 作者:行者123 更新时间:2023-11-29 05:04:34 25 4
gpt4 key购买 nike

我正在开发一个 Twitter 应用程序,但在应该是记录的用户信息的 View 中,我无法解析 [_engine getUserInformationFor:username]; 提供的 JSON。我正在使用 SBJSON,并在尝试解析它时告诉我:

2011-05-07 12:29:45.553 BirdieApp[7122:40b] -JSONValue 失败。错误是:偏移量 0 处无法识别前导字符

这是我正在使用的代码:

NSLog(@"loggedapi");
NSString *username = [_engine username];
NSString *userinfo = [_engine getUserInformationFor:username];<br/>
NSLog(@"user: %@%@", username, userinfo);
NSArray *results = [userinfo JSONValue];
NSDictionary *first = [results objectAtIndex:0];
NSLog(@"screen name = %@", [first objectForKey:@"description"]);
[_engine getUserInformationFor:username]; 给我的输出是:


2011-05-07 12:29:46.281 BirdieApp[7122:40b] User Info Received: (
{
"contributors_enabled" = false;
"created_at" = "Fri Sep 17 20:40:15 +0000 2010";
"default_profile" = true;
"default_profile_image" = false;
description = "iPhone developer and Photoshop designer. \U30dd\U30fc\U30eb. I developed a web browser, it's called zad0xNET browser, search it in Cydia. Ofcourse this is a fake account!";
"favourites_count" = 0;
"follow_request_sent" = false;
"followers_count" = 4;
following = 0;
"friends_count" = 1;
"geo_enabled" = true;
id = 191964939;
"is_translator" = false;
lang = es;
"listed_count" = 0;
location = "Castilla y Le\U00f3n, Espa\U00f1a";
name = zad0xLOL;
notifications = false;
"profile_background_color" = C0DEED;
"profile_background_image_url" = "http://a3.twimg.com/a/1304019356/images/themes/theme1/bg.png";
"profile_background_tile" = false;
"profile_image_url" = "http://a0.twimg.com/profile_images/1190671091/ProfilePhoto_normal.png";
"profile_link_color" = 0084B4;
"profile_sidebar_border_color" = C0DEED;
"profile_sidebar_fill_color" = DDEEF6;
"profile_text_color" = 333333;
"profile_use_background_image" = true;
protected = 0;
"screen_name" = zad0xs1s;
"show_all_inline_media" = true;
"source_api_request_type" = 12;
status = {
contributors = "";
coordinates = "";
"created_at" = "Sat May 07 07:42:18 +0000 2011";
favorited = false;
geo = "";
id = 66769811828514816;
"in_reply_to_screen_name" = zad0xs1s;
"in_reply_to_status_id" = "";
"in_reply_to_user_id" = 191964939;
place = "";
"retweet_count" = 0;
retweeted = false;
source = "BirdieApp";
"source_api_request_type" = 12;
text = "@zad0xs1s sdjdjdd";
truncated = 0;
};
"statuses_count" = 16;
"time_zone" = Madrid;
url = "http://www.pabloxweb.es";
"utc_offset" = 3600;
verified = false;
}

我认为它是 JSON,但不确定。我也尝试过使用 Twitter 提供的网址,但也没有成功。网址是http://api.twitter.com/1/users/show.json?screen_name=zad0xsis ,其中“zad0xsis”是 Twitter 用户名。

提前致谢!! ;)

最佳答案

嗨。这是一个很好的链接OAuth Twitter

这个例子使用模型来获取 NSDictionary 中的 json 结果。他们调用了 getUsertimeLine 方法。您可以调用自己的方法。

关于iphone - 无法解析 SA_OAuthTwitterEngine/MGTwitterEngine 发送的 JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5920513/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com