Questions tagged [viewwillappear]

UIViewController instance method that notifies the view controller that its view is about to be added to a view hierarchy.

View controller subclasses typically override viewWillAppear to perform any tasks to customize the display of the view, based on the context in which the view is being displayed, as described in the documentation.

292 questions
2
votes
1 answer

When are auto layout constraints resolved?

I have a little problem, it seems that in the viewWillAppearauto layout constraints are not yet resolved. Indeed, I'm working with the new adaptive UI, and the default size is 600x600, not representing any of the real device sizes. But when I launch…
Zaphod
  • 6,758
  • 3
  • 40
  • 60
2
votes
1 answer

Objective-C: ViewWillAppear runs before body of buttonTouchUpInside

I have a Storyboard iOS Application with 2 view controllers- The first Controller has a UIButton with an outlet to the next view controller and a buttonTouchUpInside method. At the moment, the second view controller's lifecycle begins before the…
ja.
  • 467
  • 1
  • 5
  • 16
2
votes
0 answers

Sometimes there is delay between viewWillAppear and viewDidAppear, no CPU usage

I have a segue defined in storyboard from a table cell to a view controller using Modal There are 20% of chance that the lag between viewWillAppear and viewDidAppear will be extreme long (above 5 seconds), 80% of time the lag is within 1…
user2585453
  • 249
  • 3
  • 8
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

NSNotificationCenter with respect to ViewWillAppear and ViewWillDisapper

I have a simple viewController that I want to listen for UIKeyboardWillHideNotification. Therefore I have the following code: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[NSNotificationCenter defaultCenter]…
Nosrettap
  • 10,940
  • 23
  • 85
  • 140
2
votes
1 answer

popViewControllerAnimated affects viewwillappear?

I have two classes. lets say A,B Classes. from A class pushviewController is called, then B class will appear. Then here is the problem .when i call popviewcontrolleranimated method from B class it is going back to A, but then both class`s…
2
votes
2 answers

infinite scroll in tableview using footer

I am trying to support infinite scroll in tableview. I know tableview lets scroll infinitely, but my case is different. Initially, I will load 30 items in my tableview as the user scrolls down close to 30th element, I will make a http request to get…
user1118019
  • 3,819
  • 8
  • 40
  • 46
1
vote
2 answers

not call viewWillAppear while popping from view controller in iPhone

I am using iOS image gallery for selecting the image in my codeWhen I have done selecting image it calls the viewWillAppear method of my current class in which I have clear some variable.So it clear the variable again which I not want. Is there any…
Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76
1
vote
2 answers

tableView reloadData does not work

I have a tableview in a tab bar application. I am loading the data in viewDidLoad managedObjectContext = nil; managedObjectContext = [(RecipesAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; NSFetchRequest…
roberthuttinger
  • 1,172
  • 1
  • 17
  • 31
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

ViewWillAppear query in iphone

I have set the following code in a viewWillAppear method. - (void)viewWillAppear:(BOOL)animated { //some code of ausregion mapView.region = AusRegion; mapView.showsUserLocation = NO; addressField.text = [NSString…
Navnath Memane
  • 265
  • 1
  • 8
  • 25
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
1 answer

How to get my animation running on viewWillAppear or viewDidAppear

How do I get my animation to run again when viewWillAppear or viewDidAppear get called? This is my animation: bounceAnimation =[CABasicAnimation animationWithKeyPath:@"transform.scale"]; [bounceAnimation setToValue:[NSNumber…
1
vote
1 answer

why viewWillAppear does not get called?

[self.view addSubview:self.ListNewController.view]; as we know that function means, will add view to self.view.. the question is, why listNewController's viewWillAppear doesn't called? is there any way to make animate change and call…
user4951
  • 32,206
  • 53
  • 172
  • 282
1
vote
2 answers

Taking a picture from the camera and show it in a UIImageView

I have a view with some fields (name, price, category) and a segmented control, plus this button to take picture. If I try this on the simulator (no camera) it works properly: I can select the image from the camera roll, edit it and go back to the…