开发者

How to access iphone hdd from ios app and windows app (through USB)?

I need to be able to save data from windows application to hdd of iphone through usb. Then I need to read it from application running on iphone.

What i tried: I did install "USB drive" on iphone and created disk. Now I'm able to save data from windows on iphone, but I don't know how to access this drive in ios app. Anybody have any ideas? Device is jailbroken so every "non official开发者_JAVA技巧" solution is appreciated.


Every Application runs in a Sandbox. So you can't get in and can't get out.

Non Jailbroken solution: Add UIFileSharingEnable to info.plist and set it to YES

Now you can copy files from your windows machine to your iOS Device via iTunes

Filepath of your Files:

NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *sDocumentsDir = [documentPaths objectAtIndex:0];
NSString *filePath = [[NSString alloc] initWithString:sDocumentsDir];
filePath = [[filePath stringByAppendingString:@"/"] stringByAppendingString:@"file.txt"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜