iphone - How is this object being prematurely released? -


I have received crash reports from Apple and I'm trying to determine what happened. I have not been able to rebuild the accident by following my steps and I have not seen any accident in my test. Here is an important part of the crash report:

  9 libobjc.A.dylib 0x00004838 objc_exception_throw + 64 10 Core Forwarding 0x000a167c - [NSObject] does not select identifier:] + 96 11 Core forwarding 0x000491d2 ___ Forwarding ___ + 502 12 Core Forwarding 0x00048f88 _CF_forwarding_prep_0 + 40 13 TheApp 0x0001cd28 - [Tumblelog initWithDictionary:] (Tumblelog.m: 40) 14 TheApp 0x0001ef8c - [TumblrEngine userFromRequest:] (TumblrEngine.m: 589)  

It seems to me that my dictionary is being released ahead of time. This code path is often called during most runs in the app and it has not crashed for me yet, so I believe that I'm not sending the wrong object by mistake to initWithDictionary .

Here is the code from TumblrEngine and Tumblelog .

  // TumblrEngine.m - (TumblrUser *) userFromRequest: (ASIHTPPRQUEQUEST *) Request {NSDTA * Data = [Request Feedback Data]; NSError * parseError = Zero; NSXML Document * Doc = [[[NSXML DOCUMENT ALOOC] Insight Data: Data Options: NSXML DTD XML Error: & amp; Parserre] Autoreques]; NSDictionary * Dictionary = [DOS toDictionary]; NSDictionary * userDict = [Dictionary Value forKeyPath: kParseKeyPathUserInfo]; TumblrUser * user = [[Tumbler User] initWithDictionary: userDict]; NSArray * tumblelogs = [Dictionary ForKeyPath: kParseKeyPathTumblelogsInfo]; NSMutableArray * userTumblelogs = [NSMutableArray array]; (Nudson * Tumblelogin in Blogs) {Tumblelog * tumblelog = [[Tumblelog alloc] initWithDictionary: tumblelogDictionary]; // line 589 [UserTable logs addObject: tumblelog]; [Tumblelog release]; } [User Settumblogs: User Tanblogs]; Return [User Autores]; } // Tumblelog.m - (id) initWithDictionary: (NSDictionary *) aDictionary {if ((self = [super init])) {[Self set avatar: [aDictionary restURLForKey: kParseKeyTumblelogAvatarURL]]; // line 40 // was the line that started the accident) return self; }  

My main question is do you see that at any point for aDictionary when it was created and when I tried to use it I, Tumblelog.m ?

Otherwise, if I have a problem loading the class on nsDictionary , then I am searching. It works fine when I directly load the app on my three test phones (iPhone 4 / iOS 4.1, iPhone 3GS / iOS 4.0.1, iPhone 3G / 3.1.3). The phone on which the app crashed was iPhone 4 / iOS 4.1, which was similar to my main test phone.

I could think that the only thing is that there was something in the binary that I sent was Apple Corrupted . I suspect that this answer is because those binary is examined, but I am running out of ideas here. If I'm going to crash again on the tester's phone then I just do not want to deposit again.

This can be a threading issue (where the objects are being released on another thread), but It seems unlikely that the code with the above code is actually expected.

It is more likely (@Imagiriinabai) to say that you do not really have a dictionary.

A more secure loop will look like this: (

Note: I have not really tried to compile it. There may be a typo or syntax error or two.


Comments