On Thursday, June 11, 2009, at 03:01PM, "Bill Monk" <billm...@mac.com> wrote:
>Cmd-Shift-F, type "objectAtIndex", make sure the search options popup  
>is set to "In Project," hit Return. In the resulting list, look at  
>each found occurrence of "objectAtIndex". Option-click on  
>"objectAtIndex" to bring up its docs. Re-read them. Re-read your code.  
>See see where you might be using objectAtIndex incorrectly.
>
>If you don't see the problem with your usage of objectAtIndex, post  
>the code here so others can see it.
>
>
>You've said your app is "pretty simple." Any occurrences of  
>objectAtIndex: were likely put there by you.

Well, possibly but not necessarily.  There are all sorts of places where Cocoa 
calls objectAtIndex: internally, and Martin may have directly or indirectly 
caused the array in question to have fewer elements than expected.  It may not 
even be an array he explicitly created.  Furthermore, I would submit that 
eyeballing the code, while a good exercise for other reasons, is less efficient 
than deterministically finding *which* array is being accessed by which line of 
code.  Guesswork (either by Martin or by us) is not required.

Multiple ways to do this have been suggested -- print NSLog messages; install 
Xcode and use the debugger; turn on NSZombieEnabled (which may not lead to the 
line of code that's crashing, but even better might lead to the line of code 
that *causes* the crash).  I don't see any point in offering further advice 
when none of the advice already given (including "post the code") has been 
tried AFAWK.

--Andy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to