It's the destructor in NSObject that causes the problem. I'll take a look. Remove that and your example will work, after you import the missing "foundation.runtime" in "app".

Once again, thank you very much for your help! It works now with the new @selector style, and I would had the biggest problems finding out that it was the destructor making dmd bail out a -11.


---

I just report another finding here. It's about properties and NSStrings. So far, it was possible to set the strings of an alert like this (source copied from the Chocolat example):

auto alert = new NSAlert ;
alert.messageText = "Want Chocolate?" ;
alert.informativeText = "Chocolate is sweet." ;

This now needs to be written like this:

auto alert = new NSAlert ;
alert.setMessageText("Want Chocolate?") ;
alert.setInformativeText("Chocolate is sweet.") ;

In the NSAlert class, the respective code is:

extern (Objective-C)
class NSAlert : NSObject {
  @property {
    NSString messageText() ;
void setMessageText(NSString text) @selector("setMessageText:") ;
                
   NSString informativeText() ;
void setInformativeText(NSString text) @selector("setInformativeText:") ;
  }
}

Of course, the property read/write access style is again just a convenience, but for somebody coming from Objective-C, it is "natural" to do it either way.

Reply via email to