Search code examples
iphoneiosnsfilemanager

Nsfilemanager error


the availableDate part is not working properly I think??

NSFileManager *filey = [NSFileHandle fileHandleForReadingAtPath:savedTextMsg];

    NSString *tMessage=[[NSString alloc] initWithData:[filey availableData] encoding:NSUTF8StringEncoding];

No visible @interface for NSFileManager declares the selector availableData is the error message.. What does that mean exactly? Thanks Mat


Solution

  • -fileHandleForReadingAtPath: returns an NSFileHandler, so you need to change the first line to

    NSFileHandler *filey = [NSFileHandle fileHandleForReadingAtPath:savedTextMsg];
    

    The error message occures because you declared filey to be an instance of NSFileManager, and that class does not declare a method -availableData.