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
0
votes
1 answer

NSMutableArray keeps multiplying/resetting

So I am making a simple app in Objective-C with a single tableview that will display airports and their associated airport codes, as well as allow the user to add new airports. I have created a class of known airports and their codes in an NSArray…
0
votes
0 answers

viewDidLoad is called twice when transitioning from UITableViewController

When I have a push segue from a UITableViewController to a regular view controller, the viewDidLoad method gets called twice. This makes the content on the second view controller to also appear twice. I thought that viewDidLoad was supposed to only…
PoKoBros
  • 701
  • 3
  • 9
  • 25
0
votes
3 answers

Link to another ViewController inside viewDidLoad method

in the viewDidLoad method i have this code. When the application is running its not go to the another viewController, its gives me an error: Warning: Attempt to present on
Nir Gofman
  • 45
  • 1
  • 7
0
votes
1 answer

Custom Init in viewDidLoad for iBeacons

I am working with the ESTimote SDK for iBeacons and they have you call a custom init method in their samples. However I am working with a storyboard and the story board doesn't call my custom init method. So customer support suggested I move the…
0
votes
1 answer

viewDidLoad happens on every return to first view controller?

I'm working with three view contollers, the first called "menuVC" embedded in a navigation controller, and then "viewVC" and "resultsVC". I'm using push segues from VC to VC. Now, my problem is, that every time I return to the first "menuVC" from…
0
votes
1 answer

Warning: Attempt to present *** whose view is not in the window hierarchy

I'm receiving this error when I am using an attached long press gesture to get a modal view to come up using the following code: // Long press to go to settings for one - (void)longPressOne:(UILongPressGestureRecognizer*)gesture { [self…
Prateek
  • 1,724
  • 3
  • 15
  • 27
0
votes
1 answer

Why doesn't NSOperationQueue execute a block submitted with addOperationWithBlock?

Here is the thing, I got some code, that does not execute (the compiler run the code but does not do anything)... Here is the code... Using NSURLSessionDelegate and [NSOperationQueue mainQueue] addOperationWithBlock @interface tablaPosViewController…
0
votes
1 answer

Why would delaying a thread response fix view corruption?

6 times out of 10 my very simple iPhone app is getting a corrupted display on launch or crashes randomly. But it behaves fine in the simulator. The display corruption looks like mis-colored fonts, out of place font text, wrong background colors,…
Beth S
  • 3
  • 2
0
votes
1 answer

Calling viewDidLoad

In Swift, I am writing a simple first app. As it is not complex at all, nearly all code that is used happens in the viewDidLoad method. However, the app deals with live data (the bitcoin price, to be exact). I would like the app to re-fetch the…
rocket101
  • 7,369
  • 11
  • 45
  • 64
0
votes
2 answers

viewDidLoad not being called by parent UITabBarController

Sample: I've created a minimal set of files that highlight the issue here: http://uploads.omega.org.uk/Foo3.zip If viewDidLoad/viewInitWithNibName are called, a message box is displayed. The message box is not displayed, therefore, the methods are…
0
votes
2 answers

Why the controller's class method aren't get called when the app become active from background?

when I share something with my app, it get called by -(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{to get the content shared with it. After that, i…
Alessio Crestani
  • 1,602
  • 4
  • 17
  • 38
0
votes
2 answers

iPhone SDK - (void)viewDidLoad { } - Show Progress

I have a long - (void)viewDidLoad { } function that uses the internet to load a page, and whenever the application loads the URL, the screen is black. I have a UIActivityIndicator setup to show that the address is loading, but I don't know how to…
Hank Brekke
  • 2,024
  • 2
  • 24
  • 33
0
votes
3 answers

iPhone: UIAlert dialog Appears 3 Times for Every Call

I have a UIAlert that pops up 3 times every time it is called. It appears and then disappears before I can click on it. Could it be that the viewDidLoad itself is being called 3 times? I implemented an UIAlert in the viewDidLoad of my…
Marco
  • 461
  • 1
  • 10
  • 22
0
votes
1 answer

Where To Call Custom Method? viewDidLoad, viewWillLoad

I am loading some info from a server. I have created a separate method to do this. I am then calling [self myCustomMethod] to run the method. No matter where I call [self myCustomMethod] (initWithNibName, viewDidLoad, viewWillLoad, viewWillAppear,…
Chris
  • 1
  • 1
0
votes
1 answer

No viewDidLoad method in PSListController

I have checked recent header files for PSListController , PSViewController and PSBaseView, but there is no method for acknowledgement of view creation, like iOS has viewDidLoad - Although there are many methods available for view Display. One I…
NightFury
  • 13,436
  • 6
  • 71
  • 120