我的应用被Apple拒绝,声称它使用非公共API,错误消息是
“您的应用使用或引用了以下非公共API: PrivateFrameworks / GraphicsServices.framework(_GSFontAddFromFile),PrivateFrameworks / GraphicsServices.framework() App Store上不允许使用非公共API,因为如果这些API发生变化,可能会导致糟糕的用户体验。“
我发现我的应用使用以下代码
NSBundle *frameworkBundle = [NSBundle bundleWithIdentifier:@"com.apple.GraphicsServices"];
const char *frameworkPath = [[frameworkBundle executablePath] UTF8String];
if (frameworkPath) {
void *graphicsServices = dlopen(frameworkPath, RTLD_NOLOAD | RTLD_LAZY);
if (graphicsServices) {
BOOL (*GSFontAddFromFile)(const char *) = dlsym(graphicsServices, "GSFontAddFromFile");
if (GSFontAddFromFile) {
NSMutableDictionary *themeFonts = [[NSMutableDictionary alloc] init];
NSString *fontFileName = nil; NSString *fontFilePath = nil;
//add primary font
[self findNameOfFontFileWithType:PrimaryFont fontFileName:&fontFileName fontFilePath:&fontFilePath];
if (fontFilePath && fontFileName) {
//NSString *path = [NSString stringWithFormat:@"%@/%@", fontFilePath, fontFileName];
//newFontCount += GSFontAddFromFile([path UTF8String]);
[themeFonts setObject:[fontFileName removeExtension] forKey:IFEPrimaryFontKey];
[fontFilePath release];
[fontFileName release];
}
我无法确认这是否是应用拒绝的主要原因,因为此代码已在Apple批准的应用程序的先前版本中。请帮忙。