Проблема разбора после JSON с JSON Framework - PullRequest
0 голосов
/ 17 октября 2010

У меня есть следующий JSON:

 {
    "response": {
        "status": 200
    },
    "user": {
        "flex_meta": {
            "layout": "[{\"windows\":[{\"type\":\"stream\",\"width\":260,\"x\":268,\"height\":763,\"y\":0,\"relatedDataObject\":{\"name\":\"watch\",\"id\":3190},\"arg\":\"watchlist:3190\"},{\"type\":\"rss\",\"width\":260,\"x\":536,\"height\":763,\"y\":0,\"relatedDataObject\":{\"class\":\"sss2.StockTwits.views.widgets.rss::rss_itemrenderer_ARN_stream\",\"title\":\"Abnormal Returns Now\",\"url\":\"http://www.abnormalreturns.com/link/index.rss\"},\"arg\":\"http://www.abnormalreturns.com/link/index.rss\"},{\"y\":0,\"height\":763,\"type\":\"stream\",\"width\":260,\"x\":0,\"arg\":\"recommended\"}],\"active\":true,\"name\":\"HUD\"}]",
            "created_at": "2009-09-01T13:39:15Z",
            "updated_at": "2010-10-03T19:52:10Z",
            "snap_to_grid": true,
            "confirm_unsubscribes": false,
            "confirm_close_panels": false,
            "last_version_used": "v1.2.3",
            "confirm_close_editable_panels": false,
            "send_alerts_to_status_bar": false,
            "play_sound_on_new_message": false,
            "id": 512,
            "confirm_close_noneditable_panels": false,
            "user_id": 512,
            "play_sound_on_message_update_summary": true,
            "open_links_in_std": true,
            "stream_text_size": 12,
            "display_message_update_summary": false,
            "confirm_deletes": true
        },
        "avatar_url_medium": "http://avatars.stocktwits.com/production/512/medium-1251812630.png?1251812630",
        "avatar_url_thumb": "http://avatars.stocktwits.com/production/512/thumb-1251812630.png?1251812630",
        "single_access_token": "oFGOF0lMT9dLrXn6avxP",
        "created_at": "2009-09-01T13:39:15Z",
        "notify_followers": false,
        "push_node": "push1.desktop.stocktwits.com",
        "profile": {
            "facebook_id": "Sheehan Alam",
            "location": "arizona",
            "created_at": "2009-09-01T13:39:15Z",
            "approach": "Technical",
            "title": "",
            "updated_at": "2010-05-27T17:36:05Z",
            "risk_profile": "Growth",
            "focus": "chicks, cash, crystal",
            "long_short": "Long",
            "id": 512,
            "user_id": 512,
            "qualifications": "",
            "website": "http://www.syalam.com",
            "twitter_id": "syalam",
            "investment_style": "always make money",
            "capitalization_bias": "Small-Cap",
            "bio": "mobile application developer at stocktwits",
            "asset_classes_traded": "Equities",
            "holding_period": "Long Term Investor",
            "trading_experience": "Novice",
            "personal_interests": "investing, heavy metal, starbucks, apple",
            "industry": "Banking",
            "education": "BS Computer Science"
        },
        "cc_to_twitter": true,
        "last_api_login_at": "2010-10-16T03:29:54Z",
        "perishable_token": "xQTMomBOyD0eGzS1oEQd",
        "updated_at": "2010-10-16T03:29:54Z",
        "following_count": 34,
        "api_key": "77a89c2ad25d1eaa118050143e8307852d39433c",
        "notify_direct_messages": false,
        "id": 512,
        "oauth_secret": "N8BOCHyPvkPPF7QySWsxAsUpg88RPXyXhJFfdhqRGw",
        "updates_count": 663,
        "suspended": false,
        "notify_group_members": true,
        "twitter_id": 14643241,
        "persistence_token": "3d5dd4337b07fa76c08f6e1c64638e97920c86d9db28f652e67555602a255ba686de76eed7929dccf8260ad5d655435db34a32ef9d094f5258ac7d8cf126a886",
        "recommended": false,
        "followers_count": 26,
        "last_name": "Alam",
        "private_relations": false,
        "investor_relations": false,
        "avatar_url_large": "http://avatars.stocktwits.com/production/512/large-1251812630.png?1251812630",
        "oauth_token": "14643241-xdG9ZRpylFsOV1s0U62x5Dx2oDh2ptyxXT1pDWqgQ",
        "bio": "mobile application developer at stocktwits",
        "login": "syalam",
        "partner": false,
        "email": "syalam@gmail.com",
        "first_name": "Sheehan"
    }
}

Но получите ошибку:

-JSONValue failed. Error trace is: (
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=5 \"Unescaped control character '0x0'\" UserInfo=0x82b9bc0 {NSLocalizedDescription=Unescaped control character '0x0'}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: education\" UserInfo=0x82b9d20 {NSUnderlyingError=0x82b9c00 \"Unescaped control character '0x0'\", NSLocalizedDescription=Object value expected for key: education}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: profile\" UserInfo=0x82b9de0 {NSUnderlyingError=0x82b9d00 \"Object value expected for key: education\", NSLocalizedDescription=Object value expected for key: profile}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: user\" UserInfo=0x82b9e90 {NSUnderlyingError=0x82b9d60 \"Object value expected for key: profile\", NSLocalizedDescription=Object value expected for key: user}"

Я не уверен, как поставить диагноз?

1 Ответ

0 голосов
/ 17 октября 2010

я загружал этот код в didReceiveData () вместо connectionDidFinish (), поэтому я получал частичные результаты.

...