how to register an observer

Coding Questions, IDE related or anything else

how to register an observer

Postby udo.killermann » Fri Dec 10, 2010 8:43 am

Bernd,

how can I register an observer via ObjB? I see the the event "ObserveValueForKeyPath" but I don't find a way to relate a property to this event.

I have achieved to register an observer using vanilla Cocoa API through Declare but would like to do it the intended way.

Thanks for your help,
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: how to register an observer

Postby berndnoetscher » Fri Dec 10, 2010 10:07 am

udo.killermann wrote:Bernd,

how can I register an observer via ObjB? I see the the event "ObserveValueForKeyPath" but I don't find a way to relate a property to this event.

I have achieved to register an observer using vanilla Cocoa API through Declare but would like to do it the intended way.

Thanks for your help,
Udo


Udo,

there is no documentation about it in objb yet.
But take a look at objb's NSObject documentation. There are several functions:


AddObserver(..), RemoveObserver(...), WillChangeValueForKey and so on

Some links to external info:

http://cocoawithlove.com/2008/06/five-a ... rving.html

http://stackoverflow.com/questions/3018 ... alueforkey

If you need some help, please let me know.
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: how to register an observer

Postby udo.killermann » Fri Dec 10, 2010 1:20 pm

Bernd,

the current HTML documentation doesn't tell anything about the mentioned subs and neither does the code completion. How would one know these things? I did a search for "observ" prior to my post and all I got was the mentioned event.

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: how to register an observer

Postby berndnoetscher » Wed Dec 15, 2010 12:14 pm

udo.killermann wrote:Bernd,

the current HTML documentation doesn't tell anything about the mentioned subs and neither does the code completion. How would one know these things? I did a search for "observ" prior to my post and all I got was the mentioned event.

Regards
Udo


Udo,

sorry my mistake. I fought I did implement those functions, but as I checked again. There are not implemented completely yet. Your option is now to wait for the official support or stick to the Cocoa API directly. Sorry again.
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 1 guest

cron