Reading/Writing Text files
Reading/Writing Text files
- Subject: Reading/Writing Text files
- From: email@hidden
- Date: Mon, 11 Sep 2006 08:29:40 EDT
Slightly frustrated here. What I need to do is this...
I need to read in text files off a PC, manipulate some bytes of data and then
write the data back out to plain text files. How do I do this? It seems every
Cocoa application example I look at assumes that you want to use an encoder,
so all I can find are examples of reading and writing with encoders.
I just want to.
1: Read in the text file into an NSTextView
2: Have the user make some minor changes
3: Write the new data back out (To a Plain text file)
Is this possible??
Here is what I have so far... just so you have an idea of what I'm trying to
do
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type
{
// Let's see what we're getting...
NSLog(@"loadDataRepresentation: %@: %@",type, data);
NSAttributedString *tempString = [data description];
[self setString:tempString];
if ([self string] != nil)
{
[[myTextView textStorage] setAttributedString: [self string]];
}
return YES;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden