timburks/nu — Issue #30: Can't Bridge This Return Type Yet Error
Author: sorin-ionescu
Created: 2012-01-07 06:54:56+00:00
State: open

In the code bellow, Nu does not like `printSongInformation: (NSNotification) notification`. However, if I change it to `printSongInformation: (id) notification`, it works fine. `(puts (notification class))` prints **__CFNotification**. I am using version **2.0.1**.

```
2012-01-07 01:45:29.119 nush[63156:d07] I can't bridge this return type yet: (NSNotification) ()
Nu uncaught exception: NSInvalidArgumentException: NSGetSizeAndAlignment(): unsupported type encoding spec '?' at '?' in '?'
from ./iTunes.nu:8: in -
from ./iTunes.nu:7: in class
from /Library/Frameworks/Nu.framework/Resources/help.nu:136: in progn
```

```lisp
#!/usr/bin/env nush

(load "Nu")
(load "Foundation")
(load "Cocoa")

(class ApplicationDelegate is NSObject
(- (void) printSongInformation: (NSNotification) notification is
(set information (notification userInfo))
(puts "track information: #{(information description)}"))

(- (void) applicationDidFinishLaunching: (id) sender is
(set dnc (NSDistributedNotificationCenter defaultCenter))
(dnc
addObserver:self
selector:"printSongInformation:"
name:"com.apple.iTunes.playerInfo"
object:nil)))

(set delegate ((ApplicationDelegate) alloc) init)
((NSApplication sharedApplication) setDelegate:delegate)
((NSApplication sharedApplication) run)
```