PDA

View Full Version : error:synthesized property....must either be named




asing188
Jul 4, 2009, 08:44 PM
I am writing a simple multiview app with the following header and implementation files:


#import <UIKit/UIKit.h>

@class SwitchViewController;

@interface View_SwitcherAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
SwitchViewController *switchViewcontroller;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet SwitchViewController *switchViewController;

@end

---------

#import "View_SwitcherAppDelegate.h"
#import "SwitchViewController.h"


@implementation View_SwitcherAppDelegate

@synthesize window;
@synthesize switchViewController;
^___ error:synthesized property 'switchViewController' must either be named the same as a compatible ivar or must explicitly name an ivar

-------

Can anyone help to point out what's the problem and how to resolve this error?

Many thanks.



PhoneyDeveloper
Jul 5, 2009, 12:14 AM
SwitchViewController *switchViewcontroller;

@property (nonatomic, retain) IBOutlet SwitchViewController *switchViewController;

@synthesize switchViewController;


Which of these things is not like the others?

BlackWolf
Jul 5, 2009, 05:20 AM
SwitchViewController *switchViewcontroller;

@property (nonatomic, retain) IBOutlet SwitchViewController *switchViewController;

@synthesize switchViewController;


Which of these things is not like the others?

is this like those "find the difference"-pictures? :D

Luke Redpath
Jul 5, 2009, 11:52 AM
is this like those "find the difference"-pictures? :D

Yes! I win!