我創建了一個應用程序中的圖像文件創建程序直接使用下面的代碼保存它在文件目錄文件:如何找到一個從我的iPhone
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString * basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
UIImage* videoImage = [self resizeImage:[UIImage imageWithData:self.videoImageData] toWidth:width andHeight:height];
NSData *imageData2 = UIImageJPEGRepresentation(videoImage, imageQuality);
[imageData2 writeToFile:[basePath stringByAppendingPathComponent:@"myfile.png"] atomically:YES];
現在從我的iPhone設備如何
我可以找到並打開這個文件嗎?
爲什麼你的應用程序不提供這個設施,如果它是你想讓用戶能夠做的事情? – trojanfoe
@trojanfoe此代碼僅用於測試目的,我希望看到圖像轉移到設備上的服務器,這不是用戶應該做的事情。 –
將設施添加到您的應用程序,但只能在「開發人員模式」下使用(例如使用編譯時常量)。 – trojanfoe