DPFMapView broken after Delphi/XCode Update
Delphi iOS Native Components
Brought to you by:
b_yaghobi
I just installed Delphi XE7 Update 1. At the same time I updated XCode to 6.1/8.1 SDK.
Now, when I run the map demo application on a device or the iOS simulator I get the following error:
Project iOSMapView raised exception class SIGABRT (6).
The error originates in DPF.iOS.MKMapView at line 718 (Loaded):
FMKMapView.setFrame( CGRectMake( Position.X, Position.Y, Width, Height ) );
The actual exception is thrown in the imported setFrame function. As far as I can tell, setFrame works fine for all the other DFP components.
Anybody got a fix?
Cheers,
Paul
I stumbled across a possible fix. In the TDPFMapView constructor change:
FMKMapView := TMKMapView.Wrap( FDPFMKMapView.Super.init );
to
FMKMapView := TMKMapView.Wrap( TMKMapView.alloc.initWithFrame( CGRectMake( 0, 0, 100, 100 ) ) );
After this everything seems to work as expected.
Babak: The working line is commented out in the latest revision. Any reason why you changed it? Is it safe to go with the older code?
Babak changed it so that TDPFMKMapView will be created instead of TMKMapView.
But TMKMapView.Wrap( FDPFMKMapView.Super.init ) does not look right. It should be FMKMapView := TMKMapView.Wrap((FDPFMKMapView as ILocalObject).GetObjectID); Please take a look at my changes in SVN and let me know if that fixes it.
Thanks Sebastian, I'll try it out on Monday.
Hi Sebastian,
Unfortunately, your update re-introduces the error.
Let me know if you need any more info.
/Paul
Please give me more info. The "MapView User Location" demo works fine for me. Can you provide a demo project?
Hi Paul
Thank you for your feedback.
Solved.
Regards