objective c - UILabel in app delegate, add to new class -
objective c - UILabel in app delegate, add to new class -
i making test app, right have timer in application did finish launching, here code,
-(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { timelabel = [[uilabel alloc] initwithframe:cgrectmake(20, 80, 280, 120)]; [self.view addsubview:timelabel]; [timelabel.text isequaltostring:@"0"]; time = [nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:@selector(timervoid) userinfo:nil repeats:yes]; } -(void)timervoid { int now; = [timelabel.text intvalue]; int after; after = + 1; timelabel.text = [nsstring stringwithformat:@"%i", after]; } i need timer go on through classes thats why set in app delegate application did finish launching, how can add together classes view?
objective-c xcode uilabel nstimer
Comments
Post a Comment