在需要之前,必须从模块'Darwin.POSIX.sys.xattr'导入'setxattr'声明

Moa*_*eed 1 objective-c armv7 ios arm64

代码在armv7上运行正常但是为arm64编译抛出这个"声明''setxattr'必须在模块'Darwin.POSIX.sys.xattr'之前导入才需要"错误.

u_int8_t b = 1;
    setxattr([path fileSystemRepresentation],
             "com.apple.MobileBackup", &b, 1, 0, 0);
Run Code Online (Sandbox Code Playgroud)

任何帮助PLZ?

Moa*_*eed 10

我找到了解决方案.包括#include <sys/xattr.h>在课堂上