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 Tools & Utilities

Reply
 
LinkBack Thread Tools Display Modes
Old 01-13-2011, 03:33 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 7
AggieEMT is on a distinguished road
Default Button hiding

First let me start out by saying I feel like I'm climbing a vertical wall with the entire programming learning curve... that being said, speak slowly and in simple words. =) I am editing an app that a friend wrote for me. I have done fairly well if I do say so myself, but I have gotten as far as my good looks will take me.

My app is one that has a series of yes/no questions, and each question has a back button to go back one screen. At the end, there is an option for "start over", which returns you to the home screen. The problem is that the first question has the back button as well; if you press back when the app loads for the first time after starting, it simply disappears. If you get to the end, start over, and press the back button, it takes you back to the screen you ended on the previous time.

I think it has something to do with the following, but can't figure out the correct language to hide the back button on the first screen.

if([questionsStack count] == 1){
backButton.hidden = YES;
startOverButton.hidden = YES;
}
else {
backButton.hidden = NO;


TIA!
AggieEMT is offline   Reply With Quote
Old 01-13-2011, 05:03 PM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

your code seem correct, assure that it is executed on first view. (put a breakpoint or some NSLog)
__________________
dany_dev is offline   Reply With Quote
Old 01-13-2011, 07:06 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 7
AggieEMT is on a distinguished road
Default

Sorry, I should have clarified... the code as shown above is as it was written by a pro. My (newbie) logic made me think that I could maybe change something in what is posted above to hide the back button on the first question in the series...
AggieEMT is offline   Reply With Quote
Old 01-13-2011, 08:28 PM   #4 (permalink)
1026 Development
 
Join Date: Jul 2008
Age: 23
Posts: 1,094
Jeremy1026 is on a distinguished road
Send a message via AIM to Jeremy1026
Default

So, what is the code actually doing. Again, it looks like it should be working.
Jeremy1026 is offline   Reply With Quote
Old 01-14-2011, 09:09 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 7
AggieEMT is on a distinguished road
Default

The code is working correctly and what you see above has the back button displayed on every question screen.

I am trying to modify the code to hide the back button on the first question screen.
AggieEMT is offline   Reply With Quote
Old 01-14-2011, 09:33 AM   #6 (permalink)
m4s
Registered Member
 
Join Date: Jan 2011
Posts: 5
m4s is on a distinguished road
Default

maybe something like

Code:
//define somewhere the max count for the questions
int maxStackcount = 10;

if([questionsStack count] == 1)
{
backButton.hidden = YES;
startOverButton.hidden = YES;
}
else if ([questionsStack count] == maxStackcount){
backButton.hidden = YES;
startOverButton.hidden = YES;
}
else {
backButton.hidden = NO;
}

Last edited by m4s; 01-14-2011 at 09:35 AM. Reason: stupidity
m4s is offline   Reply With Quote
Old 01-14-2011, 10:36 AM   #7 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 7
AggieEMT is on a distinguished road
Default

I got around it by using a [questionsstack removeAllObjects] command in the StartOverButtonClicked function.

Next issue...

The back and start over buttons are moving around on me; I have them programmed in two ways, (depending on the screen they are displayed on): one graphically in the .xib file and one with code in the viewcontroller.m file.

When I load the app, the buttons aren't staying put according to where they should be in the .xib file; the ones programmed in the viewcontroller are constant and don't move. If I hit the screen referenced by the viewcontroller file, and return to the one with the .xib view, they all stay aligned properly...

thoughts?
AggieEMT 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: 407
11 members and 396 guests
AppleDev, chemistry, Emy, Gi-lo, ipodphone, mistergreen2011, pipposanta, QuantumDoja, Retouchable, SLIC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,924
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

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