Implementing an interface |
|
Re: Implementing an interface |
|
Thank you David. Sorry about the incorrect forum and thanks for the advice!
> {quote:title=David Clegg wrote:}{quote}
> Rich Fragiacomo wrote:
>
> > How would I use this interface?
>
> Firstly, this is not the best forum to discuss this, as it is intended
> for discussions about the CodeCentral web site. In future, you may be
> better off posting your iOS questions to
> https://forums.embarcadero.com/forum.jspa?forumID=384
>
> But to answer your question, you would normally use code similar to the
> following :-
>
> uses
> FMX.MediaLibrary, FMX.Platform;
>
> {$R *.fmx}
>
> procedure TMainForm.Button1Click(Sender: TObject);
> var
> lImageManager: IFMXImageManagerService;
> begin
> if
> TPlatformServices.Current.SupportsPlatformService(IFMXImageManagerServic
> e) then
> begin
> lImageManager :=
> TPlatformServices.Current.GetPlatformService(IFMXImageManagerService)
> as IFMXImageManagerService;
> ShowMessage(Format('There are %d photos on this device',
> [lImageManager.GetCount]))
> end
> else
> Showmessage('IFMXImageManagerService not implemented');
> end;
>
>
> However in this case, you will find that you'll always get the
> 'IFMXImageManagerService not implemented' message. This is because
> there doesn't seem to be an implementation of this interface registered
> with the FireMonkey platform services.
>
> --
> Cheers,
> David Clegg
> dclegg@gmail.com
> http://cc.embarcadero.com/author/72299
> QualityCentral. The best way to bug Embarcadero about bugs.
> http://qc.embarcadero.com
>
> "Oh, yeah, what are you gonna do? Release the dogs? Or the bees? Or the
> dogs with bees in their mouth and when they bark, they shoot bees at
> you?" - Homer Simpson
|