NSAcplication Object problematic

Coding Questions, IDE related or anything else

NSAcplication Object problematic

Postby udo.killermann » Sun Aug 01, 2010 4:54 pm

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
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: NSAcplication Object problematic

Postby berndnoetscher » Tue Aug 03, 2010 7:59 pm

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
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: NSAcplication Object problematic

Postby udo.killermann » Tue Aug 03, 2010 8:35 pm

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 656 times


Regards
Udo
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: NSAcplication Object problematic

Postby berndnoetscher » Wed Aug 04, 2010 7:22 am

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.
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am


Return to Objective-Basic (Xcode 3)

Who is online

Users browsing this forum: No registered users and 0 guests

cron