Re: Strange behaviour of iPhone
Re: Strange behaviour of iPhone
- Subject: Re: Strange behaviour of iPhone
- From: Dave <email@hidden>
- Date: Sat, 21 Sep 2013 19:20:51 +0100
On 21 Sep 2013, at 18:38, "Mills, Steve" <email@hidden> wrote:
>> On Sep 21, 2013, at 12:24, "Gerriet M. Denkmann" <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden