+ (NSString *)getAccountId
{
#if __has_include(<Center/Center.h>)
return userInfo.accountId;
#else
return nil;
#endif
}
使用__has_include来检查项目是否引入某个类
最新推荐文章于 2025-04-22 11:20:07 发布
这段Objective-C代码展示了如何在条件编译下获取accountId。如果包含`Center/Center.h`头文件,则返回userInfo的accountId;否则返回nil。
2140

被折叠的 条评论
为什么被折叠?



