我是新創建iPhone應用程序。我正在嘗試創建一個簡單的listapp。基本上它會有大量的列表類別,然後一旦類別被點擊,它將打開一個列表的列表,你可以添加項目列表。多視圖控制器使用故事板
我使用的故事板,我有幾個視圖控制器。
它沒有錯誤編譯,我能第一個表視圖控制器上添加類別,但是當我點擊的類別和嘗試添加我得到這個錯誤的項目 - 主題1:信號SIGABRT
我大概猜測了,因爲我沒有初始化的appdelegate.m
這裏viewControllers其餘的那場我對appDelegate.m
#import "AppDelegate.h"
#import "ListViewController.h"
#import "List.h"
@implementation AppDelegate {
NSMutableArray *items;
}
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
items = [NSMutableArray arrayWithCapacity:20];
List *item = [[List alloc] init];
item.title = @"Grocery List";
[items addObject:item];
item = [[List alloc]init];
item.title = @"Project List";
[items addObject:item];
item = [[List alloc] init];
item.title = @"Events List";
[items addObject:item];
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UINavigationController *navigationController = [[tabBarController viewControllers]objectAtIndex:0];
ListViewController *listViewController = [[navigationController viewControllers]objectAtIndex:0];
listViewController.lists = items;
return YES;
}
@end
代碼我其實是有點迷惑的我怎麼將初始化viewcont的其餘部分appDelegate.m上的滾輪。
請幫助我,在此先感謝
提示:當遇到SIGABRT錯誤時設置異常斷點 - http://blog.manbolo.com/2012/01/23/xcode-tips- 1-break-on-exceptions(我在google上找到的教程)。它會告訴你你的錯誤提出的地方。 – Kevin