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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

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

Reply
 
LinkBack Thread Tools Display Modes
Old 07-25-2009, 09:03 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 159
Exclamation Goto another view; / goto another action;

I'm looking at a button push on one view changing the value of an integer on another. At the minute it sounds obvious but the IBAction doesn't know about the object on the other view that I want it to manipulate. Do I just need a line of code to point it to the other view? Or is it something else entirely?

I'm having the same/ a similar problem if I have a button push with a goto that's outside it's own action

for example

- (IBAction) buttonpush (id)sender

{
if (image.sethidden == yes)
image.sethidden = no
}
else
{
goto alert2;
}
}

-(void) alertfornoimage
{
alert2:
UIAlertview.....
}

the reason I want to do this and don't simply put the code at the end is I want many IBActions to display the same alert if the image is already unhidden....
xiii3 is offline   Reply With Quote
Old 07-26-2009, 02:15 AM   #2 (permalink)
iPhone Developer
 
kohjingyu's Avatar
 
Join Date: May 2009
Location: Singapore
Posts: 326
Default

Try importing the header file of the other view. I don't know if that would work, but somehow I don't know how to do this too. Perhaps you need to declare global variables. I think it's done in the delegate file. I don't know how to create global variables though. Does someone here know?
__________________
Bacteria Bash
Cheese Collect
Jokestar
Follow me on Twitter for news about my apps:
(Website|Twitter)
kohjingyu is offline   Reply With Quote
Old 07-26-2009, 10:40 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 159
Default

you see im thinking that i should use core data and that way i could update the data to one place... but im not sure. i am reading up on core data at the moment. but if there are any better ways id like to know.

the main one is actually the UIAlertview problem... because i dont know what im doing with it at all.... whether i can use the one UIAlertview several times on different IBActions but only give it properties and synthesize it once.... or if i can actually send multiple button presses to one place
xiii3 is offline   Reply With Quote
Old 03-19-2010, 03:04 PM   #4 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 84
Default just for newbie

-(void) alertView:(UIAlertView *) alertview clickedButtonAtIndex:(NSInteger)buttonIndex {

if(buttonIndex == 1){


Accidenthelpercall* help = [[Accidenthelpercall alloc]initWithNibName:@"Accidenthelpercall" bundle:nil];
[self presentModalViewController:help animated:YES];
[help setTitle:@"Accident Helper"];
[help release];
}
if(buttonIndex == 2)
{
Accidentdamagecar* damagecar = [[Accidentdamagecar alloc]initWithNibName:@"Accidentdamagecar" bundle:nil];
[[self navigationController] pushViewController:damagecar animated:YES];
[damagecar setTitle: @"Car Damage"];
[damagecar release];

}





Quote:
Originally Posted by xiii3 View Post
you see im thinking that i should use core data and that way i could update the data to one place... but im not sure. i am reading up on core data at the moment. but if there are any better ways id like to know.

the main one is actually the UIAlertview problem... because i dont know what im doing with it at all.... whether i can use the one UIAlertview several times on different IBActions but only give it properties and synthesize it once.... or if i can actually send multiple button presses to one place :confused:
vikinara 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: 252
21 members and 231 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, dacapo, Dani77, DarkAn, Desert Diva, HemiMG, iDifferent, jakerocheleau, JasonR, prchn4christ, Rudy, ryantcb, Speed, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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