1

Hi I have my iPhone app which will be run on a jailbroken iPhone and I want to download a file from the web and place it in another apps directory.

I am new to iOS development and have successfully downloaded the file and placed it in the Documents folder but how do I search for the UID of the app and place it in the library folder of another app? Keeping in mind this is on JB iPhone and have access to the filesystem.

Here is what I have so far.

NSString *stringURL = @"http://testfile.plist";
NSURL  *url = [NSURL URLWithString:stringURL];
NSData *urlData = [NSData dataWithContentsOfURL:url];
if ( urlData )
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString  *documentsDirectory = [paths objectAtIndex:0];

    NSString  *filePath = [NSString stringWithFormat:@"%@%@", documentsDirectory,@"/testfile.plist"];
    [urlData writeToFile:filePath atomically:YES];

Thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • take a look [at this question and answer here](http://stackoverflow.com/q/7841344/119114) – Nate Nov 21 '13 at 03:59
  • Thanks, found that but was looking more for some tips on finding the UID of an app and writing the file to a foder with nsfilemanager – user2391866 Nov 21 '13 at 17:17
  • I figured out how to write to the root file system but still need some help finding the "app id" folder. `NSString *stringURL = @"http://test.plist"; NSURL *url = [NSURL URLWithString:stringURL]; NSData *urlData = [NSData dataWithContentsOfURL:url]; if ( urlData ) { NSString *filePath = @"/test.plist"; [urlData writeToFile:filePath atomically:YES];` I just eliminated some data and created a symlink to the folder I needed in the root directory, but I would like the app to search for the correct folder and place the file. – user2391866 Nov 23 '13 at 04:17

1 Answers1

0

You can do documentation interaction controller make sure you develop custom url scheme and you should be able to pass around with user consent .