Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 XCode中实现FILE、LINE Visual Studio 宏的功能?重载 new 和 delete 以查找泄漏是必需的,其中包含有关在哪个文件和行中有内存分配的信息。谢谢
你试过__FILE__吗__LINE__?他们应该在 Xcode 中工作。
__FILE__
__LINE__
以下对我有用:
NSLog(@"%s %d", __FILE__, __LINE__);
您也可能会发现它也__PRETTY_FUNCTION__很有用。
__PRETTY_FUNCTION__