Bridge and Bridge Transfer

How in C# do I do the equivalent of bridge and bridge transfers for Cocoa?

e.g.

NSString* mystring = (__bridge_transfer NSString*) ABRecordCopyValue(recordref, kABPersonFirstNameProperty);

Cheers,
Matt

Use the global “bridge” function: http://www.elementswiki.com/en/Bridge-T_(Compiler_Magic_Function)

var mystring = bridge<NSString>(ABRecordCopyValue(recordref, kABPersonFirstNameProperty), BridgeMode.Transfer);

Is that valid for C#?

Cheers,
Matt

should be. It’s a compiler intrinsic we expose for the Nougat target.

Excellent, I’d read the Oxygene wiki but didn’t expect that the same would work for C#.

Just tried it and it works great, thank you!

Matt