2011-08-06 44 views
-1

我有一個小問題:簡單的UILabel錯誤?

我在主窗口中有一個視圖控制器和一個tabbarcontroller。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:  (NSDictionary *)launchOptions 
{ 
// Override point for customization after application launch. 
// Add the tab bar controller's current view as a subview of the window 

self.window.rootViewController = self.tabBarController; 
[self.window makeKeyAndVisible]; 

在這個視圖上我有大約10個標籤。

只要我將Interface-Builder上的1個標籤與控制器中的UILabel連接起來,就會出現SIGBART錯誤。

這裏是我的代碼:

#import <UIKit/UIKit.h> 

@interface SelfViewController : UIViewController 
{ 
    IBOutlet UILabel *id2; 
    IBOutlet UILabel *username; 
    IBOutlet UILabel *vorname; 
    IBOutlet UILabel *nachname; 
    IBOutlet UILabel *email; 
} 

@end 

我在做什麼錯?

+0

只要你從後臺視圖連接1個標籤?那是什麼意思?你用什麼代碼來做到這一點?我們需要更多細節... – GarlicFries

+0

也應該在界面中聲明UILabels,然後在界面下的屬性中聲明IBOutlet UILabels –

+0

這句話本身也很混亂:「我有一個視圖控制器和一個主窗口中的tabbarcontroller。「 'UITabBarController'是你的''''''rootViewController',我假設?我們正在討論UITabBarController標籤之一的視圖控制器? – GarlicFries

回答