0
votes

I found this link which offered the solution of opening my project from the finder. No luck.

I know my code should work, because I have a bunch of UITextfields and about half of them work and half of them don't with pretty much identical code. I suspect I simply have too many IBOutlets and Interface Builder just won't show me anymore since I have so many. (There are 13 labels and 12 textfields that are completely functional already and am trying to add 12 more textfields).

Does Interface Builder have some kind of #-of-outlet limitations, is this an XCode bug, or is there a setting in Interface Builder I could have accidentally changed to cause this behavior??

EDIT: My .h file - I apologize for how gruesome it is.

#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
2
please share the .h code where you declare the IBOutletS - Mahmoud Fayez
No, Interface Builder doesn't have limitations on outlets that I know of. Please post some code of your header file and the implementation of the textfields. - sridvijay
There are no such limitations in IB. Certainly not that low. Btw did you consider creating your GUI in code? Creating 20+ controls in IB seems a bit complicated. - DrummerB
I'll post some code in a few minutes. I would love to do it all in code, but I have a deadline and I have it done the way it is. May change it later. :) - user990769
I just duplicated what you posted as code, all outlets showed up. If you would just post the top part of the .h file with ALL the outlets, ivars, and properties we could take a look at it. I would imagine you could have hundreds if not thousands of outlets (but loading time would be pretty slow). - David H

2 Answers

0
votes

You only put IBOutlet in front of some of your UITextField property declarations. In your header, make sure you put IBOutlet in front of all them, like so:

// 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
votes

Your Code :

@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;

There are mistakes in 2nd, 4th & 6th lines of code. You didn't define UITextField as IBOutlet.

Add IBOutlet to UITextFields, it will work definitely work.

New Code :

@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;