2012-08-28 96 views
0

我發現了this link,它提供了從查找器中打開我的項目的解決方案。沒有運氣。Interface Builder沒有顯示我的IBOutlets

我知道我的代碼應該工作,因爲我有一堆UITextfields,其中大約一半工作,其中一半工作不完全相同的代碼。我懷疑我只是有太多的IBOutlets和Interface Builder,因爲我有這麼多,所以不會再顯示我。 (已有13個標籤和12個文本框已經完全正常工作,並且正在嘗試添加12個以上的文本框)。

Interface Builder是否存在某種#的出口限制,這是一個XCode錯誤還是在界面生成器中有一個設置,我可能會意外地更改爲導致此行爲?

編輯: 我的.h文件 - 我很抱歉它是多麼可怕。

#import <UIKit/UIKit.h> 
#import "MatchSheet.h" 
#import "Match.h" 

@interface Individual : UIViewController<UIScrollViewDelegate>{ 
IBOutlet UIScrollView *scroller; 
UILabel *label333Team1, *label333Team2, *label363Team1, *label363Team2, *labelCycleTeam1,  *labelCycleTeam2; 
UILabel *label333Stacker1a, *label333Stacker1b, *label333Stacker2a, *label333Stacker2b, *label363Stacker1a, *label363Stacker1b, *label363Stacker2a, *labet363Stacker2b, *labelCycleStacker1a, *labelCycleStacker1b, *labelCycleStacker2a, *labelCycleStacker2b; 

// 333 Attempts 
UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 
UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3; 
// 363 Attempts 
UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3; 
UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3; 
// Cycle Attempts 
UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3; 
UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3; 
} 

// Teams // 
@property (nonatomic, strong) IBOutlet UILabel *label333Team1, *label333Team2; 
@property (nonatomic, strong) IBOutlet UILabel *label363Team1, *label363Team2; 
@property (nonatomic, strong) IBOutlet UILabel *labelCycleTeam1, *labelCycleTeam2; 
// Stackers // 
@property (strong, nonatomic) IBOutlet UILabel *label333Stacker1a, *label333Stacker1b, *label333Stacker2a, *label333Stacker2b; 
@property (strong, nonatomic) IBOutlet UILabel *label363Stacker1a, *label363Stacker1b, *label363Stacker2a, *label363Stacker2b; 
@property (strong, nonatomic) IBOutlet UILabel *labelCycleStacker1a, *labelCycleStacker1b, *labelCycleStacker2a, *labelCycleStacker2b; 

// Attempts // 
// 333 
@property (strong, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 
@property (strong, nonatomic) UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3; 
// 363 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3; 
@property (strong, nonatomic) UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3; 
// Cycle 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3; 
@property (strong, nonatomic) UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3; 

-(IBAction)switchview:(id)sender; 

@end 
+0

請分享,你聲明IBOutletS –

+0

否.H代碼,界面生成器上沒有我知道的出口限制。請張貼您的頭文件的一些代碼和文本字段的實現。 – sridvijay

+0

IB中沒有這樣的限制。當然不是那麼低。順便說一句你考慮在代碼中創建你的GUI?在IB中創建20個以上的控件似乎有點複雜。 – DrummerB

回答

0

您只將IBOutlet放在您的一些UITextField屬性聲明的前面。在你的頭,要確保你把IBOutlet中所有他們的面前,就像這樣:

// Attempts // 
// 333 
@property (strong, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3; 
// 363 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3; 
// Cycle 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3; 
+0

再次感謝。 :) – user990769

0

代碼:

@property (strong, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 
@property (strong, nonatomic) UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3; 

// 363 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3; 
@property (strong, nonatomic) UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3; 

// Cycle 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3; 
@property (strong, nonatomic) UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3; 

有在第2個錯誤,代碼4 &第6行。您沒有將UITextField定義爲IBOutlet。

將IBOutlet添加到UITextFields,它肯定會工作。

新代碼:

@property (strong, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; 

//363 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3; 

// Cycle 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3; 
@property (strong, nonatomic) IBOutlet UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3; 
+0

投票並接受答案,如果你有想法。 謝謝 –

相關問題