• 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 May not to scheduledtimerWithInterval
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimer May not to scheduledtimerWithInterval


  • Subject: NSTimer May not to scheduledtimerWithInterval
  • From: Daniel Bruchez <email@hidden>
  • Date: Fri, 16 Feb 2007 11:48:26 -0500

Hi:

I'm new to Xcode and was trying to add a Timer Event to my application. I get the following warning when I tried add this code to my application:

warning:"NSTimer may not respond to  '+scheduledTimerWithInterval:target:selector:userInfo:repeats:'
Messages without a matching method signature will be assumed to return'id' and accept'...' as arguments.)

Here's a snip of my code-->>

//Create Timer
scantimer = [ [NSTimer scheduledTimerWithInterval:1.0
target:self
selector:@selector(scanBrain:)
userInfo:nil
repeats:YES] retain] ;


- (void)scanBrain:(NSTimer *)scantimer
{
long                   nResult;
SIOMM_AnaPointReadArea AnaPtData;
  // Read the analog point value of point 16
   nResult = Brain.GetAnaPtReadAreaEx(16, &AnaPtData);

   

   float pnt16 = AnaPtData.fValue;

   

   [indoortempOutlet setStringValue:[NSString stringWithFormat:@"%f",pnt16]];

 

 

   // Read the analog point value of point 17
   nResult = Brain.GetAnaPtReadAreaEx(17, &AnaPtData);
   float pnt17 = AnaPtData.fValue;
   [outdoortempOutlet setStringValue:[NSString stringWithFormat:@"%f",pnt17]];

NSCalendarDate *now;
now = [NSCalendarDate calendarDate];
[ statusOutlet setObjectValue:now];

}
 
My .h file contains -->

#import <Cocoa/Cocoa.h>
#include "AsyncSocket.h"
@interface OPTO22Controller : NSWindowController
//@interface OPTO22Controller : NSOject
{
    IBOutlet NSTextField *hostIPOutlet;
    IBOutlet NSTextField *outdoortempOutlet;
    IBOutlet NSTextField *StatusLabelOutlet;
    IBOutlet NSTextField *statusOutlet;
    IBOutlet NSTextField *indoortempOutlet;
NSTimer *scantimer;
AsyncSocket *socket;
}
- (IBAction)connectToHost:(id)sender;
- (IBAction)startscanner:(id)sender;
- (void)scanBrain:(NSTimer *)scantimer;
@end

Regards

Dan


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTimer May not to scheduledtimerWithInterval
      • From: "Sean McBride" <email@hidden>
    • Re: NSTimer May not to scheduledtimerWithInterval
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Re: gcc -pthread not supported
  • Next by Date: Re: NSTimer May not to scheduledtimerWithInterval
  • Previous by thread: Re: gcc -pthread not supported
  • Next by thread: Re: NSTimer May not to scheduledtimerWithInterval
  • Index(es):
    • Date
    • Thread