我只是想把“金dow” sub倒,以便我能够拦截一些通知。 除下文所列法典外,我还进入了MainWindow.xib,并更新了IDWindow对我的子阶级的反对。 问题在于我表格上的表格没有反应(例如,我仅添加一个表格,但在我看来我有多个(不是问题)。 谁会看到我会做什么错误呢? 感谢。
UISubclassedWindow.h
#import <UIKit/UIKit.h>
@interface UISubclassedWindow : UIWindow
{
}
@end
www.un.org/Depts/DGACM/index_french.htm
#import "UISubclassedWindow.h"
@implementation UISubclassedWindow
- (id) initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
NSLog(@"init");
}
return self;
}
- (void)makeKeyAndVisible
{
[super makeKeyAndVisible];
NSLog(@"makeKeyAndVisible");
}
- (void)becomeKeyWindow
{
[super becomeKeyWindow];
NSLog(@"becomeKeyWindow");
}
- (void)makeKeyWindow
{
[super makeKeyWindow];
NSLog(@"makekeyWindow");
}
- (void)sendEvent:(UIEvent *)event
{
}
- (void)dealloc
{
[super dealloc];
}
@end
<>AppDelegate.h
import
@队长
@interface My_AppAppDelegate : NSObject <UIApplicationDelegate>
{
UISubclassedWindow *window;
}
@property (nonatomic, retain) IBOutlet UISubclassedWindow *window;
@end
<>AppDelegate.m
@synthesize window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UITabBarController *tabBarController = [[UITabBarController alloc] init];
MainViewController *mainViewController = [[MainViewController alloc] initWithViewType: 0];
UINavigationController *mainNavigationController = [[UINavigationController alloc] initWithRootViewController: mainViewController];
mainNavigationController.title = @"Main";
[[mainNavigationController navigationBar] setBarStyle: UIBarStyleBlack];
[tabBarController setViewControllers: [NSArray arrayWithObjects: mainNavigationController, nil]];
[self.window setRootViewController: tabBarController];
[self.window makeKeyAndVisible];
[mainViewController release];
[mainNavigationController release];
[tabBarController release];
return YES;
}