Search Results

Search found 95 results on 4 pages for 'nsfilemanager'.

Page 1/4 | 1 2 3 4  | Next Page >

  • NSFileManager works fine on simulator but not on device

    - by Jenicek
    Hi, I have problem creating directories and files with NSFileManager on the iPhone device. My code, shown below, works fine on the simulator, but not on the device, could you please help me? Gimme some directions where the problem may be, thanks for every reply.. I'm first creating directories this way: NSFileManager *fileMgr = [NSFileManager defaultManager]; NSArray *arPaths = NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES); NSString *appPath = [[NSString alloc] init]; appPath = [arPaths objectAtIndex:0]; strDownloadsDir = [[NSString alloc] init]; strDownloadsDir = [[appPath stringByAppendingPathComponent:@"/Other"] copy]; if(![fileMgr fileExistsAtPath:strDownloadsDir]) [fileMgr createDirectoryAtPath:strDownloadsDir attributes:nil]; and then I'm trying to create new file in this directory this way: NSString *filePath = [strDownloadsDir stringByAppendingPathComponent:strDlFileName]; //Test whether this file exists, if not, create it NSLog(@"%@", filePath); if(![fileMgr fileExistsAtPath:filePath]) { if([fileMgr createFileAtPath:filePath contents:nil attributes:nil]) NSLog(@"Creating new file at path %@", filePath); else NSLog(@"Failed to create new file."); } It seems that there's something wrong with whole NSFileManager, because when I'm using fileExistAtPath with a path given by this NSArray *arPaths = NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES); NSString *appPath = [[NSString alloc] init]; appPath = [arPaths objectAtIndex:0]; it is not working too, I tried to change directory to NSDocumentsDirectory but it did not help

    Read the article

  • use of NSFilemanager

    - by mindfreak
    Hello, I am working as an Iphone developer since 5 months but never ever i have used NSfilemanager class. Apple has documentation but still i am not cleared about its use. My question is that can anybody tell me(with example) how and when to use the NSfilemanager class ? Any help will be appreciated. Thanks.

    Read the article

  • NSFileManager - Copying Files at Startup

    - by David Schiefer
    Hi, I need to copy a few sample files from my app's resource folder and place them in my app's document folder. I came up with the attached code, it compiles fine but it doesn't work. All the directories I refer to do exist. I'm not quite sure what I am doing wrong, could someone point me in the right direction please? NSFileManager*manager = [NSFileManager defaultManager]; NSString*dirToCopyTo = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString*path = [[NSBundle mainBundle] resourcePath]; NSString*dirToCopyFrom = [path stringByAppendingPathComponent:@"Samples"]; NSError*error; NSArray*files = [manager contentsOfDirectoryAtPath:dirToCopyTo error:nil]; for (NSString *file in files) { [manager copyItemAtPath:[dirToCopyFrom stringByAppendingPathComponent:file] toPath:dirToCopyTo error:&error]; if (error) { NSLog(@"%@",[error localizedDescription]); } }

    Read the article

  • Cocoa - NSFileManager removeItemAtPath Not Working

    - by Kevin
    Hey there everyone, I am trying to delete a file, but somehow nsfilemanager will not allow me to do so. I do use the file in one line of code, but once that action has been ran, I want the file deleted. I have logged the error code and message and I get error code: 4 and the message: "text.txt" could not be removed Is there a way to fix this error "cleanly" (without any hacks) so that apple will accept this app onto their Mac App Store? EDIT: This is what I am using: [[NSFileManager defaultManager] removeItemAtPath:filePath error:NULL]; Thanks, kevin

    Read the article

  • NSFILEMANAGER CRASHING IN APP DELEGATE

    - by theiphoneguy
    I have this code in a method called from applicationDidFinishLaunching. It works in the simulator, but crashes on the iPhone. There are about 1,600 2KB mp3 files being copied in this operation. If I try to instantiate the app multiple times, it will eventually copy more each time until the app eventually will start without crashing. I am releasing everything I allocate. I have about 20GB disk space free on the iPhone. If I progressively comment out code and run it on the iPhone, the copyItemAtPath seems to be the suspect. (void)createCopyOfAudioFiles:(BOOL)force { @try { NSError *error; NSString *component; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *fileManager = [[NSFileManager alloc] init]; NSEnumerator *enumerator = [[[NSBundle mainBundle]pathsForResourcesOfType:@"mp3" inDirectory:nil] objectEnumerator]; while ((component = [enumerator nextObject]) != nil) { NSArray *temp = [component componentsSeparatedByString:@".app/"]; NSString *file = [NSString stringWithFormat:@"%@", [temp objectAtIndex:1]]; NSString *writableAudioPath = [documentsDirectory stringByAppendingPathComponent:file]; BOOL success = [fileManager fileExistsAtPath:writableAudioPath]; if (success && !force) { continue; } else if (success && force) { success = [fileManager removeItemAtPath:writableAudioPath error:&error]; } success = [fileManager copyItemAtPath:component toPath:writableAudioPath error:&error]; if (!success) { @throw [NSException exceptionWithName:[error localizedDescription] reason:[error localizedFailureReason] userInfo:nil]; } } [fileManager release]; } @catch (NSException *exception) { NSLog(@"%@", exception); @throw [NSException exceptionWithName:exception.name reason:exception.reason userInfo:nil]; } @finally { } }

    Read the article

  • Can't figure out this file behavior in IOS 4.2

    - by Don Jones
    Odd behavior with file behavior. Here's the thing: I'm using the phone camera to snap a picture, and internally generating a thumbnail. I'm saving those as temp files in the Documents directory. Here's the complete code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *photo = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; photo = [self scaleAndRotateImage:photo]; // save photo NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSLog(@"Writing to %@",docsDir); // save photo file NSLog(@"Saving photo as %@",[NSString stringWithFormat:@"%@/temp_photo.png",docsDir]); [UIImagePNGRepresentation(photo) writeToFile:[NSString stringWithFormat:@"%@/temp_photo.png",docsDir] atomically:YES]; // make and save thumbnail NSLog(@"Saving thumbnail as %@",[NSString stringWithFormat:@"%@/temp_thumb.png",docsDir]); UIImage *thumb = [self makeThumbnail:photo]; [UIImagePNGRepresentation(thumb) writeToFile:[NSString stringWithFormat:@"%@/temp_thumb.png",docsDir] atomically:YES]; NSFileManager *manager = [NSFileManager defaultManager]; NSError *error; NSArray *files = [manager contentsOfDirectoryAtPath:docsDir error:&error]; NSLog(@"\n\nThere are %d files in the documents directory %@",(files.count),docsDir); for (int i = 0; i < files.count; i++) { NSString *filename = [files objectAtIndex:i]; NSLog(@"Seeing filename %@",filename); } // done //[photo release]; //[thumb release]; [self dismissModalViewControllerAnimated:NO]; [delegate textInputFinished]; } As you can see, I've put quite a bit of logging in here in an attempt to figure out my problem (which is coming up). The log output to this point is: Writing to /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents Saving photo as /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents/temp_photo.png Saving thumbnail as /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents/temp_thumb.png There are 3 files in the documents directory /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents Seeing filename temp_photo.png Seeing filename temp_text.txt Seeing filename temp_thumb.png This is absolutely as-expected. I clearly have three files on the device. Here's the very next code that operates - the code that received the textInputFinished message: - (void)textInputFinished { NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSError *error; // get next filename NSString *filename; int i = 0; do { i++; filename = [NSString stringWithFormat:@"%@/reminder_%d",docsDir,i]; NSLog(@"Trying filename %@",filename); } while ([fileManager fileExistsAtPath:[filename stringByAppendingString:@".txt"]]); NSLog(@"New base filename is %@",filename); NSArray *files = [fileManager contentsOfDirectoryAtPath:docsDir error:&error]; NSLog(@"There are %d files in the directory %@",(files.count),docsDir); This is testing to get a new, non-temp, not-in-use filename. It does that - but then it says there aren't any files in the documents folder! Here's the logged output: Trying filename /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents/reminder_1 New base filename is /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents/reminder_1 There are 0 files in the directory /var/mobile/Applications/77D792DC-A224-4A47-8A4C-BB7C557626F3/Documents What the heck? Where did the three files go?

    Read the article

  • Testing file existence using NSURL

    - by Peter Hosey
    Snow Leopard introduced many new methods to use NSURL objects to refer to files, not pathnames or Core Services' FSRefs. However, there's one task I can't find a URL-based method for: Testing whether a file exists. I'm looking for a URL-based version of -[NSFileManager fileExistsAtPath:]. Like that method, it should return YES if the URL describes anything, whether it's a regular file, a directory, or anything else. I could attempt to look up various resource values, but none of them are explicitly guaranteed to not exist if the file doesn't, and some of them (e.g., NSURLEffectiveIconKey) could be costly if it does. I could just use NSFileManager's fileExistsAtPath:, but if there's a more modern method, I'd prefer to use that. Is there a simple method or function in Cocoa, CF, or Core Services that's guaranteed/documented to tell me whether a given file (or file-reference) URL refers to a file-system object that exists?

    Read the article

  • Can't delete a file created by mkstemp() on Mac OS X

    - by splicer
    Apparently, NSFileManager is unable to delete files created by mkstemp(). Here's some test code to demonstrate this: char pathCString[] = "/tmp/temp.XXXXXX"; int fileDescriptor = mkstemp(pathCString); if (fileDescriptor == -1) { NSLog(@"mkstemp failed"); } else { close(fileDescriptor); NSURL *url = [NSURL URLWithString:[NSString stringWithCString:pathCString encoding:NSASCIIStringEncoding]]; NSLog(@"URL: %@", url); NSError *error; if (![[NSFileManager defaultManager] removeItemAtURL:url error:&error]) { NSLog(@"could not delete file: %@", error); } } Here's what I see in the log when I run the above code: URL: /tmp/temp.A7DsLW could not delete file: Error Domain=NSCocoaErrorDomain Code=4 UserInfo=0x1001108a0 "The file “temp.A7DsLW” doesn’t exist." I'm running this on Snow Leopard. Any ideas on why the problem is occurring and/or how to work around it? Thanks!

    Read the article

  • NSCFType keeps occurring, something is not being released?

    - by user1493543
    I'm attempting to delete files from the documents directory using a tableview/array combination. For some reason, my NSString pointing to the Documents directory path is being converted to a NSCFType (which after some research, I understand is happening because a variable is not being released). Because of this, the application crashes at the line NSString *lastPath = [documentsDirectory stringByAppendingPathComponent:temp]; claiming that NSCFType cannot recognize the method stringByAppendingPathComponent. I would appreciate if someone could help me out (I hope I have explained this clearly enough). - (void) tableView: (UITableView *) tableView commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath *) indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { NSString *temp = [directoryContent objectAtIndex:indexPath.row]; NSLog(temp); NSString *lastPath = [documentsDirectory stringByAppendingPathComponent:temp]; [[NSFileManager defaultManager] removeItemAtPath:lastPath error:nil]; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); documentsDirectory = [paths objectAtIndex:0]; directoryContent = [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:nil] retain]; //tableview handling below }

    Read the article

  • I need to load a video stored in Applications folder in to a UITableView ?

    - by srikanth rongali
    I need to load a video stored in Applications folder in to a table view. When I touched the cell the video plays. I used the following code to get all the video files in to an array. NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray* contents = [fileManager directoryContentsAtPath:@"/Users/srikanth/Desktop/Projects/UF/Table2/Videos"]; for(a = 1; a < [contents count]; a++) NSLog(@"Array contents: %@", [contents objectAtIndex:a]); cells = [[NSMutableArray alloc]initWithCapacity:[contents count]]; But how can I load the videos into UITableView. I used NSBundle for loading videos by giving path. It worked. But, now I need the videos to load from the array contents. When I touch the cell of the table the corresponding file from the array contents si to be loaded. How can I make it? Thank you.

    Read the article

  • Plist won't copy to documents directory

    - by John
    I have a plist file in my resources group in xcode. I am trying to copy this into my documents directory on app launch. I am using the following code (taken from a sqlite tutorial): BOOL success; NSError *error; NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingString:@"ActiveFeedsPlist.plist"]; success = [fileManager fileExistsAtPath:filePath]; if (success) return; NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingFormat:@"ActiveFeedsPlist.plist"]; success = [fileManager copyItemAtPath:path toPath:filePath error:&error]; if (!success) { NSAssert1(0, @"Failed to copy Plist. Error %@", [error localizedDescription]); } I am given the error " * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to copy Plist. Error Operation could not be completed. No such file or directory'" in the console however. Any idea what is wrong? Thanks

    Read the article

  • Error copying file from app bundle

    - by Michael Chen
    I used the FireFox add-on SQLite Manager, created a database, which saved to my desktop as "DB.sqlite". I copied the file into my supporting files for the project. But when I run the app, immediately I get the error "Assertion failure in -[AppDelegate copyDatabaseIfNeeded], /Users/Mac/Desktop/Note/Note/AppDelegate.m:32 2014-08-19 23:38:02.830 Note[28309:60b] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create writable database file with message 'The operation couldn’t be completed. (Cocoa error 4.)'.' First throw call stack: "... Here is the App Delegate Code where the error takes place -(void) copyDatabaseIfNeeded { NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSString *dbPath = [self getDBPath]; BOOL success = [fileManager fileExistsAtPath:dbPath]; if (!success) { NSString *defaultDBPath = [[ [NSBundle mainBundle ] resourcePath] stringByAppendingPathComponent:@"DB.sqlite"]; success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error]; if (!success) NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]); } } I am very new to Sqlite, so I maybe I didn't create a database correctly in the FireFox Sqlite manager, or maybe I didn't "properly" copy the .sqlite file in? (I did check the target membership in the sqlite and it correctly has my project selected. Also, the .sqlite file names all match up perfectly.)

    Read the article

  • Detect file creation date on iPhone OS?

    - by Greg Maletic
    I was planning on writing some code whose logic was based upon testing the creation date of a particular file in my app's Documents folder. Turns out, when I call -[NSFileManager attributesOfItemAtPath:error:], NSFileCreationDate isn't one of the provided attributes. Is there no way to discover a file's creation date? Thanks.

    Read the article

  • Count files in directories AND subdirectories? iPhone

    - by AWright4911
    I am trying to count entire files in a directory, including subdirectories. This is what I have to count files in the first folder: -(NSString *)numberOfPhotos { NSString *MyPath = @"/rootdirectory/"; NSArray *directoryContent = [[NSFileManager defaultManager] directoryContentsAtPath:MyPath]; return [NSString stringWithFormat:@"%d", [directoryContent count]]; } I was thinking maybe something like for (file in folder){ [file count] { but doesnt seem to work.

    Read the article

  • Saving data - does work on Simulator, not on Device

    - by Peter Hajas
    I use NSData to persist an image in my application. I save the image like so (in my App Delegate): - (void)applicationWillTerminate:(UIApplication *)application { NSLog(@"Saving data"); NSData *data = UIImagePNGRepresentation([[viewController.myViewController myImage]image]); //Write the file out! NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path_to_file = [documentsDirectory stringByAppendingString:@"lastimage.png"]; [data writeToFile:path_to_file atomically:YES]; NSLog(@"Data saved."); } and then I load it back like so (in my view controller, under viewDidLoad): NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path_to_file = [documentsDirectory stringByAppendingString:@"lastimage.png"]; if([[NSFileManager defaultManager] fileExistsAtPath:path_to_file]) { NSLog(@"Found saved file, loading in image"); NSData *data = [NSData dataWithContentsOfFile:path_to_file]; UIImage *temp = [[UIImage alloc] initWithData:data]; myViewController.myImage.image = temp; NSLog(@"Finished loading in image"); } This code works every time on the simulator, but on the device, it can never seem to load back in the image. I'm pretty sure that it saves out, but I have no view of the filesystem. Am I doing something weird? Does the simulator have a different way to access its directories than the device? Thanks!

    Read the article

  • Get directory contents in date modified order

    - by nevan
    Is there an method to get the contents of a folder in a particular order? I'd like an array of file attribute dictionaries (or just file names) ordered by date modified. Right now, I'm doing it this way: get an array with the file names get the attributes of each file store the file's path and modified date in a dictionary with the date as a key Next I have to output the dictionary in date order, but I wondered if there's an easier way? If not, is there a code snippet somewhere which will do this for me? Thanks.

    Read the article

  • how to search files of particular extension in the entire device ?

    - by KayKay
    In my application, i am trying to find all files of particular extension (like .pdf, .txt, etc) that are stored in the whole device (not only in Home Directory) and want to list them in table View. Is it possible to do so and if it is then can i associate file of specific extension to get it open in supporting application (any third party plug-ins).I went through numerous documentation but couldn't find the solution. Also how can i index files of these extension for fast search. Any help is appreciated. Thanks.

    Read the article

  • Calculate the size of a folder...

    - by iphone_developer
    Just a quick one... I'm creating a folder to cache images inside Documents with my iPhone App. I want to be able to keep the size of this folder down to 1MB, so I need to to check the size in bytes of my folder. I have code to calculate the size of file, but I need the size of the folder. What would be the best way to do this? Will I need to loop through each file? Cheers

    Read the article

  • On iPhone, how do I check once per day to see if i should phone-home?

    - by Jann
    I want to check a file on the server only once each day (NSURL). And, no matter if I fetch the file or not, I do not run the function (to check for the file) again that day. This would SEEM easy... but I forsee issues. Say I had created a directory under the mainBundle: "/Library/runOnceEachDay/". Perhaps I could write to /Library/runOnceEachDay/20100601 knowing that file would only exist if I already ran the function. If it does not exist, run the function and after the function is successful write a zero length file with the date as the filename. Then check before running that function for "mainBundle/Library/runOnceEachDay/YYYYMMDD" whereas YYYYMMDD is today's date. If that file exists, do not run. I could run a housecleaning routine to clean that directory once/week or something. Any better ideas? Thanks!

    Read the article

  • Cocoa/AppleScript move file

    - by bogdan
    I have a list of file paths and a destination path. I need something (AppleScript, Cocoa) that will move the files from one location to an other. I first tried using the following AppleScript, just to see what happens: set the_folder to (choose folder) tell application "Finder" move selection to the_folder end tell The problem is that it just blindly tries to move a file, nothing like the way Finder actually moves files (i.e. if a file with that name already exists, the AppleScript just throws an error, while Finder would ask you if you want to replace the file). The solution I came up with involved NSFileManager. I won't post the code because it's quite long, but basically I just check if the file already exists before trying to move, and if it exists a NSAlert with Replace/Cancel buttons appear. I have 2 remaining problems: Authorization - if you try to do something to files where you don't have access, the Finder would ask you to authorize. My code just fails... Moving to external drives - when you try to move a file to a different drive, NSFileManager copies the file and then deletes the original. The problem is that NSFileManager doesn't provide anything which I could use to display a progress indicator of what's happening during the copy. Is there anything I could use that is able to move files without these problems? The way I see it, I'm pretty much stuck with checking if the files are writable by the current user and authorize NSFileManager if not (from my understanding of the Authorization Services, this will be quite hard to implement). Oh and, I would also need to check if the destination is on the same drive and if not, implement something with FSCopyObjectAsync so that it shows a progress indicator... Thanks!

    Read the article

  • iphone calls both if and else at the same time?

    - by David Schiefer
    Hi, I need to determine what file type a file is and then perform a certain action for it. this seems to work fine for some types, however all media types such as videos and sound files get mixed up. I determine the file type by doing this: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); } I do this for various file types and just define an "else" for all the others. Here's the problem though. The iPhone calls them both. Here's what the log reveals: 2010-05-11 18:51:12.421 Test [5113:207] Matched MP3 2010-05-11 18:51:12.449 Test [5113:207] Matched ELSE I've never seen anything like this before. This is my "matchedMP3" function: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:urlAddress]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; moviePlayer.backgroundColor = [UIColor blackColor]; [moviePlayer play]; } and here's the else statement: else { NSLog(@"Matched ELSE"); [[NSUserDefaults standardUserDefaults] setObject:rowValue forKey:@"rowValue"]; NSString*rowValue = [[NSUserDefaults standardUserDefaults] objectForKey:@"rowValue"]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; webViewHeader.prompt = rowValue; [documentViewer setDelegate:self]; NSString *encodedString = [urlAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //Create a URL object. NSURL *url = [NSURL URLWithString:encodedString]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [documentViewer loadRequest:requestObj]; [navigationController pushViewController:webView animated:YES]; } I can't see a reason why it wouldn't work. What happens is that both the webview and the MediaPlayer toggle their own player, so they overlap and play their sound/video a few secs apart from each other. Any help would be appreciated & thank for you taking the time to read through my code.

    Read the article

1 2 3 4  | Next Page >