nst / iOS-Runtime-Headers

iOS Objective-C headers as derived from runtime introspection
https://github.com/nst/RuntimeBrowser
7.95k stars 1.61k forks source link

Help to integrate and use headers #23

Open shaikshabana opened 8 years ago

shaikshabana commented 8 years ago

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.

xl19880619 commented 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 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

ruslan-ardashev commented 8 years ago

@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. : /