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

iPhone : Memory warning destroying strong objects?

I am developing an app with a view to take pictures. I faced a very strange behavior lately, here is my code. @interface ViewControllerPhotos : UIViewController @property (strong) NSString* _albumID; @end @implementation…
dvkch
  • 1,079
  • 1
  • 12
  • 20
0
votes
1 answer

iOS, Unable to delegate outside of viewDidLoad

I have this appdelegate.h #import @interface appDelegate : NSObject { UIWindow *window; NSString *name; } @property (nonatomic, retain) NSString *name; @end and the .m file @synthesize name; -…
user486174
  • 41
  • 1
  • 10
0
votes
1 answer

ShareKit causing crash in my iOS app?

I've just a crash report appear in iTunes Connect, so I've loaded it into Xcode, which symbolicated it for me. The relevant portion is: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0 Last Exception…
houbysoft
  • 32,532
  • 24
  • 103
  • 156
0
votes
3 answers

ios - Wanting to clean up my viewDidLoad Method

. Hi, I am wanting to clean up my viewDidLoad method as I it is growing in number of lines of code and it is getting messy. Now my UI is build programmatically, because I want to learn that way of doing things. So I read on this SO Post that I can…
jwknz
  • 6,598
  • 16
  • 72
  • 115
0
votes
3 answers

MPMoviePlayerController repeat mode not working in viewDidLoad

It seems that I'm having a problem with repeatmodeone: it does not repeat the video. This is the code for the video I have in the implementation: - (void)viewDidLoad{ NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]…
0
votes
1 answer

Flaw in my logic? iOS button states

I have a floor in my logic, I'm struggling to find it. I have three buttons on my app which have two states, on and off. I have different images for each state, the buttons and image swapping is working well. My problem is on load, no matter what…
mrEmpty
  • 841
  • 4
  • 19
  • 36
0
votes
1 answer

XCODE play video from TableViewCell

I am using storyboards in XCODE4. I am currently able to launch a video from a table cell using a push segue from a tableview controller to a viewcontroller. When the segue gets called, the view controller immediately launches the video using…
trifocal3
  • 3
  • 4
0
votes
1 answer

Objective c - Is there a way to populate a table view with some animation?

I have a view controller with a table view and a NSArray that represent my model. In viewDidLoad I fill the array with objects and then I call [tableView reloadData] to fill the table view. The result is that the table view get filled in one chunk,…
Eyal
  • 10,777
  • 18
  • 78
  • 130
0
votes
2 answers

-initWithContentsOfFile: for an NSMutableArray

I stored images in an NSMutableArray, and now I'm trying to get them to show up in viewDidLoad. I tried calling initWithContentsOfFile, but that doesn't seem to work. This is how the code looks: imageView.image = [[UIImage alloc]…
Henry F
  • 4,960
  • 11
  • 55
  • 98
0
votes
1 answer

performSelector:withObject:afterDelay not working inside viewDidLoad method

I have a tabbar application, the problem is that i need to call a method after a delay of viewDidLoad of the first view but it didn't work (the method is not called) i added the following sample - (void)viewDidLoad { [super viewDidLoad]; …
Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62
-1
votes
1 answer

Swift inheritance carrying over constraints

In my swift code below I am attempting to use inheritance. When I go to class middle the constraints on the initial view controller are still being applied. Even though in middle class I attempt to attach new constraints to right button they are not…
-1
votes
2 answers

View will appear did not getting call

In my application i am using a tabbar. First time when the app is loading it calls the functions in the viewDidload. But when I click on the other tabs and click back the 1st tab again i need to call the functions in viewWillAppear. It didnt call…
-1
votes
1 answer

How to disable button in swift 5

This is my button i use Swift 5 @IBAction func register(_ sender: Any) { Print("register"} } @IBAction func mybutton1(_ sender: Any) { Print("my button 1"} } @IBAction func mybutton2(_ sender: Any) { Print("my button 2"} } i want to disable…
-1
votes
1 answer

Why doesn’t my second override of viewDidLoad get called?

I override viewDidLoad twice. The second time, so I can set a delegate. Yet...it is not being called because myDel is nil. Why isn't my override, in the concrete class CoolTableController getting called? protocol CoolTableProtocol { //unrelevant…
ImStuck
  • 23
  • 3
-1
votes
3 answers

ViewDidLoad gets called twice iOS 13+

I am developing an app for iOS 12+ and the fact that iOS 13 requires a SceneDelegate is causing me some problems when displaying the first ViewController programmatically, as I don't use storyboards. In the AppDelegate.swift I use this code to…
Vipera74
  • 227
  • 3
  • 17