Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:10:14+00:00 2026-06-13T07:10:14+00:00

iOS 6, iPhone 5, Xcode 4.5 I have an app that let users download

  • 0

iOS 6, iPhone 5, Xcode 4.5

I have an app that let users download files from internet to documents folder, then populate them into an array then to a tableview. With iOS 5, my array and tableview automatically update with this code in viewWillAppear:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSArray *dataArray = [[NSBundle bundleWithPath:[paths objectAtIndex:0]] pathsForResourcesOfType:@"mp3" inDirectory:nil];

With iOS 6, I notice that the documents folder doesnt update itself when new files added/deleted, unless I quit the app (quit from multitasking at bottom) and reopen it, then it will reload the new data from documents folder.

Even when my app load viewWillAppear with the same code above, the data is still old. Seems like iOS 6 has a cache for documents folder now, and the cache doesnt update until app is restarted!

It worked perfectly fine in iOS 5.

Thanks for reading and helping 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:10:15+00:00Added an answer on June 13, 2026 at 7:10 am

    You should not use NSBundle to access files in the documents directory. Instead use NSFileManager:

     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString* path = [paths objectAtIndex:0];
     NSError* error;
     NSFileManager* fm = [NSFileManager defaultManager];
    
     for(NSString* filename in [fm contentsOfDirectoryAtPath:path error:&error]) {
        if([filename hasSuffix:@"mp3"]) {
          NSString *filePath = [path stringByAppendingPathComponent:filename];
          [_filelist addObject:filePath];
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating an iPhone app (Xcode 4.3.1, IOS 5) that could use Bluetooth
I'm trying to create an iOS (iPhone specific) app where users have to authenticate
I am writing an iOS app for the iPhone in Xcode and I have
I have a Universal iOS app that loads certain pages into the UIWebView for
Currently, I have an iPhone app published in AppStore. I've developed it using XCode
I have an app prototype that was working on Iphone4 + iOS 4.3, build
I have a 3.1 xcode project that has been running my app just fine
I have an app for the iPhone developed on XCode 4. It works correctly
I have a very strange bug in a shipping iPad/iPhone app that I can't
I have a simple iPhone App that uses an NSLog and several printf statements.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.