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
3 answers

how can i refresh the content of a view before I popViewController?

i have two viewcontroller. First view controller include a map and annotations, when i touch an annotation my second view come. At second view i touch the delete button. So my first view's content must be refresh before this code :…
0
votes
2 answers

Issue formatting string in xcode iphone

I'm a noob to iphone development (2nd day using xcode) and I am having trouble making a dynamic text for a label. My string: dealerspremiumLabel.text= [NSString stringWithFormat:@"%d%% (%@%d)", premiumPercentage, symbol, premiumCurrency]; is…
B. Money
  • 931
  • 2
  • 19
  • 56
0
votes
2 answers

detailTextLabel.text not showing, on iPhone 5 only

I've solved this but it's worth sharing as I couldn't find anything on this. I had a subclass of UITableView, with a detailTextLabel.text that was not displaying. The detailTextLabel object itself exists as normal, and contains the text, you just…
DenverCoder9
  • 3,635
  • 3
  • 31
  • 57
0
votes
1 answer

Orientation Seems to Conflict with Dimensions

if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) { NSLog(@"Device is in portrait"); } else if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){ NSLog(@"Device is in landscape"); } NSLog(@"View bounds are…
Victor Engel
  • 2,037
  • 2
  • 25
  • 46
0
votes
1 answer

Load Core Data properties to textfields

I´m having trouble finding the proper way to load my saved core data to my textfields. I have a view with static cells and each cell has multiple textfields, nothing especial, the idea is just to fill the textfields and hit the button save, and…
0
votes
3 answers

how to show the values on label same untill the app quits

I have label in which i am loading the text value in viewDidLoad and i am changing that value on button click i want the value changed on button clicked to be remain same in the label untill we again click the label but when i move to next screen…
user1808433
  • 3,325
  • 4
  • 16
  • 17
0
votes
0 answers

When will a control on a storyboard page be available to get frame info?

I'm using iOS 6 with storyboard and ARC. I've got on my storyboard a UIView that I want to use for positioning and sizing - I've created an IBOutlet for the control in my controller via the Ctrl drag/drop so I know it's connected. Now I want to try…
Ed Sinek
  • 4,829
  • 10
  • 53
  • 81
0
votes
2 answers

TableView didSelectRowAtIndexPath before ViewDidLoad

I want didSelectRowAtIndexPath to execute before ViewDidLoad. How to do it? in didSelectRowAtIndexPath : [[NSUserDefaults standardUserDefaults] setObject:[[array objectAtIndex:indexPath.row + 1] objectForKey:@"gid"]…
egor.zhdan
  • 4,555
  • 6
  • 39
  • 53
0
votes
3 answers

Can't programmatically move label in viewDidLoad

I'm trying to move a uiLabel down a drop if it's an iPhone 5 (4" display). But it's not working when the code is in viewDidLoad. If I call the code from clicking a uiButton, it works. Here's the code: -(void) viewDidLoad { …
Jonah Katz
  • 5,230
  • 16
  • 67
  • 90
0
votes
1 answer

UITableView gets resize only in ViewDidAppear

I got a weird problem and i don't know where/how to fix it... i have 6 UITableViews on a UIViewController ( i'm using storyboard ), i would like to resize them in the ViewDidLoad but i cannot, the only way i found to resize them it is in the…
xGoPox
  • 674
  • 8
  • 23
0
votes
1 answer

UIButton in firstViewController does not change image properly when closing SecondViewController

I'm saving image from SecondView Controller and resizing it. Then when I go back to Firstview Controller the Button image on this Controller has to be loaded from just saved image file. And image appears partly (only top part of image). But if I go…
Sasha Prent
  • 1,151
  • 2
  • 10
  • 11
0
votes
1 answer

Am I setting the background color in the right place?

Hoping somebody can shed some light on this issue... I'm working on an app that has multiple UIViewControllers each with UITableViews and UIViews in them. I wish to change the background colour for one of the UIViews programmatically. Easy enough to…
r0ddy
  • 159
  • 2
  • 10
0
votes
3 answers

Viewdidload working, while viewwillappear is delayed

I have a project in which I'm switching one view with another: - (IBAction)onClick:(id)sender { ViewControllerSecond * sc=[[ViewControllerSecond alloc]initWithNibName:@"ViewControllerSecond" bundle:nil]; [UIView transitionFromView:self.view…
donald
  • 489
  • 5
  • 13
0
votes
3 answers

Where is the best place for... [iPhone]

In UIViewControllers I have several methods such as viewDidLoad, viewWillAppear, viewDidAppear, etc. The question is: "what is the best place to, for example, set the background color of my view, instantiate, and set the background color of a…
Marco Manzoni
  • 707
  • 3
  • 11
  • 21
0
votes
2 answers

Objective-C display array

I have created a NSMutableArray called myArray where I insert, using SQL statement, three variables. The one variable is a string and the other two double. Then in the viewDidLoad I want to display the array. Specificly I have used: -…
J-K
  • 139
  • 11