IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label LSGetApplicationForURL. Show all posts
Showing posts with label LSGetApplicationForURL. Show all posts

Monday, April 22, 2013

LSGetApplicationForURL() failed

Hi,

I am developing an application tool that requires a function which will give me users default browser name.

I have code as below

 

     FSRef appRef;

     CFURLRef inUrl;

     OSStatus status;

     CFStringRef urlString;

     CFURLRef appUrlRef;

     CFStringRef defBrowserName;

 

     cfURLStr = CFStringCreateWithCString(kCFAllocatorDefault, "http://www.quickheal.com", kCFStringEncodingUTF8);

     if (NULL == urlString)                                exit(-1);


  inUrl = CFURLCreateWithString(NULL, urlString, NULL);

     status = LSGetApplicationForURL(inUrl, kLSRolesEditor, &appRef, &appUrlRef);

     if (noErr != status)     {  CFRelease(inUrl);           CFRelease(urlString); exit(-1);  }

 

     defBrowserName = CFURLCopyLastPathComponent(inUrl);

NSLog(@"Here is Default Browser Name %@", (NSString *)defBrowserName);

 

This code works well when i am normal user. But when i ran same code as super user, it give me error

that


LSGetApplicationForURL() failed. Error:(-10814)

 

Why this happened?

I am waiting for some quick replies which i had not got last time.

Thanks in advance,

Dhiraj



View the original article here

Re: LSGetApplicationForURL() failed

Please correct me if i am wrong my friend.Actually i started searching from this link before you posted.

And i got what are different error codes but not actual simple philosophy that i required.Can you simplify that if you think to help.Suggestions are welcome.I never ignored them till date.


View the original article here