Questions tagged [writetofile]

for questions concerning the writeToFile method, part of the NSData class in OS X and iOS

This tag should be used for questions that relate to the use of one or more of the various writeToFile methods, which are provided by the NSData class in both the Mac OS X and iOS APIs.

The Apple developer documentation for the NSData class is available online here.

370 questions
0
votes
1 answer

writing NSMutable array to plist file via writeToFile

I have a plist file called playerData that includes a number object at index 0 indicating the highest level completed. After loading the view I read this object's integer value that is used throughout the game logic. If the player wins the game I…
Nairb555
  • 3
  • 2
0
votes
0 answers

plist should load and update table, but only works on first load

I have a simple tableview, which displays a list of historical input values. This list is saved in a plist, and loaded within the "ViewdidLoad" section. When any operation is used on the table, i.e. commitEditingStyle, i resave the values into my…
0
votes
2 answers

How can i write to a txt file several variables from servlet?

I have a web form page (jsp) ,where user gives some variables. I have a java class which has the same names.So with jsp bean i pass the user's input into 2 variables. So i have var_1=greek,var_2=turkey. I want now to pass these variables to a…
oikonomopo
  • 4,025
  • 7
  • 44
  • 73
0
votes
1 answer

writing NSDictionary into plist

Hi i am trying to write an NSDictionary to a plist in the documents folder, but unable to write , i am using the writeToFile:atomically: method , which returns False. The complete code is -(void)writeData:(NSDictionary *)dicResponseData { //…
Singh
  • 2,151
  • 3
  • 15
  • 30
0
votes
2 answers

Using writeToFile:atomically: consecutively doesn't work...why?

I'm trying to write a csv file. I have two arrays at hand - one with the titles (Name, Number etc), another with the actual values (Jon, 123 ...). Now, after the following two operations: [[titles componentsJoinedByString:@", "] writeToFile:file…
Sorin Cioban
  • 2,237
  • 6
  • 30
  • 36
0
votes
2 answers

ios problems with downloading an mp4 file

I have set up a connection to download this mp4 clip to my device and I'm using the following delegate function to store the data in a "streaming" type fashion. - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { …
Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
0
votes
2 answers

Write to a Text File Resource in Android

Does anyone know how to write to a text file in Android using a resource like: R.raw.my_text_file I'm just looking for something clean and simple. I've Googled around but the examples I found didn't work. I tried to code using the Android docs but…
user1191027
0
votes
1 answer

save NSMutable Data object in plist file

I, I'm currently trying to save NSMutable data in a plist file with the following method: [receivedData writeToFile:pathText atomically:YES] Note that received data comes from an URLrequest object. Here is my code: NSURLConnection *connection01 =…
Vico la patate
  • 209
  • 2
  • 4
  • 12
0
votes
1 answer

Using theos, how can I download an HTML file and overwrite an existing one (objective-c)?

I am trying to make a simple application (using theos on my device so no xcode/mac, just ifile) that displays an HTML file and has a button in the navigation bar that updates the local HTML file by downloading the new version from a server and…
mobabur94
  • 360
  • 2
  • 10
0
votes
1 answer

ImageIO error when writing to file

I am trying to save a UIImage but it gives me an error. The UIImage is picked from the UIImagePickerController and is then saved by making an NSData out of it and call writeToFile: on this NSData object. When doing so, I will get an error. The same…
simonbs
  • 7,932
  • 13
  • 69
  • 115
0
votes
2 answers

MAC OS X NSMutableDictionary writeToFile fail

my code is this. And the value of ret is always NO, I think the write path is not allowed. But where I can store my information on MAC OS X for my app? Can you help me to find the right path to store my app's setting? Thank you very much~…
RetVal
  • 107
  • 3
  • 10
-1
votes
1 answer

How to save text file line by line (using python or other editors)

I have a text file with 600 lines(\n), and I want to make 600 text files saving each line. So I want to write text files line by line, but I don't know how I can make it. e.g. If I have 'all.txt' file with 600 lines, like: line1 aaaaaa line2…
JinNana97
  • 1
  • 1
-1
votes
1 answer

Removing line break and writing lists without square brackets and comas to a text file in python

I'm facing a few issues with regard to writing some arguments to a text file. Below are the outputs I need to see in my text file. I want to write an output like this to the text file. Input: Hello World Output: HelloWorld 2. I want to write an…
cls_404
  • 11
  • 1
  • 6
-1
votes
1 answer

Issue writing to JSON-file with Python

The JSON-file { "site1": [ { "sw1": { "device_type": "cisco_ios", "host": "sw1.test.local" }, "sw2": { "device_type": "cisco_ios", "host": "sw2.test.local" } } ] } The Code: import…
thamuppet
  • 75
  • 5
-1
votes
1 answer

Why extra 'ÿ' added when writing into a .txt file in C?

I searched about this problem everywhere, but none of the suggested solutions worked for me. char currentChar; FILE *fp_read = fopen("../input.txt", "r"); FILE *fp_write = fopen("../textArranged.txt", "w"); while (!feof(fp_read)){ currentChar…