On Thu, Jun 10, 2010 at 1:58 PM, Frederick C.Lee
<frederick_...@apple.com> wrote:
> Greetings:
>    I have a situation where I need to access a member of a mutable array (max 
> 4 members).
> Sometimes I could get an out-of-bounds exception, if for example, I try to 
> access member #3 out of a 2-member array.
> It's not serious, I could just ignore it and continue.

No, you cannot. It is illegal and must not be done.

Just check the count of the array before accessing it. But the fact
that you have this possibility at all is indicative of poor design.

--Kyle Sluder
_______________________________________________

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