I hope it's even possible.
I've got code to load really big file (dictionary) after app started:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSString *filePath = [NSString stringWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:@"en_US" ofType:@"txt"]
encoding:NSUTF8StringEncoding error:nil];
dictionary = [NSSet setWithArray:[NSArray arrayWithArray:
[filePath componentsSeparatedByCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]]]];
}
Also I've got proper code in viewDidLoad
:
- (void)viewDidLoad {
[super viewDidLoad];
self.progressView.progress = 0.0;
[self performSelectorOnMainThread:
@selector(applicationDidFinishLaunching:)
withObject:nil
waitUntilDone:NO];
}
But I've got not a clue how to force UIProgressView
to show progress of creating NSSet
dictionary
from an NSArray
. It takes few seconds in iOS Simulator, so on device it can take over a dozen. I really need to show progress, and I prefer this way than Activity Indicator View.
I'm interested in how to get count of imported items at the moment (count of all items is known).
Any idea? :)