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

InitWithNibName and viewDidLoad?

Possible Duplicate: initWithNibName VS viewDidLoad I'm new at iOS development. I would just like to know the main differences between these 2 functions ? Thanks for your help
Rob
  • 15,732
  • 22
  • 69
  • 107
2
votes
2 answers

Symbols not found for architecture i386?

basically I've added the EGOTableViewPullRefresh files into my project. The code that I've written should work. However, 2 errors come up when that is triggered by the code in the viewDidLoad. The Error looks like this: What seems to be the problem…
K.Honda
  • 3,106
  • 5
  • 26
  • 37
1
vote
4 answers

Checking for empty NSString on ViewDidLoad?

My app checks if an NSString is empty when it launches, like this: if ([checkfieldstring1 isEqualToString:@""]) { checkboxButton.hidden = YES; } else { checkboxbutton.hidden = NO; } However, when there is an empty string, the button is…
1
vote
3 answers

Difference between viewDidLoad and loadView?

Two objective-c methods, -(void) viewDidLoad and -(void)loadView are methods called upon execution of a program but whats the different between them?
Airon Zagarella
  • 707
  • 2
  • 11
  • 17
1
vote
2 answers

Xcode - viewDidLoad method not working

I am new to Objective-c and Xcode, yet I believe I know enough about it to realize that something is going wrong here. I have an application using a storyboard, and one of the views in the application is not running its viewDidLoad method. I am not…
Brennan
  • 11
  • 1
  • 2
1
vote
2 answers

Where should a navigation-based iOS app track pageviews - viewDidLoad or viewWillAppear?

I have a navigation based application. All of the Google Analytics examples I see have page view tracking in viewDidLoad. I'm wondering if this makes the most sense. If I want to learn about the true behavior of my users, shouldn't it be in…
Eitan
  • 1,308
  • 3
  • 15
  • 32
1
vote
1 answer

Get iPad Landscape Orientation in iOS5 at startup

I've got an iPad App with a TabBarController. Since iOS5 I'm note able anymore to get the correct orientation in the viedDidLoad or viewWillAppear when I start the app on the iPad in landscape. It always returns Portrait. When I ask for the…
wolfrevo
  • 2,006
  • 2
  • 25
  • 32
1
vote
1 answer

Placing code before/after calling super in viewDidLoad and viewWillAppear

Due to the keywords "did" and "will" in UIViewController, I have am unsure where to put the code before/after calling super in viewDidLoad and viewWillAppear, in order to make the code run effectively. For example: - (void)viewDidLoad { [super…
Tommy
  • 7,400
  • 4
  • 30
  • 26
1
vote
2 answers

iOS: Running database query in viewDidLoad only works once

So let's see if I can write a clear enough description of my problem... I'm developing an application for a museum, where the user can find artworks either through an id or by scanning a qr tag... Once either an id is entered or a tag scanned, the…
user969043
  • 756
  • 2
  • 13
  • 34
1
vote
1 answer

Change map pitch as zoom level changes in Mapbox

I'm trying to change the pitch to be more and more angled as the user zooms in, but I have a suspicion it's because the .cameraChanged event is firing fast all the time, so the app crashes on the initial map load. Any suggestions on figuring out how…
nickcoding2
  • 142
  • 1
  • 8
  • 34
1
vote
3 answers

Trouble with properties in Objective-c

I'm having trouble assigning an instance of a class to the following UITableViewController subclass: @interface MyTableViewController : UITableViewController @property (nonatomic, retain) MyClass *myClass; @end I'm currently…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
1
vote
0 answers

The correct place to set the UINavigationController's back button title

I'm a bit confused with setting the title of navigation item's back button. Usual this is done in the viewDidLoad but in my case the view controller is created without the view being loaded. On startup, I'm restoring the view controller hierarchy…
mkko
  • 4,262
  • 3
  • 25
  • 29
1
vote
2 answers

When does bounds get updated?

I am loading a view as soon as the user rotates to landscape but when I use view.bounds in viewDidLoad it is still in portrait. Here the code where I load the view which is triggered from a notification - (void)orientationChanged:(NSNotification…
Chris
  • 3,581
  • 8
  • 30
  • 51
1
vote
1 answer

iOS: UIViewController is Not Being Pushed Problem

I'm working on a new app where there is a "main" UIViewController with some UIButtons and once the user clicks on the buttons, the application is navigating to another UIViewController. For some reason, the UIViewControllers are not opened, when you…
1
vote
1 answer

Prevent UIWebView allocating to much memory

I have a problem with UIWebView. I am using this component for loading normal web pages on iPad/iPhone. UIWebView is presented in modalViewController. Some pages are very memory hungry and some also have Flash content. The problem is that sometimes…
Borut Tomazin
  • 8,041
  • 11
  • 78
  • 91