为什么在iOSapi.Foundation中注释了过程NSLogv? [英] Why the procedure NSLogv is commented in iOSapi.Foundation?

查看:49
本文介绍了为什么在iOSapi.Foundation中注释了过程NSLogv?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOSapi.Foundation.pas中,我们有以下行:

in iOSapi.Foundation.pas we have this row :

//procedure NSLogv(format: PNSString; args: va_list); cdecl; external libFoundation name _PU + 'NSLogv';

为什么评论/停用它?此过程在标头中定义如下:

Why it is commented / deactivated ? This procedure is defined like this in the header :

FOUNDATION_EXPORT void NSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0) NS_NO_TAIL_CALL;

当我尝试取消注释时,出现错误:va_list未定义.如果我没有记错,va_list只是一个指针?

When i try to uncomment it, i have an error: va_list not defined. If i not make any mistake, va_list is just a pointer ?

如何调用此函数?注意:我需要调用这个确切的函数,而不是其他任何日志函数....

After how to call this function ? NB: i need to call this exact function, not any other log function ....

推荐答案

NSLogv .但是由于您不能在Delphi中编写可变参数函数,因此该方案不适用.

NSLogv exists when you need to wrap a call to NSLog with your own variadic function. But since you can't write a variadic function in Delp that scenario cannot apply.

改为致电 NSLog .这是一个外部定义的可变参数函数.尽管无法使用Delphi编写此类内容,但它可以使用它们.

Call NSLog instead. This is an externally defined variadic function. Although Delphi cannot be used to write such things, it is capable of consuming them.

有关更多详细信息,请参阅以下主题: NSLog与NSLogv之间的区别.

For more details refer to this topic: Difference between NSLog and NSLogv.

进一步阅读:

这篇关于为什么在iOSapi.Foundation中注释了过程NSLogv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆