Make a Go Interface instead of a struct for top level objects.
Use a new struct Id as a concrete version of that type.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gitlab.wow.st/gmp/nswrap/examples/foundation/ns"
|
||||
)
|
||||
|
||||
func main() {
|
||||
n1 := ns.StringWithUTF8String(ns.CharFromString("hi there"))
|
||||
c1 := n1.CapitalizedString()
|
||||
gs := c1.UTF8String().String()
|
||||
fmt.Println(gs)
|
||||
a := ns.ArrayWithObjects(n1)
|
||||
_ = a
|
||||
}
|
||||
@@ -18,5 +18,11 @@ struct stru {int a,b;};
|
||||
- (int) hi2:(struct stru*)in;
|
||||
- (struct stru) nstru1;
|
||||
- (struct stru*) nstru2;
|
||||
- (void) hi:(id)in;
|
||||
- (void) hi3:(id)in;
|
||||
@end
|
||||
|
||||
@interface ClassTwo : ClassOne
|
||||
{ }
|
||||
- (ClassTwo*) init;
|
||||
@end
|
||||
|
||||
@@ -54,6 +54,19 @@
|
||||
ret->b = 10;
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (void) hi:(id)in
|
||||
{
|
||||
NSLog(@"hi");
|
||||
}
|
||||
- (void) hi3:(id)in
|
||||
{
|
||||
NSLog(@"hi");
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ClassTwo
|
||||
- (ClassTwo*) init
|
||||
{
|
||||
return [super init];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Package = "ClassOne"
|
||||
InputFiles = [ "ClassOne/simple.h" ]
|
||||
Classes = [ "ClassOne" ]
|
||||
Classes = [ "ClassOne","ClassTwo" ]
|
||||
Imports = [ "simple.h" ]
|
||||
|
||||
Reference in New Issue
Block a user