• 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: Releasing modal view controller properly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing modal view controller properly


  • Subject: Re: Releasing modal view controller properly
  • From: Andreas Falkenhahn <email@hidden>
  • Date: Sun, 18 Dec 2016 11:35:34 +0100

On 18.12.2016 at 01:19 David Duncan wrote:

>> When I disable the line "[vc release]", I don't get any crashes and it
>> works fine. Can anybody explain why? I was expecting that presentViewController()
>> retained the view controller so that it is safe for me to release it
>> right after making the call to presentViewController() because I don't
>> need it any longer but apparently, there's something wrong in my code
>> but I don't see it…

> The code you’ve presented is fine, so the issue is likely to be elsewhere.

Right, the problem was that I released the UIButton after adding it as a
subview but releasing the UIButton is of course forbidden because the button
was created using

    [UIButton buttonWithType:...]

and not using alloc/init. Problem solved, thanks.

--
Best regards,
 Andreas Falkenhahn                            mailto:email@hidden


_______________________________________________

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


References: 
 >Releasing modal view controller properly (From: Andreas Falkenhahn <email@hidden>)
 >Re: Releasing modal view controller properly (From: David Duncan <email@hidden>)

  • Prev by Date: device-pixel-exact bitmap rendering
  • Next by Date: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
  • Previous by thread: Re: Releasing modal view controller properly
  • Next by thread: device-pixel-exact bitmap rendering
  • Index(es):
    • Date
    • Thread