tags:

views:

35

answers:

1

Is there any way of placing a file into application "sandbox" i.e into eg:

/var/mobile/Applications/30B51836-D2DD-43AA-BCB4-9D4DADFED6A2/Documents

of iphone?

My Application expects a file to be put into /Documents folder of application so that it can be uploaded to my local server.

This method should confirm to the rules of Apple so that it should not be rejected.

A: 

Why rejected? It is definitely normal to save a file to a Documents folder and Apple can not reject your application just because you save a file to the application Documents folder.

Use the following code to do so:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSString *pathToFile = [basePath stringByAppendingPathComponent:@"somefile.format"];
[someNSData writeToFile:pathToFile atomically: YES];
sfa
Can I add file to /Documents folder of a particular application resididng iphone externally with out using any code.Here, when I refer to "externally",it may be using wireless mode(bluetooth or wifi) or using dock connector connected to PC and other end to iphone.I guess this method doesn,t confirm to the rules of apple
surajbaba