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.
convert array in string format.
nsstring *tagscompletestr = [tags componentjoinedbystring:@" "]; [tagscompletestr writetofile:fileatpath atomically:no];
hope help.
Comments
Post a Comment