rocky171 rocky171 - 1 month ago 6
iOS Question

Logout App after fixed time in iOS

hi all i am new to the iOS programming please help me..... Thanks in advance..
I want to add logout functionality in my app, so that user get logout after fixed interval from login time(2 hrs).
Please suggest me the way to implement this functionality

Answer

you can implement this functionality using NSTimer

[NSTimer scheduledTimerWithTimeInterval:@"time" target:self selector:@selector(targetMethod:) userInfo:nil repeats:NO];

-(void)targetMethod
 {
      //enter code here`
 }