이 지난 10 시간 동안 충돌을 디버깅하기 위해 노력하고 그리고 마지막으로, 나는이 코드를 단순화 : NSZombieEnabled와NSJSONSerialization 버그?
NSError *error = nil;
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"payload" ofType:@"txt"]];
id obj = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
,이 (파싱이 발생) 세 번째 줄에서 응용 프로그램을 충돌하고 그것을 기록 : payload.txt
의
*** -[CFString retain]: message sent to deallocated instance 0x758afa0
내용은 다음과 같습니다
[
{
"created_at":"2013-02-15T23:46:02-05:00",
"description":"Take out the Big Gun sounded simple enough, except the Strogg were waiting. You, and a few marines like you, are the lucky ones. You've made it down in one piece and are still able to contact the fleet. The Gravity Well, the Strogg's newest weapon in its arsenal against mankind, is operational. With the fleet around Stroggos, 5% of ground forces surviving, and that number dwindling by the second, your orders have changed: free your comrades. Destroy the Gravity Well.Minimum: A 100% Windows XP/Vista-compatible computer system",
"developer":"id Software",
"external_id":"2340",
"id":745,
"image":"http://cdn.steampowered.com/v/gfx/apps/2340/header_292x136.jpg",
"is_subscribed":0,
"link":"http://store.steampowered.com/app/2340/",
"price":"4.99",
"seller_id":2,
"thumb":"http://media.steampowered.com/steamcommunity/public/images/apps/2340/5bd6e22ffdf72fdfb5ce2092fa50150de5fbb56f.jpg",
"title":"Quake II: Ground Zero",
"updated_at":"2013-02-15T23:46:02-05:00",
"is_subscribed":0
},
{
"created_at":"2013-02-15T23:45:59-05:00",
"description":"Rage through 32 single player levels and 6 deathmatch levels of sheer terror and fully immersive sound and lighting. Arm yourself against the cannibalistic Ogre, fiendish Vore and indestructible Schambler using lethal nails, fierce Thunderbolts and abominable Rocket and Grenade Launchers.Minimum: A 100% Windows XP/Vista-compatible computer system",
"developer":"id Software",
"external_id":"2310",
"id":742,
"image":"http://cdn.steampowered.com/v/gfx/apps/2310/header_292x136.jpg",
"is_subscribed":0,
"link":"http://store.steampowered.com/app/2310/",
"price":"9.99",
"seller_id":2,
"thumb":"http://media.steampowered.com/steamcommunity/public/images/apps/2310/e5bdf8dc7759c573fe525d45b69011f6a173a984.jpg",
"title":"Quake",
"updated_at":"2013-02-15T23:45:59-05:00",
"is_subscribed":0
}
]
그것은이 개 사전의 배열 그냥. 이 충돌을 일으키는 원인이 무엇인지 /이 JSON의 문제점은 확실하지 않습니다.
업데이트 배열의 첫 번째 개체에서 "is_subscribed":0
을 제거하면 충돌이 제거됩니다.
보다 SBJSON 라이브러리를 사용하려고하면 쉽습니다. – Dilip
@Dilip SBJSON을 사용하고 싶지 않습니다. 왜 NSJSONSerialization이 충돌하고 JSON에 문제가 있는지 알고 싶습니다. – 0xSina
@Dilip 나쁜 조언을하지 마십시오. –