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

Invalid redeclaration of viewDidLoad

My code is: import UIKit class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from…
Tom Weston
  • 11
  • 1
-2
votes
2 answers

Swift Slider Value Keeps Changing Back to StoryBoard Value

I am trying to create a slider such that at the initial load of the app, the slider has a default value, say 5. But if I were to change the slider value to 10, and leave the VC and come back, I would like the value to be 10. I have tried…
Kevin
  • 1,189
  • 2
  • 17
  • 44
-2
votes
3 answers

Where to put code that gets checked frequently?

I have some code that needs to get called frequently, such as check what day it is, if it's the next day then move the day strings in the tableView. Now I thought that the viewDidLoad would get called all the time and so it would be 'fine' to put it…
Jake Walker
  • 305
  • 2
  • 9
-2
votes
2 answers

Reload UIViewController in "viewDidLoad"

I change the value of 2 UILabels in my "viewDidLoad" method, but I need the view to refresh after that in order to display the values. As it currently stands, the UILabels display the value of the previously selected cell. I need to do the refresh…
Vimzy
  • 1,871
  • 8
  • 30
  • 56
-2
votes
1 answer

TextField.text is not working after ViewDidLoad

I want to fill the UITextField after viewDidLoad, but after viewDidLoad I assign the UITextField does not appear in any appreciable way. I do this in viewDidLoad UITextField process; _TextField.delegate = self; Idle (after…
Burak Benli
  • 39
  • 2
  • 8
-2
votes
1 answer

No effect for IBAction in viewDidLoad?

When I press my button, nothing happens. How can I fix this? And the integer x is declared in the .h file. Edit: the button defines a value for x , and as you see in the code , x is added to the rotation duration. When I press the button , the…
Joseph
  • 149
  • 1
  • 2
  • 7
-2
votes
3 answers

How would I call this method from the viewDidLoad method?

How would I call this method from the viewDidLoad method? - (void)mapView:(MKMapView *)mapview didSelectAnnotationView:(MKAnnotationView *)view { // code } I'm stuck on the syntax: [self mapview:.....];
hanumanDev
  • 6,592
  • 11
  • 82
  • 146
-2
votes
1 answer

Xcode - how to make a level unlock system?

Hey guys I was just wondering how i could do this in Xcode. Any help would be appreciated I would like to begin my level (that is already made) and then use the viewdidload (in my level view) to change a button in my level selector (separate view…
-3
votes
1 answer

how to customize a label when is not in viewdidload?

I have those variables in collectionviewcell file and I want to change label background and cornerradius but that file doesnt have a viewdidload how can I do that . Thanks for helps.
-3
votes
1 answer

Load TableView cell before/on ViewDidLoad?

Currently I have a tableview that loads cells when I scroll down (scrollview). Is it possible to load and populate all cells on viewDidLoad. I would like to assign data to a cell before it can be viewed. I have tried using…
P. Kwong
  • 61
  • 2
  • 9
-3
votes
3 answers

retaining data outside of viewDidLoad in objective c ios

I am aware this question has been asked previously, but the answers provided have not solved my issue. For instance, I have a very simple array of objects outlined in viewDidLoad: @implementation MyViewController { NSArray *tableData; } -…
AB567
  • 141
  • 8
-3
votes
2 answers

sending NSNumber *_ strong to parameter of incompatible type of float

Trying to save the position of a Slider: saving my slider value with NSUserDefaults: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[NSNumber numberWithFloat:slider.value] forKey:@"slider"]; in my…
Jchou
  • 9
  • 1
  • 4
-4
votes
1 answer

Calling viewDidLoad in UITextField

What's the code for calling viewDidLoad in UITextField, I only seem to find mixed answers: @IBOutlet weak var providerForm: UITextField! // What to insert here to call the viewDidLoad function? override func viewDidLoad() { …
-4
votes
3 answers

when to use viewDidLoad

I am new to both iOS development and programming in general. I need some clarification as to what sort of things should be declared in the viewDidLoad function of a UIViewController subclass Thanks
-6
votes
2 answers

Is it true that using view controllers and viewDidLoad method for implementing my methods?

I am beginner at Objective-c and iOS application develop. And i want to take your suggestions about my way of implementation codes. I am using view controllers for implement all my methods in that way: - (void)viewDidLoad { [super…
ananana
  • 15
  • 7
1 2 3
48
49