ios - Saving an Mutable Array into file via writeToFile -


for(int x = 0; x < [tags count]; x++){     nsstring* tagsvalue = [[nsstring alloc] initwithformat:@"%d: %f", 1,      [[tags objectatindex:x]doublevalue]];      [[tagsvalue datausingencoding:nsutf8stringencoding] writetofile:fileatpath      atomically:no]; } 

i understand writetofile replace file of give final value of array value. how approach i've been trying around head few hours i've had no luck thanks! :)

i think trying write directly array file.

  1. convert array in string format.

    nsstring *tagscompletestr = [tags componentjoinedbystring:@" "]; [tagscompletestr  writetofile:fileatpath                                         atomically:no]; 

hope help.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -