Open shaikshabana opened 8 years ago
You should not directly call the private Class method.You can test the code below.Create a new class and init the private class.
@interface SCApplicationWorkspace() @property (strong, nonatomic) id applicationWorkspace;
//test LSApplicationWorkspace instance method
@implementation SCApplicationWorkspace
(id)defaultWorkspace{
return nil; }
(id)applicationWorkspace{
if (!_applicationWorkspace) { //LSApplicationWorkspace Class class = NSClassFromString([@[@"L",@"S",@"App",@"lication",@"Work",@"space"] componentsJoinedByString:@""]); _applicationWorkspace = [class defaultWorkspace]; } return _applicationWorkspace; }
// { // id object = [self.applicationWorkspace allInstalledApplications]; // NSLog(@"object %@",object); //log array LSApplicationProxy // } { BOOL value = [self.applicationWorkspace applicationIsInstalled:@"com.apple.Passbook"]; NSLog(@"object %@",@(value)); //log "object 1" } { BOOL value = [self.applicationWorkspace applicationIsInstalled:@"com.apple.PassbookNULL"]; NSLog(@"object %@",@(value)); //log "object 0" } }
@end
@xl19880619
People could use comments like yours at the iPhoneDevWiki.
Great answers like these are everywhere but not enough people are contributing to nice, clean, readable docs. : /
Can any one guide me on how can i add this headers into my application and how can i use those,
for Sample please take below code as example and help to achieve this,
BOOL isInstalled = [[LSApplicationWorkspace defaultWorkspace] applicationIsInstalled:@"com.app.identifier"];
if (isInstalled) { // app is installed } else { // app is not installed }
This code is in below link, https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/MobileCoreServices.framework/LSApplicationWorkspace.h.
Can you please help me to integrate this headers,where actually i need to copy and how can i import that .h file to use method.
Please help me as soon as possible.