With XCode a lot of *NSObject are used. In oxygene I have to write ^NSObject which seems to be unfamiliar. In Pascal all the TObject were pointer so I am not sure, am I creating a pointer to a pointer here?
(I am sorry, I do not find the internals on docs.elementscompiler.com)
The problem I also have is that I cannot directly convert a CFString to a NSString which is supposed to work “toll free”, meaning they are the same. But since a CFStringRef is a Void * I cannot assign it to an object and have to call CFBridgingRelease( myCfStringRef ) to get a string. Is this the correct solution or should it work differently? CFString is not defined at all in Oxygene, just the CFStringRef is.
Further more: does
var s : String;
actually create a “NSString” and is the equivalent to
var s : NSString := new NSString;
It is all a bit unclear to me and I do not find such internals on the docs.elementscompiler wiki. The old wiki seems to be offline now and links to it are broken.
NSObject is a class, so in Oxygene it doesn’t use the pointer syntax, ie if you have NSObject* on the ObjC side, you use NSObject on the Oxygene side.
CFString is an anonymous structure in objc, CFStringRef is a pointer to it. You can’t really use CFString directly (in either ObjC or Elements) instead you use a pointer to it (CFStringRef). To bridge it to an NSString you can use the bridging functions.
Yes, String maps to NSString. But all types default to nil, so it’s not equivalent to new NSString.