• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Unable to attach actions in Python/Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to attach actions in Python/Cocoa


  • Subject: Unable to attach actions in Python/Cocoa
  • From: Jose R.C.Cruz <email@hidden>
  • Date: Mon, 4 Feb 2008 13:49:29 -0800

2008 Feb 04, 13:04 PST

Hello, folks.

I am using Xcode 3.0 to build a basic BMI calculator in PyCocoa. Right now, I got the following class built on Xcode.

----- START OF BMICalculate.py
from Foundation import *
from AppKit import *
import objc
class BMICalculator (NSObject):
    fld_bmi = objc.IBOutlet()

    fld_height = objc.IBOutlet()

    fld_weight = objc.IBOutlet()

    pop_height = objc.IBOutlet()

    pop_weight = objc.IBOutlet()

    @objc.IBAction
    def doCalculate_(self, sender):
	NSLog("You just clicked on the Calculate button")
----- END OF BMICalculate.py

Now, I did bind the action doCalculate to the Calculate button using Interface Builder. But when I built and run the project, I get the following errors on the Console window.

----- Start of Console messages
[Session started at 2008-02-04 12:33:07 -0800.]
2008-02-04 12:33:23.426 BMI[723:10b] Unknown class `BMICalculator' in nib file, using `NSObject' instead.
2008-02-04 12:33:23.494 BMI[723:10b] Could not connect the action doCalculate: to target of class NSObject
2008-02-04 12:33:24.516 BMI[723:10b] Application did finish launching.


The Debugger has exited with status 0.
----- End of Console messages

Am I missing something here? The steps I used to bind each field and control on the window to the class BMICalculate are the same ones I used on pure Cocoa appl. Somehow, they do not work when using PyCocoa.

Thanks for any help you can provide.

-----
J.C. Cruz
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Unable to attach actions in Python/Cocoa
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Xcode eats 100% CPU and more while typing
  • Next by Date: Code sense with C++
  • Previous by thread: Re: Xcode-users Digest, Vol 5, Issue 64
  • Next by thread: Re: Unable to attach actions in Python/Cocoa
  • Index(es):
    • Date
    • Thread