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

aarplane

macrumors newbie
Original poster
Dec 8, 2005
12
0
Canada
Hi folks,

I can't seem to get my program to work when I add the awakeFromNib function to my code.

Code:
    def awakeFromNib(self):
	self.someButton.setEnabled_(0)
	
    @objc.IBAction
    def doSomething_(self, sender):
	self.someButton.setEnabled_(1)

It just exits with code 5. No warnings or alerts. The main window doesn't pop up. Yet, when I remove the awakeFromNib, the program runs perfectly (minus the error this is intended to fix).
 

aarplane

macrumors newbie
Original poster
Dec 8, 2005
12
0
Canada
Are you sure someButton is a valid object at that point? That's the first thing I'd check.
Yes it is. I changed the setEnabled to 0 when I click run the action doSomething, and it effectively disabled someButton.
 

aarplane

macrumors newbie
Original poster
Dec 8, 2005
12
0
Canada
[RESOLVED]

Turns out I had an IndentationError. I should have told xCode to use spaces instead of tabs for indentation.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.