Delphi IOS class_addMethod
2024-08-27 18:30:37
class_addMethod
学习FMX.Platform.iOS.pas文件的处理办法
d:\program files (x86)\embarcadero\studio\17.0\source\fmx\FMX.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@:@@');
最新文章
- Oracle数据库坏块的恢复
- 【BZOJ-3450】Tyvj1952Easy 概率与期望DP
- 第五章:javascript:队列
- 从eclipse到Android studio/迁移eclipse的Android项目到Android studio平台的注意事项
- Monkey学习(4)简单测试实例
- poi实现Excel比较
- 随手记录一个 firefox的backgroundPostion-x和-y的问题
- 在慕课学习Bootstrap
- Poj 1328 / OpenJudge 1328 Radar Installation
- 应用SecureCRT(发送接收文件)
- Hash表题目整数hash-HDOJ1425(转载)
- 2014-7 Andrew Ng 自动化所报告听后感
- SqlBulkCopy 批量insert
- 用python实现一个小游戏——抽牌
- IIS 配置 HTTPS
- Laravel-mix 中文文档
- BZOJ 3171 循环格 最小费用流
- ubuntu18.04系统安装+基本环境配置【原创】
- Windows Redis安装,Java操作Redis
- GPU的历史:从固定管线到可编程管线再到通用计算平台