SBApplicationController import 失敗 無法complie 拿到executable file name

以下是我最后终于搞定的解法 (卡了两天半)我不是很满意这麽繁杂的写法(尤其是那87的字元位置),但透过狗神解说,了解我自己当前的进程不可能直接呼叫SB的进程方法后,已无后路。至少拿到想要的结果,在这裡提供给各位同学参考,欢迎交流。

使用此段代码必须套用AppList相关档桉,参考网址在此:
http://iphonedevwiki.net/index.php/AppList

NSArray *sortedDisplayIdentifiers;
NSDictionary *applications = [[ALApplicationList sharedApplicationList] applicationsFilteredUsingPredicate:[NSPredicate predicateWithFormat:@"isSystemApplication = FALSE"]
onlyVisible:YES titleSortedIdentifiers:&sortedDisplayIdentifiers];

NSMutableArray *exeBundleIDArr = [NSMutableArray array];
NSEnumerator *enumerator = [applications keyEnumerator];
NSString *key;
while ((key = [enumerator nextObject])) {
    NSString *identifier = key;
    NSString *exeBundleIDPath = [ALApplicationList.sharedApplicationList valueForKey:@"path" forDisplayIdentifier:identifier];
    NSString *exeBundleIDFileName = [exeBundleIDPath substringFromIndex:87];
    NSRange r1 = [exeBundleIDFileName rangeOfString:@".app"];
    NSString *exeBundleID = [exeBundleIDFileName substringToIndex:r1.location];
    [exeBundleIDArr addObject:exeBundleID];
}

这个结果会是一个NSArray裡面拥有所有你当前安装的app store apps 的 当前executable bundle id