2010-06-28 91 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]; 
} 

我采取链接到从定义的类应用程序足以加载包含类的包。