error:synthesized property....must either be named

Discussion in 'iOS Programming' started by asing188, Jul 4, 2009.

  1. asing188 macrumors newbie

    Joined:
    Jul 4, 2009
    #1
    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.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Code:
    SwitchViewController *switchViewcontroller;
    
    @property (nonatomic, retain) IBOutlet SwitchViewController *switchViewController;
    
    @synthesize switchViewController;
    
    Which of these things is not like the others?
     
  3. BlackWolf macrumors regular

    Joined:
    Apr 9, 2009
    #3
    is this like those "find the difference"-pictures? :D
     
  4. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #4
    Yes! I win!
     

Share This Page