• 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
Re: Class OC_PythonObject: no such selector: _cfTypeID
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class OC_PythonObject: no such selector: _cfTypeID


  • Subject: Re: Class OC_PythonObject: no such selector: _cfTypeID
  • From: has <email@hidden>
  • Date: Fri, 4 Jun 2010 20:40:35 +0100

Jonathan Mitchell wrote:

> On occasion I see my PyObjC scripts generating the following:
>
> Class OC_PythonObject: no such selector: _cfTypeID
>
> My app executes user supplied scripts and the error appears to be generated under a number of circumstances
> including inadvertently calling an object function with the wrong number of arguments.
>
> How should this error be interpreted?
> Is it indicative solely of argument mismatch?

Hi Jonathan,

The PythonMac-SIG mailing list is the probably the best place to ask Python-/PyObjC-specific questions:

http://mail.python.org/mailman/listinfo/pythonmac-sig


> RubyCocoa is much more informative when inadvertently calling a function with the wrong argument count :
> wrong number of arguments (0 for 2)


RubyCocoa maps ObjC method names to the same Ruby method name when there are 0 or 1 args given, e.g. -foo and -foo: both map to #foo.

PyObjC, OTOH, maps -foo to foo and -foo: to foo_, so they are indeed different method names in Python.

Thus, the PyObjC 'no such selector' message is technically correct, if not overly helpful, since -foo and -foo: are different names in ObjC too.

I guess that's the nature of these bridges: it's not enough to understand how the local language (Python/Ruby) works, you need a good understanding how the target platform (ObjC runtime) and the bridge between the two environments (PyObjC/RubyCocoa) operate too. Although you could always submit a feature request asking for more 'intelligent' error reporting from the bridge in response to known common user errors such as forgetting the trailing underscore in PyObjC, e.g.: "no such selector: _cfTypeID (did you mean _cfTypeID_?)".

HTH

has
--
Learn AppleScript, 3rd edition, Sanderson & Rosenthal:
http://apress.com/book/view/9781430223610

Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Class OC_PythonObject: no such selector: _cfTypeID
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: How to specify the superview in the Interface Builder?
  • Next by Date: Newbie Question re: callback signatures
  • Previous by thread: Class OC_PythonObject: no such selector: _cfTypeID
  • Next by thread: Re: Class OC_PythonObject: no such selector: _cfTypeID
  • Index(es):
    • Date
    • Thread