开发者

UIViews not showing in my window based template?

开发者 https://www.devze.com 2023-03-06 08:09 出处:网络
UIView not shown on my window based template? I am creating an app for this a was use the window based template and a view controller and for checking drop label but 开发者_Go百科after execution it ap

UIView not shown on my window based template? I am creating an app for this a was use the window based template and a view controller and for checking drop label but 开发者_Go百科after execution it appears like clean white window.

in delegate header file i do this

#import "First_View.h"
@class First_View;
@property (nonatomic, retain) First_View *viewcontroller;

And in delegate.m 
@synthesize viewcontroller=_viewcontroller;
//in implementation 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    self.window.rootViewController = self.viewcontroller; /*/**main line code here**/*/    
    [self.window makeKeyAndVisible];
    return YES;
}


You can add the ViewController View to the window like that:

[self.window addSubView:self.viewcontroller.view];

And the view Controller should have an outlet if you are creating it using Interface Builder and don't forget to connect it:

@property (nonatomic, retain) IBOutlet First_View *viewcontroller;
0

精彩评论

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

关注公众号