Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 20, 2012, 12:20 AM   #1
BadWolf13
macrumors 6502
 
Join Date: Dec 2009
IBOutlets and IBActions, some working, some not

Hey guys, got a weird one here that I can't figure out. I've got a custom view XIB file, loading into the program using:

Code:
	[NSBundle loadNibNamed:@"Basic" owner:self];

	[window setContentView:basicView];
Now the view loads, and displays just fine. However, the problem occurs when fetching information from the display, or sending information to the display. Some of it works, some of it doesn't. For instance, in this section of code:

Code:
	} else if (shapeButton.indexOfSelectedItem == 1) {
		[dim1Label setStringValue:@"Width:"];
		[dim2Label setHidden:YES];
		[dim2Field setHidden:YES];
The program recognizes that shapeButton.indexOfSelectedItem does equal 1(or whatever the value is), but doesn't have any effect on the label and textField. I've checked my XIB file, and all the connections are there, but the code just isn't making the connections.

Anyone got any ideas what's wrong here?
BadWolf13 is offline   0 Reply With Quote
Old Feb 20, 2012, 12:25 AM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
Run your program. Set a breakpoint at the if. When the breakpoint is hit, are any or all of dim1Label, dim2Label, dim2Field null?

You can discover this using NSLog, too, but if you don't know how to use the debugger to set breakpoints and inspect variables, now's a good time to learn.
chown33 is offline   0 Reply With Quote
Old Feb 20, 2012, 06:15 PM   #3
BadWolf13
Thread Starter
macrumors 6502
 
Join Date: Dec 2009
There are no nulls in any of the IBOutlets.
BadWolf13 is offline   0 Reply With Quote
Old Feb 20, 2012, 07:12 PM   #4
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by BadWolf13 View Post
There are no nulls in any of the IBOutlets.
So how do you know that?

You're very sparse with details. Your code isn't working because you are doing _something_ wrong, and most likely it is some area in the code that you think is perfectly fine.
gnasher729 is offline   0 Reply With Quote
Old Feb 20, 2012, 07:45 PM   #5
BadWolf13
Thread Starter
macrumors 6502
 
Join Date: Dec 2009
Yeah, I just figured out the problem. I've got 3 custom views, and they're swappable within the program. Some of the IBOutlets, like the three that I mentioned, exist in all 3 views. The problem I'm doing is in the applicationDidFinishLaunching where I load all 3 views from their XIB files, and thus the outlet in the code is only pointing at the last XIB loaded.

My plan at this point is to load only the currently active view, and release previous view from memory.
BadWolf13 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
iMac and Battlefield 3. Wut? jimbaw iMac 151 Nov 24, 2011 11:51 AM
iphone receives calls and texts, wifi works, Apps not working on 3G JRhamish iPhone Tips, Help and Troubleshooting 2 Aug 3, 2011 11:23 PM
Erase and Install Problem, Desperate for help! imrealldum iMac 5 Mar 13, 2011 02:02 PM
Fickle playing of DVDs: some work, some don't! Macgraphix MacBook Pro 1 Apr 25, 2010 06:41 AM
Some stream, some not? Clues? Bonesone4 Apple TV and Home Theater 2 Apr 20, 2009 11:57 PM


All times are GMT -5. The time now is 09:20 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC