[MacRuby-devel] Issues with Notifications in MacRuby

Daniel Lopes danielvlopes at gmail.com
Sun Jan 16 10:28:39 PST 2011


Hello,

I'm playing with notification in MacRuby but I don't know the behavior of the same thing in Objc is a little diferent. I believe the problem could be something related to Macruby's XCode template that don't do something that the normal cocoa do.

The app is really simple and I just created a new MacRuby app:

1º added the AddressBook framework in the target
2º in rb_main.rb I added:  framework 'AddressBook'
3º in Interface build I dropped an ABPeoplePicker
4º created an new class called PeoplePickerViewController
5º made an NSObject in IB and set the class to my new controller
6º made an outlet to the ABPeoplePicker
7º add awakeFromNib and register an observer for notification.

Everything goes and compile but the selector registered in notification is not called when user interact with ABPeoplePicker. I followed the same steps in pure Objc app and everything worked very well.

Here is my Ruby code:

https://gist.github.com/782006 (and the app http://cl.ly/42CZ)

Here is my Objc code:

https://gist.github.com/782007

Probably is something that I don't know how to do in MacRuby and is different from Objc. Someone could help?

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110116/134c6c22/attachment.html>


More information about the MacRuby-devel mailing list