Globals and [Cocoa] classes, yes. and later [Swift] ones. Island classes of course Onjective-C he’s no idea what to do with; this should not show up in the header (if they do let me known that’s a bug; funnily I just thought about verifying this myself, just yesterday)…
Hard do say without more info. if they use NSString, then yes. if they use Island String, they probably shouldn’t be epxosed at all.
For a start the generated output doesn’t seem right because Im trying to use a header file in an xcode watch os project and I needed to change the output from
- (String * _Null_unspecified)someMethod:(Void);
to
-(NSString*) someMethod;
to build in xcode.
If I have a cocoa class ie a class marked with the Cocoa attribute should a String be generated as NSString or do I have to do that myself ?
OxyLibrary is a multi target, dynamic is dynamic and Static is a static library.
The model off the class has nothing to do with it. What “String” means depends on your uses clause and default object model.
In an Island project with default object model of Island (the default), “String” will be an IslandString (RemObjects.Elements.System.String).
In a Toffee project, a ToffeeV2 or an Island project with default object model set to “Cocoa”, it will be CocoaString, ie Foundation.NSString.
Classes in one model can take and return classes from another, so in
[Cocoa]
SomeClass = public class
public
property someProperty:Boolean;
method someMethod:String;
begin
exit 'HelloWorld';
end;
someMethod will return Ann IslandString, not an NSString. As such, it will be callable but useless for Objective-C, as Objective-C cannot handle the result pointer (and does indeed not know what “String” is.
So String will be whatever String is, no matter what object type you’re in. its just a type name. You could define “type String = public Boolean” further up, and now String is “DynamicLibrary.String”, which is an alias to Boolean ;).
As an aside, this part seems like an unrelated bug:
Thanks. I regenerated a header file and the only issue I had was string. I had a number of places where it used PlatformString and others where it used String. There are also places where it misses the *
I just went through and changed everything to NSString * Im not really sure what the best strategy is because my library compiles for .net, island and toffee.
It seems to handle List<> properly that is changed to NSMutableArray. In header file generation can PlatformString be changed to NSString ?