Questions tagged [viewdidload]

Method in UIViewController class (Apple iOS SDK) for managing the view. Called after the controller’s view is loaded into memory.

This method is called after the view controller has loaded its associated views into memory. This method is called regardless of whether the views were stored in a nib file or created programmatically in the loadView method. This method is most commonly used to perform additional initialization steps on views that are loaded from nib files. Available in iOS 2.0 and later.

722 questions
2
votes
1 answer

does viewDidLoad get called after a popViewController call?

Does viewDidLoad get called when you're popping back to a UIView?
marty
  • 391
  • 1
  • 7
  • 15
2
votes
2 answers

Why my ViewDidLoad Loads every time?

I am Creating a App in which I implemented FB login. So i write a FBLogin button code in my ViewDidLoad in ViewController.m file. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a…
M Swapnil
  • 2,361
  • 3
  • 18
  • 33
2
votes
3 answers

with "viewDidLoad" my viewController take much time to appear!

when i load my viewController i used "viewDidLoad"method to init my view ,but this take much time to make the view appeared .So i had the idea to use "viewDidAppear" method to accelerate the appearance of my view but the load of the informations…
Mejdi Lassidi
  • 999
  • 10
  • 22
2
votes
1 answer

Why is viewDidLoad being called twice

I have a GPS app that uses Google Maps to handle location based events. The app handles all location events within the app and does not switch to Googles own Google Maps app. The storyboards can be seen in the image below. In the app I have a main…
heyred
  • 2,031
  • 8
  • 44
  • 89
2
votes
2 answers

How to wait for a UIViewController to be completely initialized?

I have a custom segue type (overriding init and perform methods of UIStoryboardSegue) and in init method I instantiate the destination view controller(VC). In prepareForSegue method of source VC I call a method of the destination VC that tries to…
AKH
  • 267
  • 1
  • 3
  • 13
2
votes
1 answer

UIApplicationDidBecomeActive vs UIApplicationWillEnterForeground difference

I need to fire a method when the application become active again. I've found this useful question about the topic, but unfortunately it's not enough for me, I can't decide which one should I use in my case.. I have this method in the viewDidAppear:,…
rihekopo
  • 3,241
  • 4
  • 34
  • 63
2
votes
3 answers

UITableView methods are called before ViewDidLoad

I'm trying to create a simple weather app which gets data from OpenweatherMap using JSON and print them out in a UITableView. However, when I executed this code below and set a breakpoint at numberOfRowsInSection method, it returns 0 row. Somehow…
Harry
  • 95
  • 2
  • 5
  • 14
2
votes
2 answers

Where to add the UISegmentedController; loadView, initWithNibName: bundle:, or viewDidLoad?

I'm just getting started with Objective-C programming and I'm a little bit confused about where to declare a UISegmentedController instance as a "subview" of my viewController root view. I've been experimenting with the code and it seems to work…
iCode101
  • 395
  • 2
  • 17
2
votes
1 answer

Changing the UISearchBar returnKeyType to Done works on an iPhone 5 but crashes the app on an iPhone 4s

I have a bizarre problem. I have a UITableView with a UISearchBar embedded at the top. I have changed the "returnKeyType" to say Done instead of Search using the following code in the viewDidLoad of my UITableViewController: [(UITextField…
amitsbajaj
  • 1,304
  • 1
  • 24
  • 59
2
votes
5 answers

loading image asynchronously in viewDidLoad, with activity indicator

When i'm switching from a view (by clicking on a cell in a table) to a view that displays some images, i'm loading a couple of images from a couple of urls. I want to display an activity indicator animation while the loading occurs. I'm doing this…
mrtubis
  • 170
  • 7
2
votes
1 answer

Iphone app development - How do I reload(?) views?

Okay, I'm working on a iPhone game. You start off on a menu screen, then select "New Game" or "High Scores". Let's select "New Game." The first time you do this, you get an alert telling you how to play the game. I implemented this with the -…
androidnotgenius
  • 417
  • 1
  • 7
  • 17
2
votes
1 answer

UITableView takes much longer to load when numberOfRows returns a large number

Why does UITableView take more time to load when the number of rows is large? What is it that takes time between viewDidLoad and the first cellForRowAtIndexPath function call? These are the log statements when numberOfRows returns 100,000 (notice…
Ashish Awaghad
  • 2,822
  • 3
  • 24
  • 33
2
votes
1 answer

How to keep an NSArray available to all methods when programming for the iPhone

I am making an iPhone app that uses a few NSArrays. Right now I have to generate the arrays in each method. I know there has to be an more efficient way of doing this, like having the NSArrays created during initialization and then being available…
MarcZero
  • 339
  • 8
  • 20
2
votes
2 answers

Iphone load XIB/m/h Problem

why does this not work: - (void)viewDidLoad { Login *neu =[[Login alloc] initWithNibName:nil bundle:nil]; [self presentModalViewController:neu animated:NO]; } but this works -(IBAction)dologin:(id)sender{ Login *neu =[[Login alloc]…
Ploetzeneder
  • 1,281
  • 4
  • 20
  • 34
2
votes
2 answers

How can I call an IBAction in the viewDidLoad?

I have a simple slider app. When the slider is changed, the new value is displayed in a UILabel. That works great! When that view is loaded though the label is blank. I want the sliderValue.text to be equal to the default slider value. Here is my…
Peter Stuart
  • 2,362
  • 7
  • 42
  • 73