I just started to develop applications for iPhone, and I'm actually trying to access files in order to read or write data.
I can successfully read a raw data file, but I'm having some problems about writing.
Here is the small piece of code I wrote:
How would I retrieve that file and save the lat and lon into 2 separate variables?
Thanks!
You could use the NSMutableDictionary's writeToFile methods instead, I find that handy for simple data. It can basically read/write any type you can use in your plist files (Dictionary, Array, Boolean, Data, Date, Number, String).
I use a static method to return the full path to the data file so I don't have to write it twice:
You could use the NSMutableDictionary's writeToFile methods instead, I find that handy for simple data. It can basically read/write any type you can use in your plist files (Dictionary, Array, Boolean, Data, Date, Number, String).
I use a static method to return the full path to the data file so I don't have to write it twice:
Also I wanted to change the default UISwitch value to OFF when the view loads. This doesn't seem to work!
Code:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (id)initWithOptionsSetup {
self.soundEffectsMode.on = NO;
return self;
}
Is der anyway to read teh files storein iphone. I heard 3.0 supports reading and saving the music files. Is it not possible to load other files as music files. I like to build a Backup and Recovery system.
That is great! Thanks a lot.
Is there a way in which I can access the saved files from the Mac for analysis? For example, I want to write the accelerometer data to the file and later read it in Matlab or something?
Thanks
PS
Quote:
Originally Posted by jgoemat
You could use the NSMutableDictionary's writeToFile methods instead, I find that handy for simple data. It can basically read/write any type you can use in your plist files (Dictionary, Array, Boolean, Data, Date, Number, String).
I use a static method to return the full path to the data file so I don't have to write it twice:
I tried to understand and use your code.
I have one question left: I get an error with the "classname"
XCode tells me that it's not defined. Did you do that in your headerfile or somewhere I don't see it?
I am also trying to read from a file and it's causing me trouble.
I have the line of code 'NSArray *line = [fileContents componentsSeparatedByString:@"\n"];
which breaks up the data from my text file into separate strings and it's receiving the error 'Local declaration of 'txtFile' hides instance variable' for some reason?
I am also trying to read from a file and it's causing me trouble.
I have the line of code 'NSArray *line = [fileContents componentsSeparatedByString:@"\n"];
which breaks up the data from my text file into separate strings and it's receiving the error 'Local declaration of 'txtFile' hides instance variable' for some reason?