NSString封存到本地,读取

NSString保存到本地,读取保存到本地: NSError *error NULLBOOL success [str writeToFile:document_c

NSString保存到本地,读取

保存到本地:

 NSError *error = NULL;        BOOL success = [str writeToFile:document_cache_forum_top atomically:YES encoding:NSUTF8StringEncoding error:&error];        if(!success)        {            NSLog( @"error saving to %@ - %@", document_cache_forum_top, [error localizedDescription] );        }

?

读取str:

NSError *error = NULL;        NSString *str = [NSString stringWithContentsOfFile:document_cache_forum_top encoding:NSUTF8StringEncoding error:&error];        

?