• 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: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?


  • Subject: Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
  • From: Andreas Falkenhahn <email@hidden>
  • Date: Sun, 18 Dec 2016 18:18:40 +0100

On 18.12.2016 at 17:01 Alex Zavatone wrote:

> Allocate them in viewWillAppear: if they are nil.
> Just create a conditionalInit method for the purpose of this and put it inside viewWillAppear.

Reading the documentation again, it now seems to me that views should
be created in loadView() instead. The documentation of loadView() says
that "You can override this method in order to create your views manually."

I've seen lots of code that allocates subviews in viewDidLoad(), though.
But I guess that's wrong then?

Your suggestion of using viewWillAppear() doesn't make things clearer, alas,
because this even adds a third candidate for view allocation... so is there a
definite answer as to where to allocate my subviews like UIButton, UILabel,
etc. for my UIViewController?

--
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


  • Follow-Ups:
    • Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
      • From: Quincey Morris <email@hidden>
References: 
 >Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+? (From: Andreas Falkenhahn <email@hidden>)
 >Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+? (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
  • Next by Date: Re: Checkbox Mayhem
  • Previous by thread: Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
  • Next by thread: Re: Is it safe to assume that viewDidLoad() is only ever called once on iOS 8.0+?
  • Index(es):
    • Date
    • Thread