4
Delphi OSX单元中是否有NSLog声明?我未能在Firemonkey应用程序中找到OutputDebugString的替代值。用于MacOS的Delphi的OutputDebugString()
最终的解决方案是这样的:
/// <remarks>
/// Output debug string. Output debug string can be seen in Delphi
/// View|Debug Windows|Event Log or with 3-rd party programs such as
/// dbgview.exe from SysInternals (www.sysinternals.com)
/// </remarks>
procedure ODS(const Text: string);
begin
{$IFDEF MACOS}
// http://stackoverflow.com/questions/12405447/outputdebugstring-with-delphi-for-macosunit unt_Debug;
Log.d(Text);
{$ENDIF}
{$IFDEF LINUX}
__write(stderr, AText, Length(AText));
__write(stderr, EOL, Length(EOL));
{$ENDIF}
{$IFDEF MSWINDOWS}
OutputDebugString(PWideChar(Text));
{$ENDIF}
end;
基于['这个答案'](http://stackoverflow.com/a/10287822/960757),将不可能像[['此处显示]](http:///community.freepascal.org:10000/bboards/message?message_id=397175&forum_id=24111)在第9点?这只是一个疯狂的猜测,我完全没有办法与OSX。 – TLama