アプリケーションクラスをf-scriptにリンクする方法
-
01-10-2019 - |
解決
fscript.appのコードを見ると、これはほとんどのコアフレームワークのほとんどにリンクされていると報告されています。次の方法が見つかりました。
- (void)loadSystemFrameworks // Contributed by Cedric Luthi
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *systemFrameworksPaths = [NSMutableArray arrayWithObject:@"/System/Library/Frameworks"];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"FScriptLoadPrivateSystemFrameworks"])
[systemFrameworksPaths addObject:@"/System/Library/PrivateFrameworks"];
for (NSString *systemFrameworksPath in systemFrameworksPaths)
{
for (NSString *framework in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:systemFrameworksPath error:NULL])
{
NSBundle *frameworkBundle = [NSBundle bundleWithPath:[systemFrameworksPath stringByAppendingPathComponent:framework]];
if ([frameworkBundle preflightAndReturnError:nil])
[frameworkBundle load];
}
}
[pool drain];
}
アプリケーションから定義されたクラスにリンクするために、クラスを含むバンドルをロードするのに十分です。
所属していません StackOverflow