我正在开发调整,但我遇到了问题。我创建了一个PreferenceBundle,在bundle中我需要调用SpringBoard方法,但结果总是null
。有没有办法可以调用SBApplication方法?
SBApplication *app =[[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:identifier];
答案 0 :(得分:3)
此链接将为您提供有关如何在iPhone中使用PreferenceBundle的一些见解......
http://www.skylarcantu.com/blog/2009/08/12/creating-a-preferencebundle-for-the-iphone/
http://iphoneincubator.com/blog/tutorial/how-to-create-an-iphone-preferences-file
编辑:
你可以尝试这段代码:
Class SBApplicationController = objc_getClass("SBApplicationController");
id controller = [SBApplicationController sharedInstance];
for (NSString *appId in [controller allBundleIdentifiers]) {
NSLog ([NSString stringWithFormat:@"bundle: %@", appId]);
NSArray *apps = [controller applicationsWithBundleIdentifier:appId];
if ([apps count] > 0) {
id app = [apps objectAtIndex:0];
[self indexApp:app withName:[app displayName]];
}
}
或尝试以下链接...