J'ai essayé d'apprendre comment travailler avec une source de données SQL, j'ai trouvé un exemple de SQLiteTutorial dans l'échantillon de pomme Quel mauvais, Apple n'a pas mis à jour leurs échantillons, alors quand j'ouvre le fichier d'échantillon Apple ai obtenu beaucoup d'alerte dépréciée ....setText: est obsolète
dans ce cas, le code est
// Set up the cell
SQLiteTutorialAppDelegate *appDelegate = (SQLiteTutorialAppDelegate *)[[UIApplication sharedApplication] delegate];
Animal *animal = (Animal *)[appDelegate.animals objectAtIndex:indexPath.row];
[cell setText:animal.name];
return cell;
et Xcode dit me setText est dépréciée, mais je ne trouve pas comment corriger cela.
Le tutoriel je travaille sur est ici: http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/
J'ai d'autres avertissement dans le délégué de l'application
// 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 me dire que SQLiteTutorialAppDelegate peut ne pas répondre à checkAndCreateDatabase et readAnimalsFromDatabase
et la dernière chose dans le RootViewController, méthode d'instance initWithData: cache introuvable
/ 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;
}
Merci si vous avez une réponse.
merci pour votre réponse, c'est clair. Dans leurs réponses, beaucoup de gens ont oublié que l'anglais n'est pas ma langue maternelle et le fait que je suis débutant, parfois leur réponse est chinoise pour moi. Merci – a3116b