Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Simran123

macrumors newbie
Original poster
Jun 21, 2012
2
0
Hi,

I have used "_LSCopyAllApplicationURLs" to get all Applications present in Mac OS.

My sample enumerates application after particular period. If machine is ON for 1/2 days, it gets following crash on Mac OS 10.8.3.

--------------------------------------------------------------

Exception Type: EXC_BAD_ACCESS (SIGBUS)

Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
.
.
.
........
CFDictionaryGetValue + 18

1 com.apple.LaunchServices 0x96575747 _LSAppInfoCheckVersion(__CFDictionary const*, __CFString const*, unsigned long long) + 30

2 com.apple.LaunchServices 0x96576c76 _LSRegisterBundleNode(LSContext*, unsigned long, FSNode*, FSNode*, unsigned long, unsigned long*) + 2164

3 com.apple.LaunchServices 0x9650d559 _LSFindOrRegisterBundleNode + 935

4 com.apple.LaunchServices 0x965758d6 _LSRegisterNode + 96

5 com.apple.LaunchServices 0x96515dcc _LSBundleCopyOrCheckNode + 1252

6 com.apple.LaunchServices 0x96562e5f _LSCopyAllApplicationURLs + 2
---------------------------------------------------------------

- If anyone gone through same issue, please guide me.
- Is it safe to use "_LSCopyAllApplicationURLs” in project"?


Thanks,
Simran
 
LSCopyAllApplicationURLs is a private function; this means that Apple doesn't want you to use it, as it might be removed, is undocumented, and may change between OS revisions.

The best replacement I can think of is to use NSBundle's allBundles class method, then filter out all bundles that don't end with .app.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.