no readFromFile?!?!

Discussion in 'Mac Programming' started by liptonlover, Jul 6, 2008.

  1. liptonlover macrumors 6502a

    Mar 13, 2008
    Didn't expect to be posting again so soon, but here I am.

    I'm trying to save and load from a text file. I set up a text file in my documents folder and can save to it,

    #import "save.h"

    @implementation save
    NSString *path=@"/Users/nate/Documents/test.txt";
    NSString *data;
    - (IBAction)load:(id)sender {


    - (IBAction)save:(id)sender {
    data=[field stringValue];
    [data writeToFile:path atomically:NO];

    (The text is definitely saving; I checked with textedit)

    but I can't find any way to load. I'm looking under NSData but there is no readFromFile:Atomically: or anything like that.
  2. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    This page explains it all.


  3. liptonlover thread starter macrumors 6502a

    Mar 13, 2008

Share This Page