I suspect you're getting confused about the architecture of an iOS app. Strictly the app delegate is for setting up an application (the main window and controller/view), responding to system events and tearing down the application, NOT for setting-up views. If you are using cocos2d in only a specific view, then that view's view controller is responsible for setting-up the view*. (Actually, I would respectfully disagree with the current cocos2d template, the root view controller should be setting up the glview in its loadView method, not in the app delegate, but as the template assumes only one view/controller, it's less important and overall simpler to understand).
Also, you are initialising another instance of the app delegate, which has already been done by main(). If you want to access an applications app delegate, use
MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]
Obviously substituting MyAppDelegate with the appropriate name.
So when you initialise your view controller with initWithNibName:nil bundle:nil, as you are not loading the view from a nib, you must override the loadView method to create the view. For example, assuming full screen:
- (void)loadView
{
MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
CGRect bounds = [[delegate window] bounds];
EAGLView *glView = [EAGLView viewWithFrame:bounds pixelFormat:kEAGLColorFormatRGB565 depthFormat:0];
self.view = glView;
[[CCDirector sharedDirector] setOpenGLView:glView];
}
You could also use [[UIScreen mainScreen] bounds].
Try it with the standard cocos2d template, strip out the code for creating and assigning the EAGLView from applicationDidFinishLaunching and move it to loadView in the RootViewController.
*Well, usually it comes from a NIB file, but...