Я попытался узнать, как работать с источником данных SQL, я нашел пример имени SQLiteTutorial в образце яблока. Что плохо, яблоко не обновляло свои образцы, поэтому, когда я открываю файл образца яблока, я получаю много устаревших предупреждений.....
в этом случае код
// Set up the cell
SQLiteTutorialAppDelegate *appDelegate = (SQLiteTutorialAppDelegate *)[[UIApplication sharedApplication] delegate];
Animal *animal = (Animal *)[appDelegate.animals objectAtIndex:indexPath.row];
[cell setText:animal.name];
return cell;
, и Xcode сказал, что setText устарел, но я не нашел, как это исправить.
учебник, над которым я работаю, находится здесь: http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/
У меня есть другое предупреждение в делегате приложения
// Execute the "checkAndCreateDatabase" function
[self checkAndCreateDatabase];
// Query the database for all animal records and construct the "animals" array
[self readAnimalsFromDatabase];
// Configure and show the window
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
Xcode сообщает мне, что SQLiteTutorialAppDelegate может не отвечать на checkAndCreateDatabase и readAnimalsFromDatabase
и последнее, что есть в RootViewController, метод экземпляра initWithData: кеш не найден
/ Load the animals image into a NSData boject and then assign it to the UIImageView
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[animal imageURL]]];
UIImage *animalImage = [[UIImage alloc] initWithData:imageData cache:YES];
self.animalView.animalImage.image = animalImage;
}
спасибо, если у вас есть ответ.