ios - 'Application windows are expected to have a root view controller at the end of application launch' In Cocos 2d -


i getting error while running cocos2d project. new cocos2d please solve error. code in applicationdidfinishlaunching.

self.notifycenter = [nsnotificationcenter defaultcenter]; [notifycenter addobserver:self selector:@selector(tracknotifications:) name:nil object:nil];  // init window //window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window = [[[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; // cocos2d inherit these values [window setuserinteractionenabled:yes];  [window setmultipletouchenabled:yes];  // try use cadisplaylink director // if fails (sdk < 3.1) use default director if( ! [ccdirector setdirectortype:ccdirectortypedisplaylink] )     [ccdirector setdirectortype:ccdirectortypedefault];  // use rgba_8888 buffers // default is: rgb_565 buffers [[ccdirector shareddirector] setpixelformat:kpixelformatrgba8888];  // create depth buffer of 16 bits // enable if going use 3d transitions or 3d objects //  [[ccdirector shareddirector] setdepthbufferformat:kdepthbuffer16];  // default texture format png/bmp/tiff/jpeg/gif images // can rgba8888, rgba4444, rgb5_a1, rgb565 // can change anytime.  [mobclix startwithapplicationid:@"4708dd74-19a6-46c3-a926-81d71012f7bd"];  [cctexture2d setdefaultalphapixelformat:ktexture2dpixelformat_rgba8888];  // before creating layer, set landscape mode [[ccdirector shareddirector] setdeviceorientation:ccdeviceorientationportrait]; [[ccdirector shareddirector] setanimationinterval:1.0/60]; //[[ccdirector shareddirector] setdisplayfps:yes];  // create opengl view inside window [[ccdirector shareddirector] attachinview:window];   [window makekeyandvisible];       mainmenu *gs = [mainmenu node]; [[ccdirector shareddirector] runwithscene:gs]; 

help if know , thank in advance

specifically talking error of:

'application windows expected have root view controller @ end of application launch' 

it sounds app needs rootviewcontroller:

rootviewcontroller *viewcontroller = [[rootviewcontroller alloc] initwithnibname:nil bundle:nil]; [window setrootviewcontroller:viewcontroller]; 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -