Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

italiano40

macrumors 65816
Original poster
Oct 7, 2007
1,080
0
NY
ok i get these two errors
error: syntax error before '{' token
and
fatal error: method definition not in @implementation context
here is the code, which was surprising created by the interface builder
Code:
#import <Cocoa/Cocoa.h>
#import <CURLHandle.h>
#import <CURLHandle+extras.h>

@interface NSObject: {  //first error is found here
}
-(IBAction)agree:(id)sender; //second error is found here
-(IBAction)upload:(id)sender;
	
@end
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
ok i get these two errors
error: syntax error before '{' token
and
fatal error: method definition not in @implementation context
here is the code, which was surprising created by the interface builder
Code:
#import <Cocoa/Cocoa.h>
#import <CURLHandle.h>
#import <CURLHandle+extras.h>

@interface NSObject: {  //first error is found here
}
-(IBAction)agree:(id)sender; //second error is found here
-(IBAction)upload:(id)sender;
	
@end

The error is exactly where the compiler told you, right before the opening parenthesis. Have a look at the Objective-C language manual, or check a few examples, and you should find what is wrong.

Do you realise that you are trying to add a category to NSObject? Is that really, truly what you want? Do you realise that this is Dangerous with a capital D?
 

italiano40

macrumors 65816
Original poster
Oct 7, 2007
1,080
0
NY
The error is exactly where the compiler told you, right before the opening parenthesis. Have a look at the Objective-C language manual, or check a few examples, and you should find what is wrong.

Do you realise that you are trying to add a category to NSObject? Is that really, truly what you want? Do you realise that this is Dangerous with a capital D?

thanks now i see, i must have missed it
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
Code:
#import <Cocoa/Cocoa.h>
#import <CURLHandle.h>
#import <CURLHandle+extras.h>

@interface [COLOR="Red"](missing name of class here:)[/COLOR] NSObject {  [COLOR="SeaGreen"]//so instead of "[I]@interface NSObject: {[/I]", it should be something like "[COLOR="Green"]@interface ClassName : NSObject {[/COLOR]"[/COLOR]
}
-(IBAction)agree:(id)sender; [COLOR="SeaGreen"]//you've declaired this method in the header file here, but it's not found in your implementation file[/COLOR]
-(IBAction)upload:(id)sender;
	
@end
 

italiano40

macrumors 65816
Original poster
Oct 7, 2007
1,080
0
NY
Code:
#import <Cocoa/Cocoa.h>
#import <CURLHandle.h>
#import <CURLHandle+extras.h>

@interface [COLOR="Red"](missing name of class here:)[/COLOR] NSObject {  [COLOR="SeaGreen"]//so instead of "[I]@interface NSObject: {[/I]", it should be something like "[COLOR="Green"]@interface ClassName : NSObject {[/COLOR]"[/COLOR]
}
-(IBAction)agree:(id)sender; [COLOR="SeaGreen"]//you've declaired this method in the header file here, but it's not found in your implementation file[/COLOR]
-(IBAction)upload:(id)sender;
	
@end

thank you i got it working fine now
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.