bonjour a tous,
j'ai une bouton son action est de me redérigé vers une UIViewController la boutton fonctionne mais apres un certain temp.
avez vous des idee pour l'action de ma boutton soit instantanne.
ViewDidLoad
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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;
}
L'action de ma boutton:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
- (IBAction)myButtonPressed:(id)sender{
	NSLog(@"Effectif");
 
	//joueursViewController.delegate=self;s
	//JoueursViewController *joueursViewController = [[JoueursViewController alloc] initWithNibName:nil bundle:nil];
	joueursViewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
 
	                      //[[self navigationController] pushViewController :joueursViewController animated:YES];
	[self presentModalViewController:joueursViewController animated:YES];
	[joueursViewController release];
	//joueursViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Team" style:UIBarButtonItemStylePlain target:nil action:@selector(back:)];	
 
 
}
Merci pour votre attention.