Interface Builder没有显示我的IBOutlets
我发现了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, span) IBOutlet UILabel *label333Team1, *label333Team2;
@property (nonatomic, span) IBOutlet UILabel *label363Team1, *label363Team2;
@property (nonatomic, span) IBOutlet UILabel *labelCycleTeam1, *labelCycleTeam2;
// Stackers //
@property (span, nonatomic) IBOutlet UILabel *label333Stacker1a, *label333Stacker1b, *label333Stacker2a, *label333Stacker2b;
@property (span, nonatomic) IBOutlet UILabel *label363Stacker1a, *label363Stacker1b, *label363Stacker2a, *label363Stacker2b;
@property (span, nonatomic) IBOutlet UILabel *labelCycleStacker1a, *labelCycleStacker1b, *labelCycleStacker2a, *labelCycleStacker2b;
// Attempts //
// 333
@property (span, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3;
@property (span, nonatomic) UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3;
// 363
@property (span, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3;
@property (span, nonatomic) UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3;
// Cycle
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3;
@property (span, nonatomic) UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3;
-(IBAction)switchview:(id)sender;
@end
回答:
您只将IBOutlet放在您的一些UITextField属性声明的前面。在你的头,要确保你把IBOutlet中所有他们的面前,就像这样:
// Attempts // // 333
@property (span, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3;
@property (span, nonatomic) IBOutlet UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3;
// 363
@property (span, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3;
@property (span, nonatomic) IBOutlet UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3;
// Cycle
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3;
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3;
回答:
代码:
@property (span, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; @property (span, nonatomic) UITextField *field333attempt2a1, *field333attempt2a2, *field333attempt2a3, *field333attempt2b1, *field333attempt2b2, *field333attempt2b3;
// 363
@property (span, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3;
@property (span, nonatomic) UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3;
// Cycle
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3;
@property (span, nonatomic) UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3;
有在第2个错误,代码4 &第6行。您没有将UITextField定义为IBOutlet。
将IBOutlet添加到UITextFields,它肯定会工作。
新代码:
@property (span, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3; @property (span, nonatomic) IBOutlet UITextField *field333attempt1a1, *field333attempt1a2, *field333attempt1a3, *field333attempt1b1, *field333attempt1b2, *field333attempt1b3;
//363
@property (span, nonatomic) IBOutlet UITextField *field363attempt1a1, *field363attempt1a2, *field363attempt1a3, *field363attempt1b1, *field363attempt1b2, *field363attempt1b3;
@property (span, nonatomic) IBOutlet UITextField *field363attempt2a1, *field363attempt2a2, *field363attempt2a3, *field363attempt2b1, *field363attempt2b2, *field363attempt2b3;
// Cycle
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt1a1, *fieldCycleattempt1a2, *fieldCycleattempt1a3, *fieldCycleattempt1b1, *fieldCycleattempt1b2, *fieldCycleattempt1b3;
@property (span, nonatomic) IBOutlet UITextField *fieldCycleattempt2a1, *fieldCycleattempt2a2, *fieldCycleattempt2a3, *fieldCycleattempt2b1, *fieldCycleattempt2b2, *fieldCycleattempt2b3;
以上是 Interface Builder没有显示我的IBOutlets 的全部内容, 来源链接: utcz.com/qa/259264.html