Page 1 of 1

NSAcplication Object problematic

PostPosted: Sun Aug 01, 2010 4:54 pm
by udo.killermann
Bernd,

I would like to extend the methods of NSApplication instances (see reference):

Code: Select all
Declare Function "NSApplication" - (void)setServicesProvider:(id)aProvider


After this declaration NSApplication is synonym for the global NSApplication object of OB and the class and its methods as well. If I now try to call NSApplication.setServicesProvider() the latter is compiled and it fails on runtime because the message gets send to the class and not the instance. So my wish would be that the Object be called NSApp and the class is left as such.

Kind regards
Udo

Re: NSAcplication Object problematic

PostPosted: Tue Aug 03, 2010 7:59 pm
by berndnoetscher
udo.killermann wrote:Bernd,

I would like to extend the methods of NSApplication instances (see reference):

Code: Select all
Declare Function "NSApplication" - (void)setServicesProvider:(id)aProvider


After this declaration NSApplication is synonym for the global NSApplication object of OB and the class and its methods as well. If I now try to call NSApplication.setServicesProvider() the latter is compiled and it fails on runtime because the message gets send to the class and not the instance. So my wish would be that the Object be called NSApp and the class is left as such.

Kind regards
Udo



Thanks for the questions.
It was a bug and I fixed this in the new version. It will work now with

Code: Select all
NSApplication.setServicesProvider(someid)


Make it a sub:

Code: Select all
Declare Sub "NSApplication" - (void)setServicesProvider:(id)aProvider

Re: NSAcplication Object problematic

PostPosted: Tue Aug 03, 2010 8:35 pm
by udo.killermann
Bernd,

did you already release the version you refer to? With the latest version you provided for download (06-22-2010) it doesn't work as described.

What I get is:
invalidArgument.jpg
invalidArgument.jpg (31.41 KiB) Viewed 653 times


Regards
Udo

Re: NSAcplication Object problematic

PostPosted: Wed Aug 04, 2010 7:22 am
by berndnoetscher
udo.killermann wrote:Bernd,

did you already release the version you refer to? With the latest version you provided for download (06-22-2010) it doesn't work as described.

What I get is:
invalidArgument.jpg


Regards
Udo


No, new version is coming this week. Sorry.