【发布时间】:2011-07-09 21:14:34
【问题描述】:
我有一个现有的 TableViewController 如下
// TableViewController.h
@interface TableViewController : UITableViewController { NSArray *dataArray; }
@property (nonatomic, retain) NSArray *dataArray;
还有一个 navAppDelegate - 具体来说:
// navAppDelegate.h
#import <UIKit/UIKit.h>
@interface navwAppDelegate : NSObject
<UIApplicationDelegate, UINavigationControllerDelegate> {
UIWindow *window;
IBOutlet UINavigationController *navigationController;}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UINavigationController *navigationController;
// navAppDelegate.m
#import "navAppDelegate.h"
@implementation navigationtableviewAppDelegate
@synthesize window, navigationController;
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[window makeKeyAndVisible];
[window addSubview:[navigationController view]];
}
现在,我只是将文件添加到现有项目中,除了我将 (void)applicationDidFinishLaunching{} 的内容放在 (void)viewDidLoad{} 中,因为从现在开始它是视图而不是窗口(对吗?) .它不起作用,我的猜测是我必须将所有窗口调用从上面更改为视图?我在这里犯了什么根本错误? 我正在拨打电话
// StartOffHere.m
- (void)LetsGoButtonTouched {
navAppDelegate *newview = [[navAppDelegate alloc] initWithNibName:nil bundle:nil]; // I get a SIGABRT here
[[self navigationController] pushViewController: newview animated: YES];
}
【问题讨论】:
标签: iphone xcode uiview sdk uiapplicationdelegate