开发者

Request for Member 'View' in something not a structure or union

I'm getting th开发者_StackOverflow社区e error mentioned in the title.

Here's my interface:

#import <UIKit/UIKit.h>

@class ControllerLevel1;

@interface RootController : UIViewController {
ControllerLevel1 *controllerLevel1;
}

@property (retain, nonatomic) ControllerLevel1 *controllerLevel1;

@end  

And here's the implementation:

#import "RootController.h"
#import "ControllerLevel1.h"

@implementation RootController

@synthesize controllerLevel1;

- (void)viewDidLoad {
    ControllerLevel1 *firstLevel = [[ControllerLevel1 alloc]initWithNibName:@"ControllerLevel1" bundle:nil];
    self.controllerLevel1 = firstLevel;
    [self.view insertSubview:firstLevel.view atIndex:0];
    [firstLevel release];
    [super viewDidLoad];
}

The error occurs in [self.view insertSubview:firstLevel.view atIndex:0];


It's complaining about firstLevel.view.

So, likely you didn't declare "view" as a property in ControllerLevel1.h. Show us the .h file for that and we can help more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜