zoukankan      html  css  js  c++  java
  • Delphi IOS class_addMethod

    class_addMethod  

     学习FMX.Platform.iOS.pas文件的处理办法

    d:program files (x86)embarcaderostudio17.0sourcefmxFMX.Platform.iOS.pas

    performFetchWithCompletionHandler

    procedure performFetchWithCompletionHandler(self : id; _cmd : SEL; application: PUIApplication; handler : id );
    var
      ahandlerimp: IMP;
    begin
      //Code to perform fetch HERE!!!!
      fecth_string_test := 'entered background code!!';
    
      ahandlerimp := imp_implementationWithBlock( handler ); //Create c function for block
      ahandlerimp(self,_cmd, UIBackgroundFetchResultNewData); //Call c function, _cmd is ignored
      imp_removeBlock(ahandlerimp); //Remove the c function created two lines up
    end;

      

    class_addMethod(objc_getClass('DelphiAppDelegate') ,
    sel_getUid('application:performFetchWithCompletionHandler:'),
    @performFetchWithCompletionHandler,
    'v@:@?');

     applicationDidReceiveLocalNotification

    procedure applicationDidReceiveLocalNotification(self: id; _cmd: SEL;
    application: PUIApplication; notification: Pointer);
    begin
        ShowMessage('it works');
    end;
    class_addMethod(objc_getClass('DelphiAppDelegate'), sel_getUid('application:didReceiveLocalNotification:'),
    @applicationDidReceiveLocalNotification, 'v@:@@');
  • 相关阅读:
    NFS共享储存
    Rsync服务
    企业集群架构概述
    定时任务
    开机启动流程
    进程管理(二)
    linux系统管理-进程管理
    RAID&LVM有关磁盘的故障
    gdisk分区及swap分区
    操作系统与磁盘管理
  • 原文地址:https://www.cnblogs.com/cb168/p/5114164.html
Copyright © 2011-2022 走看看