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@:@@');
  • 相关阅读:
    flex布局
    input框不能输入问题
    JS的innerHTML完成注册表
    CSS的z-index属性和box-shadow属性
    JS个人笔记
    css照片墙
    透明度设置
    a标签的name属性
    iframe标签
    title属性
  • 原文地址:https://www.cnblogs.com/cb168/p/5114164.html
Copyright © 2011-2022 走看看