John
John

Reputation: 61

Objective C - No previous prototype for function

I have 2 methods that are giving me a warning:

id LoadObjectFromFile(NSString* filename) {
    if ((filename = DocumentPath(filename, NO))) {
        return [NSKeyedUnarchiver unarchiveObjectWithFile: filename];
    } else {
        return nil;
    }
}

BOOL saveObjectWithFile(NSString* filename, id object) {
    if ((filename = DocumentPath(filename, YES))) {
        return [NSKeyedArchiver archiveRootObject: object toFile: filename];
    } else {
        return NO;
    }
}

This is giving me a "No previous prototype for function" warning.

I'd rather not just disable the warnings in xcode.

Where am I going wrong?

Upvotes: 1

Views: 1882

Answers (1)

this are C functions not objective C methods. have you defined them in the .h file?

Upvotes: 5

Related Questions