Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

marcmeezy

macrumors newbie
Original poster
Feb 5, 2011
5
0
How can I have an action ran at runtime instead of linking it to a click ect..?

PHP:
cellTag = [buyRadioGroup selectedRow];
	
	if (cellTag == 0) { 
			
			[dispPrice setEditable:(BOOL)flag];
			[dispPrice setDrawsBackground:[(BOOL)YES];
			 
		}

I basically have a radio button that, at run time is already selected and I need the corresponding NSTexTField to not be editable when the radio button is selected.


I found a way to do it with an if-statement and linking it to an IBAction but that is only executed by a click. :( I need it the radio button to be detected right away so that is disables the NSTextField.
 
Last edited by a moderator:
If it's a Mac app, check out either loadView or awakeFromNib. You could also just write your own method and call it before you display it from the parent.
 
=You could also just write your own method and call it before you display it from the parent.


I'm looking into those other two, thanks.

As for calling it before I display it from the parent, I've tried placing it in the main.xib file :(

Could you give me an example please?

Thanks for your help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.