Je crée une application qui lit simplement les données d'un fichier XML et les affiche dans une vue de table.UITabelView rechargé à partir de NSXMLParser (iphone SDK 4.0)
J'ai créé un bouton "actualiser" quand j'ai cliqué je veux le télécharger de nouveau le fichier xml et l'afficher de nouveau mais il semble planter mon application s'il y a un fichier XML déjà téléchargé.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
ipb = [[IPB alloc] init];
sectionTitle=[[NSMutableArray alloc]init];
[email protected]"http://localhost:8888/xml/Sinnergy.xml";
[self reloadTableView];
[window makeKeyAndVisible];
return YES;
}
-(void)reloadTableView
{
pathURL = [NSURL URLWithString:currentURL];
parser = [[NSXMLParser alloc] initWithContentsOfURL:pathURL];
[parser setDelegate:self];
[parser parse];
[mainTableView reloadData];
}
Je voulais vraiment supprimer cela avant de poster. C'était juste quelque chose que je jouais avec désolé. –
Fonctionne parfaitement grâce :). –