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
|