no readFromFile?!?!

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

  1. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #1
    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];
    }
    @end

    (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

    Cromulent

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

    http://developer.apple.com/document...ileWrappers.html#//apple_ref/doc/uid/20000775

    Specifically:

     
  3. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008

Share This Page