LSGetApplicationForURL() failed Error -10814
LSGetApplicationForURL() failed Error -10814
- Subject: LSGetApplicationForURL() failed Error -10814
- From: Dhiraj Bhor <email@hidden>
- Date: Sat, 27 Apr 2013 14:09:38 +0530
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.apple.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 read about Launch Services Database.
Now i am seeking for a solution to get default browser name.
Is there no other way to get default browser name?
If any other way provide me some help.
Suggestions are welcome.
Thanks in advance,
Dhiraj
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden