On 21 Sep 2013, at 18:38, "Mills, Steve" <smi...@makemusic.com> wrote:

>> On Sep 21, 2013, at 12:24, "Gerriet M. Denkmann" <gerr...@mdenkmann.de> 
>> wrote:
>> 
>> 1. tupelsP lives outside the block
> 
> Because once the block containing the array exits scope, so does the memory 
> of the array. tuplesP is pointing to memory that is no longer valid.
> 

I've seen so many hard to find bugs like this. I rarely declare locals inline, 
I declare them in one place at the top of the block. A similar gotcha is when 
you declare a local with the same name as an instance variable.

Cheers
Dave



_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to