I m 只是学习可可(来自C#)和Im ,对似乎很简单的东西留下了奇怪的错误。 (charsSince Last Update >= 36
#import "CSMainController.h"
@implementation CSMainController
//global vars
int *charsSinceLastUpdate = 0;
NSString *myString = @"Hello world";
//
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
...
}
//other functions
- (void)textDidChange:(NSNotification *)aNotification {
NSLog(@"charsSinceLastUpdate=%i",charsSinceLastUpdate);
if (charsSinceLastUpdate>=36) { // <- THIS line returns the error: Comparison between pointer and integer
charsSinceLastUpdate=0;
[statusText setStringValue:@"Will save now!"];
} else {
charsSinceLastUpdate++;
[statusText setStringValue:@"Not saving"];
}
}
//my functions
- (void)showNetworkErrorAlert:(BOOL)showContinueWithoutSavingOption {
...
}
//
@end
感谢大家的任何帮助。