0
我想通過webview實現照片上傳系統。響應AJAX調用iOS UIWebView
我讓它通過Safari瀏覽器工作,但尚未通過webview工作。我的研究使我意識到我需要使用的UIImagePickerController以捕獲映像文件的路徑,並且有這樣的方法:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSString *path = [[NSBundle mainBundle] bundlePath];
NSData *data = UIImageJPEGRepresentation([info objectForKey:@"UIImagePickerControllerOriginalImage"] , 1.0);
NSString *fullPath = [path stringByAppendingPathComponent:@"image_tmp.jpg"];
if ([[NSFileManager defaultManager] createFileAtPath:fullPath contents:data attributes:nil]) {
NSLog([NSString stringWithFormat:@"file successfully written to path %@",fullPath],nil);
}
}
不過,我有麻煩工作如何我攔截和Ajax調用響應通過UIImagePickerController。
相似的問題:http://stackoverflow.com/q/9889023/308315 – iwasrobbed 2013-04-29 15:21:50
謝謝,我沒有在我的搜索過程中遇到這個職位。現在將閱讀。 – Enbee 2013-04-29 15:26:20