Guys...i am trying to do a simple app with 5 views, whit 1 question and 2 answers (yes or no) allways. (the question is allready on background screen ).
so...on the first screen you play start button(startbnt), so lets call the first view, than on the first view we ll have 2 buttons, yes or no, if the person touch on "yes" button, the program ll show the next view (view2 or view3..) but , i dont want to do sequencial mode, i want the view1 return a method or a variable to "asdviewcontroller" (myviewcontrol) and than the asdviewcontroller will call another random view.
If the person touches the "no" button, the program ll show the end screen. calling the view end (this is simple, i have allready).
here is the code:
Code:
asdviewcontroller:
int ix, resp1, cont,xax;
- (IBAction)view1:(id)sender{
do {
ix =(arc4random()%3)+1;
switch (ix) {
case 1:
{
{
view1 *nvc =[[view1 alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:nvc animated:NO];
[nvc release];
}
cont = chavefunc(); /* here cont will receives a value from view1 and validate the loop , and i want a return, to call another view randomic */
}
break;
case 2:
{
{
view2 *nvc =[[view2 alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:nvc animated:NO];
[nvc release];
}
cont = chavefunc2(); // same thing
}
break;
case 3:
{
// same thing...
}
break;
}
}while (cont==1);
}
now view1.m:
int chave;
- (IBAction)view2x:(id)sender
{
chave =1;
}
- (IBAction)gaovb:(id)sender{
Gover *nvc = [[Gover alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:nvc animated:NO];
[nvc release];
chave =0;
}
int chavefunc (){
int keyret;
keyret = chave;
return keyret;
}
// classe view2.m (samething)...
After call view1, my app close..he does not call another view ... My question is, after touch on button of the view1, how can i do randomic views with a loop and get a return to validate?
Thx, w8 for answers !!