I read 5 other related questions with the same error or syntax. As far as I understood non had anything related to my question.
-(void) createCopyOfDBIfNeeded{
NSFileManager *fileManager= [NSFileManager defaultManager];
BOOL isDatabaseInCache = [fileManager fileExistsAtPath:@selector(getDBFile)];
if (isDatabaseInCache) {
return;
}
}
//getDBFile Method:
-(NSString *) getDBFile {
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString * DBPath = [paths firstObject];
NSString * DBFile = [DBPath stringByAppendingPathComponent:@"productDBFile.db"];
return DBFile;
}
It seems the error is related to @selector(getDBFile)
.
If I use [self getDBFile] instead everything works, but I want to learn how and where to use @selector appropriately and what the error/warning means here.
I ALSO get a warning: Incompatible pointer types sending 'SEL' to parameter of type
EDIT: This is question is fundamentally a duplicate of What's the difference between a method and a selector?