ipad - Need help with an activity indicator -
i can't activity indicator work.
here's i've got-
-(void)viewwillappear:(bool)animated{ [super viewwillappear:yes]; //create instance of activity indicator view uiactivityindicatorview * activityindicator = [[uiactivityindicatorview alloc] initwithframe:cgrectmake(0, 0, 20, 20)]; //set initial property [activityindicator stopanimating]; [activityindicator hideswhenstopped]; //create instance of bar button item custome view of activity indicator uibarbuttonitem * barbutton = [[uibarbuttonitem alloc] initwithcustomview:activityindicator]; //set bar button navigation bar [self navigationitem].rightbarbuttonitem = barbutton; //memory clean [activityindicator release]; [barbutton release]; }
the part of code supposed started , ended--
... else if ([theselection isequaltostring: @"update statistics"]) { [self starttheanimation]; [updatestatistics updatethe2010statistics]; [self stoptheanimation]; } ... -(void)starttheanimation { [(uiactivityindicatorview *)[self navigationitem].rightbarbuttonitem.customview startanimating]; } -(void)stoptheanimation { [(uiactivityindicatorview *)[self navigationitem].rightbarbuttonitem.customview stopanimating]; }
at least change:
[activityindicator hideswhenstopped];
to:
activityindicator.hideswhenstopped = yes;
or remove line, since yes default.
Comments
Post a Comment