这是我的代码:
NSURL *storeUrl = [NSURL fileURLWithPath: [[self.applicationDocumentsDirectory] stringByAppendingPathComponent:@"DB.sqlite"]];
- (NSString *)applicationDocumentsDirectory {
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
}
它给了我错误:期望的标识符......什么标识符?
答案 0 :(得分:1)
以适当的方式调用方法。 dot
(。)用于访问properties
。使用s pace( )
代替dot(.)
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"DB.sqlite"]];
- (NSString *)applicationDocumentsDirectory {
return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
}