Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:47:53+00:00 2026-05-24T13:47:53+00:00

Lets say I have written an application for iOS which allows the user to

  • 0

Lets say I have written an application for iOS which allows the user to enter some text and save it. How can I export this text to be viewed on a desktop PC running windows OS? If this is not possible, what are the alternatives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:47:54+00:00Added an answer on May 24, 2026 at 1:47 pm

    You can save the text to your app’s Documents directory and allow them to export it through iTunes. You can also allow them to email it.

    Saving it to disk:

    To save in the App’s documents directory, you’ll need to do a few things. First of all, you’ll need to get the URL to the path directory. A method for this is conveniently generated by Xcode when you make a Core Data based project. Here’s that method:

    - (NSURL *)applicationDocumentsDirectory{
      return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
    }
    

    Next, you’ll want to take that that URL and use it to write our to your App’s documents directory. In the simples case, we have a string, called someText, which we’ll be writing out to the Documents directory. Here’s what that looks like:

    NSString *someText = "Here's to some awesome text.";
    

    We have a path, called path. Note that we take the path to the documents directory and then append a filename. You could replace someText.txt with whatever filename you want to use.

    NSString *path = [NSString stringWithFormat:@"%@",[[[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"someText.txt"] absoluteString]];
    

    We tell the the string to write itself out to the file (in this case atomically) and if it fails, we populate the error object, which we can read out later if necessary. Note the option for “atomically” here. If it’s set to YES, the app will write the text into a buffer and rename it afterward. If it’s not set to YES, the text will be written straight to text. This makes a difference in multithreaded environments and can protect your text from being some mangled result, but atomic writing is slower.

    Here’s all of the above code at once:

    //Write to the file
    [someText writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:&error];
    
    NSString *someText = "Here's to some awesome text.";
    
    NSError *error = nil;
    
    NSString *path = [NSString stringWithFormat:@"%@",[[[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"someText.txt"] absoluteString]];
    
    //Write to the file
    [someText writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:&error];
    

    Reading the file from iTunes:

    This is the fun part. In Xcode, you need to add a key to your app’s Info.plist file. Here’s what that is going to look like in Xcode 4:

    Enabling iTunes sharing

    Now, in iTunes, your App’s documents directory will be visible.


    Alternatively (or in addition to iTunes), you could use the MessageUI framework and allow the user to email the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an existing application written in Java which I wish to
Lets say I have an intraweb application (written in Delphi 2010) with an iwEdit
Let's say I have an application written in C# called EquipCtrl.exe which runs as
Lets say we have an online application written in AS3 and served from a
Let's say that I have written a custom e-mail management application for the company
Lets say I have a single object of type Car which I want to
if I have a source of library written in C/C++ (lets say its libxml2),
I have written a Java application which should be started or woken up when
Let's say I have an application written with spring framework, and I want to
Let's say that you have a product that is written in Visual Studio and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.