1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
- (void)viewDidLoad {
NSError *fileError = nil;
NSURL *url = [[NSURL alloc] initWithString:@"http://172.16.50.6/GetIPhone/GetJoueurBis?codeEq=2"];
XMLToObjectParser *myParser = [[XMLToObjectParser alloc]
parseXMLAtURL:url toObject:@"Joueur" parseError:nil];
NSLog(@"sfdfdfsfs");
if(fileError == nil){
// audios =[[NSMutableArray alloc ] init];
joueurs = [[NSMutableArray alloc] init];
for(int i = 0; i < [[myParser items] count]; i++) {
Joueur *nouveauJoueur;
nouveauJoueur = (Joueur *)[[myParser items] objectAtIndex:i];
[self.joueurs addObject:nouveauJoueur];
}
joueursViewController = [[JoueursViewController alloc] initWithNibName:nil bundle:nil];
joueursViewController.joueurs=self.joueurs;
} else {
NSLog(@"ERREUR DE CHARGEMENT!!!");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Erreur!"
message:@"Echec de connexion."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
[url release];
[myParser release];
//---------------------------set up navigation bar------------------------------------------
/*UIImageView *logo = [[UIImageView alloc] initWithFrame:
CGRectMake(0,0,320,
self.navigationController.navigationBar.frame.size.height-1)];
[logo setImage:[UIImage imageNamed:@"ban TEAM.png"]];
[self.navigationController.navigationBar addSubview:logo];
[self.navigationController.navigationBar sendSubviewToBack:logo];*/
//self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];
//-----------------------------*******************-------------------------------------------
//self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];
naviga = [[UINavigationController alloc]init];
naviga.view.frame = self.view.bounds;
naviga.delegate = self;
[Effectif setBackgroundImage:[UIImage imageNamed:@"EffectifPro.png"] forState:UIControlStateNormal];
[Staff setBackgroundImage:[UIImage imageNamed:@"STAFFpro.png"] forState:UIControlStateNormal];
[histoire setBackgroundImage:[UIImage imageNamed:@"histoire.png"] forState:UIControlStateNormal];
[Palmares setBackgroundImage:[UIImage imageNamed:@"palmares.png"] forState:UIControlStateNormal];
[super viewDidLoad];
//self.navigationItem.title =image;
} |
Partager