Note that there are some explanatory texts on larger screens.

plurals
  1. POStoring large note content -objective-c
    text
    copied!<p>I am making a note-taking app but this app won't be a traditional note-taking application. This application will be used by my company's employees and engineer teams in my company. The notes content will be large because contain some mathematical expressions. Also, files must be sent to dropbox as text and pdf files.</p> <p>I wonder which is the best method of these for storing large data content:</p> <p>1- Simply writing notes content to file (like note1.txt) in Documents directory </p> <p>I am using this function for writing files:</p> <pre><code>-(IBAction)writeFile:(id)sender { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fileNameData=[NSString stringWithFormat:@"%@.txt",fileName.text]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileNameData]; NSString *str = fileContent.text; [str writeToFile:filePath atomically:TRUE encoding:NSUTF8StringEncoding error:NULL]; } </code></pre> <p>2- Or storing file contents in database and create a file when user wants to send the note to dropbox and send this created file to dropbox?</p> <p>I have created note-taking apps before but in this one, files will be large and I am worried about performance.</p> <p><strong>UPDATE</strong></p> <p>I did some trials. I tried to write and read the same string using both technique; core data and files.</p> <p>It takes about 16 seconds to read string from Core Data and about 5 seconds to read from the file with stringWithContentsOfFile method.</p> <p>I know that is not very accurate results but I guess Core Data is not very proper for me. If I am wrong, please correct me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload