• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTimer and Selector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimer and Selector


  • Subject: NSTimer and Selector
  • From: Andrew James <email@hidden>
  • Date: Wed, 11 Apr 2007 06:48:34 +0930

Hi,

Im having some trouble here with a selector, for some reason it keeps giving me the below error:

2007-04-10 21:00:00.348 SleepLock[7030] *** -[NSCFTimer scheduledTimerWithTimeInterval:invocation:repeats:]: selector not recognized [self = 0x37bf60]
2007-04-10 21:00:00.349 SleepLock[7030] *** -[NSCFTimer scheduledTimerWithTimeInterval:invocation:repeats:]: selector not recognized [self = 0x37bf60]


These are the two functions isolated and they both have their brothers in the .h file


-(IBAction)timerItem:(id)sender{
[[NSUserDefaults standardUserDefaults] synchronize];
int timerPeriod;
timerPeriod = [[NSUserDefaults standardUserDefaults] integerForKey:@"timerPeriod"];
if (timerPeriod == nil) {
[timerPanel makeKeyAndOrderFront:nil];
} else {
//timerPeriod = (timerPeriod * 60);
NSInvocation *theInvocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(lockScreen)]];
[theInvocation setSelector:@selector(lockScreen)];
[theInvocation setTarget:self];

NSTimer * lockTimer = [[NSTimer alloc] scheduledTimerWithTimeInterval:timerPeriod
invocation:theInvocation
repeats:YES];
NSLog(@"Timer added to runLoop");
[[NSRunLoop currentRunLoop] addTimer:lockTimer forMode:NSDefaultRunLoopMode];
}
}


-(void)lockScreen{
screenLock *sl = [[screenLock alloc] init]; // now we have a screenLock instance named sl
[sl initLock];
}


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimer and Selector
      • From: Andy Lee <email@hidden>
    • Re: NSTimer and Selector
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Detecting Click Location in NSOutlineView
  • Next by Date: Re: NSTimer and Selector
  • Previous by thread: stroke and fill - logs CGContextSetFillColorWithColor invalid context
  • Next by thread: Re: NSTimer and Selector
  • Index(es):
    • Date
    • Thread