• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange behaviour of iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Strange behaviour of iPhone
      • From: "Mills, Steve" <email@hidden>
References: 
 >Strange behaviour of iPhone (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Strange behaviour of iPhone (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Strange behaviour of iPhone (From: "Mills, Steve" <email@hidden>)

  • Prev by Date: Re: Strange behaviour of iPhone
  • Next by Date: Re: Scroll a collection
  • Previous by thread: Re: Strange behaviour of iPhone
  • Next by thread: Re: Strange behaviour of iPhone
  • Index(es):
    • Date
    • Thread