LA1
LA1

Reputation: 27

error: expected member name or ';' after declaration specifiers [1] - IBAction

Ever since I've upgraded to Xcode 4. I've got this error and i can't seem to figure out whats wrong.

error: expected member name or ';' after declaration specifiers [1]

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

    @interface SixViewController : UIViewController <AVAudioPlayerDelegate> {

        IBOutlet UIImageView *play;
        AVAudioPlayer *theAudio;
        float progress;
        NSTimer *timer;
        IBOutlet UIProgressView *progressView;
        int mainInt;
        IBAction *timeOut;
    }

It highlights the error on ibaction line

thanks

Upvotes: 0

Views: 5505

Answers (1)

Georg Fritzsche
Georg Fritzsche

Reputation: 99084

IBAction is intended as a return value for methods:

- (IBAction)someMethod;

... to tell Interface Builder that it is available for target/action connections. It is not intended as a variable data type, although you can get away with it when IBAction is defined as void.

However, you should use the correct data type for this variable, e.g. id for generic objects or maybe NSTimeInterval depending on what you're actually trying to do here.

Upvotes: 1

Related Questions