New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS Development Discussion on developing apps for the iOS platform.

Retrive Apps name in iphone device

Post Reply New Thread Subscribe

Thread Tools

Member Since: Oct 01, 2012
Posts: 27
manga is on a distinguished road

manga is offline

I write bellow code to get apps which are installed in iPhone device.But it works on iOS5.1.1 not works on iOS6.1.3.

Code is:

 BOOL isDir= NO;
    NSMutableArray *applicationsArray=[[NSMutableArray alloc]init];
    NSDictionary *user, *system;
    static NSString *const cacheFileName = @"";
    NSString *relativeCachePath = [[@"Library" stringByAppendingPathComponent: @"Caches"] stringByAppendingPathComponent: cacheFileName];
    NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent: @"../.."] stringByAppendingPathComponent: relativeCachePath];
    if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && !isDir)
        NSDictionary *cacheDict    = [NSDictionary dictionaryWithContentsOfFile: path];
        user = [cacheDict objectForKey: @"User"];
        system=[cacheDict objectForKey:@"System"];
    NSArray *arr1=[[NSArray alloc] initWithArray:[system allKeys]];
    for (int i=0; i<[[system allKeys] count]; i++) {
        [applicationsArray addObject:[[system valueForKey:[arr1 objectAtIndex:i]] valueForKey:@"Path"]];
    NSArray *arr2=[[NSArray alloc] initWithArray:[user allKeys]];
    for (int i=0; i<[[system allKeys] count]; i++) {
        [applicationsArray addObject:[[user valueForKey:[arr2 objectAtIndex:i]] valueForKey:@"Path"]];
   for (int i=0; i<applicationsArray.count; i++)

        NSArray *arr3=[[applicationsArray objectAtIndex:i] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
        NSArray *arr4=[[arr3 lastObject] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]];
        NSMutableDictionary *dict=[[NSMutableDictionary alloc]init];
        [dict setValue:[arr4 objectAtIndex:0] forKey:@"appName"];
        [dict setValue:@"1" forKey:@"State"];
        [self.tableViewArray addObject:dict];

Please help me out ,how to get app name in iOS6.1.3

Thanks &Regards,
QUOTE Thanks

Raz0rEdge's Avatar
Member Since: Jul 17, 2009
Location: MA
Posts: 8,133
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
How does this fail in iOS 6?


Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
Mark FX

Mark FX's Avatar
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 180
Mark FX has a spectacular aura about

Mark FX is offline
Sandboxing was introduced from iOS6 and onwards, so you're code won't work for that reason in iOS6.
You can only access information and data from you're own Apps sandbox only, as as fare as I know there's
no way to do what you want in the iOS6 system.

But I'll look into it a bit more, and report back if I can work out a way to do it.

Regards Mark
QUOTE Thanks

Post Reply New Thread Subscribe

« How to from viewController to NavigationController? | How to send an xml as a string in iphone sdk? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 03:56 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?