Discussion in 'iOS Programming' started by blue-lion, Mar 31, 2012.

  1. blue-lion macrumors member

    Jan 26, 2010
    hello, i have a really simple 3 view app that is controlled by a tab bar. i would like to carry out a quick check on certain conditions with in the app before a specific view is displayed . Should i use ViewWillLoad method in this controller or will this only work on the first time the view is displayed ?, and not every subsequent time?. I need to check every time.
  2. chown33 macrumors 604

    Aug 9, 2009

    Did you try looking up viewWillLoad in the reference docs?
    What does it say about how often it's invoked?

    If that seems easy, it is. You should get in the habit of looking at the reference docs first.

    If you already did this and didn't find an answer, please describe exactly where you looked.
  3. blue-lion thread starter macrumors member

    Jan 26, 2010
    Wirelessly posted

    For your information I have tried searching your forum ,apple resources, asked friends and checked several books.I also resent the insinuation that myself and other enthusiasts's lack of knowledge should be treated like a 'sickness' ?? I know newbies ask what probably seem like stupid questions but I can assure you I was not looking for someone to do why work for me, just to be pointed in the right direction. I've used other forums for years and generally find people and forum administrators really helpful. Can't believe you actually use that link. Incredible.
  4. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Don't get so excited.

    If you checked several books you should be able to answer the question of whether or not viewWillLoad is called one time or every time that a view controller's view is shown. In fact, since it's so simple to do you would almost certainly have tried it to see what it really does. But if you had tried it then you would have mentioned that in your post, right?

    One more thing, how do you think we should respond to the fact that there is nothing called viewWillLoad in the OS system headers?
  5. chown33, Mar 31, 2012
    Last edited: Mar 31, 2012

    chown33 macrumors 604

    Aug 9, 2009
    I used it for one reason: Because you didn't tell us what you tried.

    If you'd tried something and it didn't work, you should say "I tried (description here), and it failed because of (results here)". At a minimum, this is useful so we don't rehash what you've already tried. Because Getting Answers often requires that you tell us what you did.

    If you post questions that look like you haven't done any research, why should anyone here assume you've done your research? Especially if you haven't said what you've tried?

    If you did your research and didn't find an answer, telling us what you read is at least as useful as telling us what you tried, even when you don't actually try anything.

    If you searched for something and didn't find any info, then you should tell us what you searched for. I have made suggestions in the past that improved how people do searches. We can't read your mind, or see your screen, so if you don't tell us what you searched for, we can't suggest how to improve it.

    FWIW, referring to this online reference doc (also in Xcode's docset):

    There is no viewWillLoad method.

    So a possible reason that searching for viewWillLoad failed to turn up any answers is because there isn't one. I'm assuming that you did actually search for viewWillLoad, and in doing so failed to find any answers, docs, or references. I'm reluctant to make this assumption, but since you didn't tell us what you tried, what you looked at, or what you searched for, it's the best I can do in this case.

Share This Page