0

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
Community
  • 1
  • 1
user990769
  • 115
  • 2
  • 12
  • please share the .h code where you declare the IBOutletS – Mahmoud Fayez Aug 28 '12 at 18:33
  • 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 Aug 28 '12 at 18:34
  • 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 Aug 28 '12 at 18:37
  • 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 Aug 28 '12 at 18:39
  • 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 Aug 28 '12 at 23:22
  • Alright, I'll add it now. I apologize in advance if my .h file makes your eyes bleed. – user990769 Aug 29 '12 at 00:01
  • Obvious question: did you check that you typed the class name, `Individual` correctly into the box in Interface Builder that identifies the class of whomever you're expecting to expose the outlets? – Tommy Aug 29 '12 at 00:24
  • That is inside of the Identity Inspector on the right, correct? It is, and I've tried adding other IBOutlets with success to this file and in the .nib I'm trying to use. I'm wondering if there's a bug with XCode and something about my IBOutlets having similar names is causing it to go crazy. – user990769 Aug 29 '12 at 01:11
  • Why aren't all the `UITextField`s declared as IBOutlets? (all the ...2a,...2b ones) – Carl Veazey Aug 29 '12 at 02:54
  • Because I am an idiot. : ) That would be it! Thanks! – user990769 Aug 29 '12 at 03:14

2 Answers2

0

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;
Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
0

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;
Manann Sseth
  • 2,745
  • 2
  • 30
  • 50