它顯示我警告initWithDocPath沒有找到時,我想私有目錄內容..initWithDocPath沒有找到
+ (NSMutableArray *)loadScaryBugDocs {
NSString *documentsDirectory = [VideoDatabase getPrivateDocsDir];
NSError *error;
NSArray *files =[NSFileManagerdefaultManager]contentsOfDirectoryAtPath:documentsDirectory error:&error];
if (files == nil) {
return nil;
}
NSMutableArray *retval = [NSMutableArray arrayWithCapacity:files.count];
for (NSString *file in files) {
if ([file.pathExtension compare:@"scarybug" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:file];
VideoNotepadViewController *doc = [[[VideoNotepadViewController alloc] initWithDocPath:fullPath] autorelease];
//shows warning here
[retval addObject:doc];
}
}
return retval;
}
loadScaryBugDocs'的一部分是什麼類?你的'VideoNotepadViewController'是否在'@interface'中聲明瞭'initWithDocPath:'方法? –
loadScaryBugDocs是videoDatabase類的一部分,initWithDocPath沒有在該類中聲明,因爲我認爲它不需要cos工作正常,沒有聲明該方法.... –
'VideoNotepadViewController'實際上是否有一個名爲'initWithDocPath:'的方法?這個警告究竟說了什麼? –