Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-26-2012, 08:10 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 5
jilb is on a distinguished road
Default its that possible ??

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 !!
jilb is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 403
9 members and 394 guests
Atatator, condor304, FrankWeller, MAMN84, mraalex, n00b, PowerGoofy, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,123
Posts: 402,908
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:57 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0