I need help with two errors

Discussion in 'Mac Programming' started by italiano40, Jul 21, 2008.

  1. italiano40 macrumors 65816

    italiano40

    Joined:
    Oct 7, 2007
    Location:
    NY
    #1
    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
    
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    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?
     
  3. italiano40 thread starter macrumors 65816

    italiano40

    Joined:
    Oct 7, 2007
    Location:
    NY
    #3
    thanks now i see, i must have missed it
     
  4. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #4
    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
    
     
  5. italiano40 thread starter macrumors 65816

    italiano40

    Joined:
    Oct 7, 2007
    Location:
    NY
    #5
    thank you i got it working fine now
     

Share This Page