Affichage des articles dont le libellé est ios. Afficher tous les articles
Affichage des articles dont le libellé est ios. Afficher tous les articles

mardi 23 septembre 2014

[iOS] viewDidLoad viewDidAppear viewWillAppear

viewWillLoad/viewDidLoad - called when the view is constructed (via the first call to retrieve the view controller's UIView via it's view property - aka lazy loading)
viewWillAppear: - when the view is being prepared to appear either immediately (animated == NO) or view a transition (animated == YES)
viewDidAppear: - if the view appearance wasn't cancelled and the view controller's view fully appears
viewWillDisappear: - complements viewWillAppear:
viewDidDisappear: - complements viewDidAppear:

viewWillUnload/viewDidUnload - deprecated APIs when the view is unload due to memory constraints (don't worry about these anymore)

Source : http://stackoverflow.com/questions/22214843/ios-7-difference-between-viewdidload-and-viewdidappear

lundi 30 décembre 2013

addSubview in UIAlertView deprecated in iOS7


There is a solution....

UIAlertView *alertView;

//a simple alert view with a simple message:
alertView = [[UIAlertView alloc]initWithTitle:nil message:@"My message here..." delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
    

//a simple activity indicator:
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
activityIndicator.frame= CGRectMake(50, 10, 37, 37);
activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin;    
[activityIndicator startAnimating];

//the magic line below,   
//we associate the activity indicator to the alert view: (addSubview is not used)
[alertView setValue:activityIndicator forKey:@"accessoryView"];
    
[alertView show];

Categories