UIViews not showing in my window based template?
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;
精彩评论