I am trying to write a list to a text file that is included in my project (Deck.txt), the corresponding code is as follows:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Deck" ofType:@"txt"]; NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath]; deck = [[NSString alloc]initWithFormat: @"%@\n%@ %@",file, txtQuantity.text, cardName];
When I run the code, it will not be saved in a text document, or at least not part of my project. Anyway, he will create a list and read from the file all the data that I am trying to write, but when I close the program, no changes are made to the text document. Any help would be most appreciated.
objective-c iphone xcode
user501327
source share