FAQ Database Discussion Community


Why my ViewDidLoad Loads every time?

ios,viewdidload
I am Creating a App in which I implemented FB login. So i write a FBLogin button code in my ViewDidLoad in ViewController.m file. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init]; loginButton.center =...

Refreshing TableViewController

ios,xcode,swift,viewdidload
I have a two tabbed application, on the first page the user can enter names one at a time, on the second tab, the names are shown in a TableView. I have the code to add the names array to the tables in the ViewDidLoad() func, however, this means that...

Reload UIViewController in “viewDidLoad”

ios,objective-c,uilabel,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 right after I change...

Call method ViewDidload Swift

swift,gesture,viewdidload
i currently developpe an app which request data from a webservice, and one the datas are retrieve, i call a method to create some "swype" card like tinder. The problem is, i do not success to call my method in the viewDidload, this is my code : if(success == 1)...

How to detect the closing of the NofiticationCenter in Swift / Xcode?

ios,swift,nsnotificationcenter,viewdidload,viewdidappear
I have a UITableView and I want to to reload, when the NotificationCenter has been dismissed over the running app. override func viewDidLoad() { super.viewDidLoad() self.tableView.reloadData() NSNotificationCenter.defaultCenter().addObserver(self, selector:"dismissedNC", name: UIApplicationWillEnterForegroundNotification, object: nil) } func dismissedNC() { println("NC has been dismissed") // doesn't get printed self.tableView.reloadData() } Any ideas why it...

What is the difference between view controller life cycle and view life cycle in iOS?

ios,objective-c,uiview,uiviewcontroller,viewdidload
Reading several tutorials and books on iOS development I often encounter terms : UIViewController life cycle and UIView life cycle. I'm interested: is there an actual difference between these two terms? Looking Apple docs I found that methods such as viewDidAppear or loadView is a part of view controller's life...

Swift NSNotification not working for all ViewControllers

ios,swift,uinavigationcontroller,nsnotificationcenter,viewdidload
In this Navigation Controller App, I have a button in the TAN ViewController that when clicked on posts an NSNotification. -Both the Blue (Root) ViewController and the Green ViewController are listening to this same notification -The Blue ViewController successfully responds to the notification's arrival -The Green ViewController DOES NOT respond...

Unable to show full image in a View Controller background

ios,swift,viewdidload
I am adding a background image in all of my view controllers but was unable to show full image only the top left portion is visible in the output, the code i am using is this self.view.backgroundColor = UIColor(patternImage: UIImage(named: "Bg6.png")!) I am Putting this code in all my view...