2011-03-10 5 views
0

아마 간단한 질문이지만, 퍼즐 게임을 조금 만들었고 아무 것도 결정할 수 없었습니다. 필자는 메뉴를 만들었으므로 퍼즐 전에 보여줄 수없는 문제는 없습니다. 필자는 appdelegate에서 코드를 변경하려고 시도했지만 마음에 들지 않았습니다.이전 버전보다 새로운 화면보기 iphone sdk

슬라이더 appdelegate.h

#import <UIKit/UIKit.h> 

@class SliderViewController; 
@class MainMenu; 

@interface SliderAppDelegate : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    MainMenu *viewController1; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet SliderViewController *viewController; 
@property (nonatomic, retain) IBOutlet MainMenu *viewController1; 
@end 

슬라이더 appdelegate.m

#import "SliderAppDelegate.h" 
#import "SliderViewController.h" 

@implementation SliderAppDelegate 

@synthesize window; 
@synthesize viewController; 
@synthesize viewController1; 


#pragma mark - 
#pragma mark Application lifecycle 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    // Override point for customization after application launch. 

    // Add the view controller's view to the window and display. 
    [self.window addSubview:viewController1.view]; 
    [self.window makeKeyAndVisible]; 

    return YES; 
} 

하지만 그건 오류 밖으로 발생 일 : 나는 그것 아마 바보 같은 질문을 알고 있지만 수

error: request for member 'view' in something not a structure or union

을 아무도 도와주세요.

답변

0

당신은 단지와 빈 화면이 아니라 화면을로드하지만 먼저이

슬라이더 appdelegate.m에게

#import "SliderAppDelegate.h" 
#import "SliderViewController.h" 
#import "MainMenu.h"//change here 

@implementation SliderAppDelegate 

@synthesize window; 
@synthesize viewController; 
@synthesize viewController1; 


#pragma mark - 
#pragma mark Application lifecycle 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    viewController = [[[MainMenu alloc] [email protected]"MainMenu" bundle:nil] autorelease]; // and here 
    [self.window addSubview:viewController1.view]; 
    [self.window makeKeyAndVisible]; 

    return YES; 
} 
+0

그 건배, 약간의 문제를 참조 클래스를 가져 ALLOC에게 개체를 만들 필요가 모든 버튼이 켜져 있습니다. – user506926