Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

Explain The Difference Between loadView() And viewDidLoad() in iOS

8/19/2018

0 Comments

 
It's a best trick to grasp some fundamentals of UIKit before rushing into ios development.

Basically, loadView and viewDidload are the methods of UIViewController's lifecycle.

​I am going the explain the difference.
loadView

The code of UIKit will call loadView event when it needs to present that controller's view hierarchy on screen.
​

This method is used to create a view hierarchy programmatically, without using a nib.
UIViewController will never call loadView  if you create View using nib.
Especially, if any code tries to get  your view property on view controller, and that property is nil, then UIViewController's will call the loadView method.

Note:
If you are using storyboard, you can't use loadView.


ViewDidLoad

In UIKit, viewDidLoad is called automatically  when loadView  completes all its tasks and the View is ready to display.That means all your IBOutlets are connected and you can make changes to labels, text fields, etc.

ViewDidLoad is used when you load your view from a XIB and want to perform any customization after launch.

Read:
How to Compare Dates in Objective C ?
20 Ultimate Ways To Promote Your Mobile Apps - Hunt My ideas
​
How to check if user declines Push Notification Prompt?

0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by