Hi, how to add activity indicator for this code i want to view activity indicator when copying the file until finish then give uialertview thank you.
Code:
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = [paths objectAtIndex:0];*/
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *cachePath = [paths objectAtIndex:0];*/
NSError *error;
NSString *txtPath = [documentsDirectory stringByAppendingPathComponent:@"track.mp3"];
if ([fileManager fileExistsAtPath:txtPath] == NO) {
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"track" ofType:@"mp3"];
[fileManager copyItemAtPath:resourcePath toPath:txtPath error:&error];
Last edited: