objective c - Timer that is triggering an Alarm After 35 seconds -


i need timer, that's declared nstimer triger alarm. created neidend filets in vector.h (my viewcontroller.h). i'm trief that:

if(timer == 35) {alert =[[ uialertview alloc] initwithtitle: @"end" message: nil ....]}   else    {    } 

but doesn't work! please help!

benedict

if understood correctly, have sam problem had. want start alert after x seconds, or? mean? if yes, here solution! regards julian!

do in viewcontroller.m

 -(ibaction)start:(id)sender { timer = [nstimer scheduledtimerwithtimeinterval:30 target:self selector:@selector(alertstart)    userinfo:nil repeats:no];   }   -(void) alertstart  {  alert = [[uialertview alloc]initwithtitle:@"end" message: nil   delegate:self       cancelbuttontitle:@"cancel" otherbuttontitles: nil];   // above setup alert  [alert show]; [timer invalidate]; timer = nil; } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -