mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
table: TypeCategory; freetype: remove C code; [typedef] C structs;
Objective-C interfaces
This commit is contained in:
22
vlib/darwin/darwin.v
Normal file
22
vlib/darwin/darwin.v
Normal file
@ -0,0 +1,22 @@
|
||||
module darwin
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#flag -framework Cocoa
|
||||
|
||||
struct C.NSString { }
|
||||
|
||||
// macOS and iOS helpers
|
||||
fn nsstring(s string) *NSString {
|
||||
// #return @"" ;
|
||||
// println('ns $s len=$s.len')
|
||||
# return [ [ NSString alloc ] initWithBytesNoCopy:s.str length:s.len
|
||||
# encoding:NSUTF8StringEncoding freeWhenDone: false];
|
||||
return 0
|
||||
|
||||
//ns := C.alloc_NSString()
|
||||
//return ns.initWithBytesNoCopy(s.str, length: s.len,
|
||||
//encoding: NSUTF8StringEncoding, freeWhenDone: false)
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user