2010-06-28 21 views

回答

0

綜觀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]; 
} 

我採取鏈接到從定義的類應用程序足以加載包含類的包。

相關問題