문제점을 발견했습니다. 다른 사람들이 그 문제에 직면 한 경우, 여기에 해결책이 있습니다 (제 경우) : 앱이 파일이 아직 만들어지지 않은 경우에만 데이터를 다운로드하므로 처음 실행했을 때 아직 flickr 키를 넣지 않았습니다. 그래서 데이터가없는 파일을 만들었습니다. 나는 키를 다시 응용 프로그램을 실행하면 이미 데이터가없는 (파일을했기 때문에, 그것은 플리커에서 데이터를 다운로드하지 않습니다. 여기에
난 후 PhotographersTableViewControler.m에
- (void)useDocument
{
if (![[NSFileManager defaultManager] fileExistsAtPath:[self.photoDatabase.fileURL path]]) {
// does not exist on disk, so create it
[self.photoDatabase saveToURL:self.photoDatabase.fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
[self setupFetchedResultsController];
[self fetchFlickrDataIntoDocument:self.photoDatabase];
}];
} else if (self.photoDatabase.documentState == UIDocumentStateClosed) {
// exists on disk, but we need to open it
[self.photoDatabase openWithCompletionHandler:^(BOOL success) {
[self setupFetchedResultsController];
//the next line is the only one I changed!!!!!!
[self fetchFlickrDataIntoDocument:self.photoDatabase];
}];
} else if (self.photoDatabase.documentState == UIDocumentStateNormal) {
// already open and ready to use
[self setupFetchedResultsController];
}
}
을 변경하는 코드입니다 처음으로 그 줄을 삭제할 수 있습니다. 누군가 내 실수에서 배울 수 있기를 바랍니다.
예, 나는 배웠습니다. w. tnx – litov