0

im using Delphi 10.1 Berlin

Just running the PhoneDialer sample on an IOS Phone
Embarcadero\Studio\18.0\Samples\Object Pascal\Mobile Snippets\PhoneDialer

the app is crashing on startup if i run in debug mode im getting this error


Debugger Exception Notification

Project PhoneDialer raised exception class EObjectiveC with message 'ObjectiveC class CTCallCenter could not be found'.


it looks like its happening in the
FMX.PhoneDialer.iOS unit

constructor TCocoaPhoneDialerService.Create;
begin
  FCallCenter := TCTCallCenter.Create; // <<<----- blowing up here
  FCallCenter.retain;
  FCallCenter.setCallEventHandler(DoChangeCallState);
end;

does anyone have any suggestions?
if you can get the sample to work can you include the code needed to make it happen :)

As a side note - Delphi 10.0 Seattle running the same sample seems to works fine

Dangas56
  • 849
  • 1
  • 8
  • 32
  • try to look at Tools \ Options \ Environment Options \ SDK Manager and compare to Delphi 10.0 Seattle – Passella Jun 08 '16 at 13:14
  • @Passella Can you get the sample to work in Berlin? i have done a quick compare in the SDK manager they are both using iPhoneOS9.3.sdk the berlin one does have a few extra include paths "usr/lib/clang/7.0.2" and "usr/lib/clang/7.3.0" – Dangas56 Jun 10 '16 at 04:37
  • sorry I do not have Berlin here.I thought it might be that – Passella Jun 10 '16 at 11:17

1 Answers1

0

This workaround came from Sergey Krasilnikov
you can see it here https://quality.embarcadero.com/browse/RSP-15128 if you have a login
i have not tried it yet to confirm if it works or not

Copy iOSapi.CoreTelephony.pas from
C:\Program Files (x86)\Embarcadero\Studio\18.0\source\rtl\ios
to your project folder

Modify it in the following way:

implementation

uses
  Posix.Dlfcn;

var
  CoreTelephonyModule: THandle;

const
  CoreTelephonyFwk: string =     '/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony';

and

initialization
  CoreTelephonyModule := dlopen(MarshaledAString(libCoreTelephony), RTLD_LAZY);

finalization
  dlclose(CoreTelephonyModule);

end.

Build the project again

Dangas56
  • 849
  • 1
  • 8
  • 32