Q:

(NSString *) it's in pascal a pointer or a NSString?

I have a doubt, on this function :
- (instancetype)initWithCenter:(CLLocationCoordinate2D)center
                            radius:(CLLocationDistance)radius
                        identifier:(NSString *)identifier;

In pascal, does the identifier:(NSString *)identifier must be converted as Pointer or NSString ? 
in the delphi source code, this function is converted like this :
function initWithCenter(center: CLLocationCoordinate2D; radius: CLLocationDistance; identifier: NSSTRING): Pointer; cdecl;

however when i use it i have an AV under ios 10 (but it's work on ios 9) :(
If i replace NSString by Pointer then it's work on IOS 10 but i don't understand why ...
NOTE: it's very strange because in delphi every (NSString *) are translated as NSString and it's work fine EXCEPT for CLRegion.initCircularRegionWithCenter (under ios10/64bit) and i really want to know why. https://quality.embarcadero.com/browse/RSP-15717 and http://delphiworlds.com/2016/07/region-monitoring-background-ios/

A:

It is an Objective-C bridge problem, it is working fine for 32-bit support, the header translation of CLRegion is correct. The problem is that the bridge is not correctly working for 64-bit support, the Objective-C Runtime ABI is different for 32-bit and 64-bit supports. For purposes of clarification, the correct usage is NSString :), the bridge will take care of extract the handle (the pointer to the object created by the Objective-C Runtime) for you, it is the info which is passed to the Objective-C Runtime, in the current design, the handle extraction is done by:
Handle := (DelphiObject as ILocalObject).GetObjectID

or calling the below function from Macapi.Helpers.pas:
function NSObjectToID(const AObject: NSObject): Pointer;

The suggestion from Dave Nottage works because you are now bypassing the work of the bridge of extracting the handle and are passing it directly. It is exactly the point where the bridge is failing at its job. We don't need to go to low-level Pointer type here, for our bridge, the Delphi equivalent to Objective-C's NSString * is the NSString interface. 
For more details, please see (https://quality.embarcadero.com/browse/RSP-15717). Thank you :)

