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

ViewDidLoad not called with UITabbarController

I have an app with a first view then it displays two views in an UITabBarViewController. Unhappily, it seems the ViewDidLoad method is not called in my two views linked by the Tab Bar. It has to display a title for example, action which is not…
GoldXApp
  • 2,397
  • 3
  • 17
  • 26
2
votes
4 answers

iOS: Refresh Data When App is Brought to Foreground

I'm getting data off the server via JSON and displaying it on Labels. I've added that method in viewDidLoad. I want to refresh the data when the user opens the app again. Currently, even if I kill the app in the simulator and start the app again, it…
Bilbo Baggins
  • 3,644
  • 8
  • 40
  • 64
2
votes
2 answers

UIImageViews embed in UIScrollView in code w/ auto layout on

I am currently having trouble with my iOS app and Autolayout. I want to let the user scroll photos from Tumblr in a UIScrollView (similar to Photos app, when scrolling your library). So when my ImageViewController gets on screen, it has an array of…
f.c.
  • 23
  • 5
2
votes
3 answers

Mechanism about "did" and "will" and "should" method

I want to know generally when the methods including the key words stated in the topic were called. For example: – tableView:willSelectRowAtIndexPath: – tableView:didSelectRowAtIndexPath: - (BOOL)tableView:(NSTableView *)aTableView…
JackieLam
  • 668
  • 1
  • 7
  • 20
2
votes
2 answers

Is there a way to avoid viewDidLoad beeing called after every segue?

i initialize tables, data etc in my main ViewController. For more settings, i want to call another Viewcontroller with: DateChangeController *theController = [self.storyboard instantiateViewControllerWithIdentifier:@"dateChangeController"]; [self…
Jonathan
  • 139
  • 2
  • 11
2
votes
1 answer

How do I repeat a Reachability test until it works

I have an initial tableviewcontroller which is executing a reachability check. This is working without a problem within the viewDidLoad, however I would like to know the correct way to Retry the connection until it passes. The pertinent code in my…
2
votes
2 answers

InitWithName Execution Before ViewDidLoad Possible?

I'm trying to move an NSString between two View Controllers and after searching around all convoluted ways, the easiest and most straight-forward way I want to get used to was to write an initWithName function in the Receiving VC and calling it in…
2
votes
1 answer

show/hide UIToolbar with tap

I´m using a storyboard with different views for a book-like app. In every view I want a toolbar with button that appears on tap, that gives the user the alternative to return to main view. I have achieved that with a UITapGestureRecognizer. However…
2
votes
1 answer

Call initWithCoder explicitly or ViewDidAppear equivalent in UIView?

In a UIView I have a nav button with an IBAction & method in the top-level view controller. In the IBAction code, I flip a boolean so that when execution returns to the UIView, there's some new setup prior to drawRect: repainting the view. If all…
Tony
  • 373
  • 5
  • 18
2
votes
3 answers

Is it possible to have a sound play before/during the splash screen?

My app takes a few seconds to load and I have a splash screen. Once "viewDidLoad" I have a little sound play. I feel that the sound would be in better use if it started playing when the splash screen popped up. Is it possible to have a sound…
Jeff
  • 159
  • 1
  • 4
  • 13
2
votes
2 answers

How to see the tag of a programmatically created UIButton

on one viewController of my app there is a long list of 20 or so buttons added programmatically, all which i want to call the same method, but to identify themselves through their button tag, but i ran into a problem that has set me back a few hours…
nfoggia
  • 513
  • 1
  • 8
  • 28
2
votes
0 answers

iOS 5.0: current device orientation in view did load returns 0

Could someone please tell me why [UIDevice currentDevice] orientation] always returns 0 in view did load? I want to change the layout of my screen based on current orientation. It doesn't work when I keep my device in landscap mode initially. I am…
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
2
votes
2 answers

ViewDidLoad What is false

Can you say me what is false in this code? I like to check if cydia.app is installed on every launch and if Cydia is installed the Lable should change and a button should be enabled but nothing happens. Here is the code: NSString *filePath =…
user1658674
2
votes
2 answers

Setting resizable UIImage to a UIImageView at viewDidLoad is ignored

I have a UIImageView with an image that I want to be stretchable. In order to achieve that I do the following in viewDidLoad: -(void) buildResizableDescriptionAreaBackground { UIImage *image = [UIImage…
Avi Shukron
  • 6,088
  • 8
  • 50
  • 84
2
votes
0 answers

iPhone Custom leftBarButtonItem fashing on popViewControllerAnimated:YES

I've added custom back button to my viewController. UIImage *buttonImage = [UIImage imageNamed:@"button_back.png"]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:buttonImage…
Lizard
  • 201
  • 1
  • 3
  • 8