mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
25 lines
483 B
D
25 lines
483 B
D
module test16096a;
|
|
|
|
import core.attribute : selector;
|
|
|
|
extern (Objective-C)
|
|
interface Class
|
|
{
|
|
NSObject alloc() @selector("alloc");
|
|
}
|
|
|
|
extern (Objective-C)
|
|
interface NSObject
|
|
{
|
|
NSObject initWithUTF8String(in char* str) @selector("initWithUTF8String:");
|
|
void release() @selector("release");
|
|
}
|
|
|
|
extern (C) Class objc_lookUpClass(in char* name);
|
|
|
|
void test()
|
|
{
|
|
auto c = objc_lookUpClass("NSString");
|
|
auto o = c.alloc().initWithUTF8String("hello");
|
|
o.release();
|
|
}
|