> PS. Yes, I know there are faster and more efficient ways to enumerate an > array, but the old-school 'for' loop approach still comes to mind first and > I still prefer it for small arrays.
Overlooking the speed benefits, fast enumeration will also throw an exception if the array you're enumerating is modified while doing so, which surely improves anyone's code. > Exception Type: EXC_BAD_ACCESS (SIGBUS) This is not a friendly, catchable Objective-C exception - it's a Unix signal sent to your process due to a memory access problem (see http://en.wikipedia.org/wiki/Bus_error.) Rarely should you attempt to recover from a signal - it's usually a symptom of a bug in your code, and in your case, it certainly is. After a cursory reading of your code it looks like you're dealing with a threading issue involving myItemList or imminentList. Your comment mentions "We don't really care if imminentList changes because the dictionary object will always be there even if the contents aren't." Does this mean you're modifying imminentList from one thread while another is attempting to read from it? If so, you need a lock around the reads and writes. I think you'd benefit from reading this, if you haven't already (particularly the bit under the "Mutable Versus Immutable" header): http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html. _______________________________________________ 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