2

I'm trying to add my own Objective-C framework to a python project using pyobjc. The thing is, when I try and call functions with passed by value parameters (haven't tried by reference) it moans and gives me

"AttributeError: No attribute function_with_param".

Does anyone know why this error is happening? Bare bones code of what I'm doing in python is below. I'm probably being blind, but I haven't found anything on how to do this anywhere. If anyone can help it'd be awesome! :)

import objc

bundle = objc.loadBundle("OBJC", globals(),
    bundle_path=objc.pathForFramework('OSX/OBJC.framework'))

OBJC.function_with_param('a')
OBJC.function_without_param()

Ps. Sorry for the formatting in advance. Never done this before..!

1
  • Did you generate metadata for your ObjC code? Commented Aug 24, 2014 at 18:40

1 Answer 1

1

Turns out I was missing an underscore, it works when you do this:

OBJC.function_with_param_('a')

Found it here: http://lists.stat.ucla.edu/pipermail/computing/attachments/20050825/f9a98389/attachment.pdf

Sign up to request clarification or add additional context in comments.

2 Comments

If this is true, then that must be a method, not a function.
Yes, sorry! I should have specified that, oops! Thanks for your answer by the way!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.