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 09-12-2010, 02:43 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default How to make a image disappear if the score is high enough!

Hey! I am trying to make a app, when you get your score high enough a UIImageView will disappear. Would it go along the lines of: if score = 1000 UIImage remove? Something like that?
Thanks Brandon
unobrandon is offline   Reply With Quote
Old 09-12-2010, 04:35 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Quote:
Originally Posted by unobrandon View Post
Hey! I am trying to make a app, when you get your score high enough a UIImageView will disappear. Would it go along the lines of: if score = 1000 UIImage remove? Something like that?
Thanks Brandon
so you have an int, that represent the score. you have an imageview.

if(myScore>1000)
[myImageView release];


where is the problem?.
__________________
dany_dev is offline   Reply With Quote
Old 09-12-2010, 10:38 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by dany88 View Post
so you have an int, that represent the score. you have an imageview.

if(myScore>1000)
[myImageView release];


where is the problem?.
Ok i am kinda confused now. Si i put in this code:

if(Score>1000){
[platform1 release];
}

and i get a warning and it crashes.
Thanks
unobrandon is offline   Reply With Quote
Old 09-12-2010, 12:28 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by unobrandon View Post
Ok i am kinda confused now. Si i put in this code:

if(Score>1000){
[platform1 release];
}

and i get a warning and it crashes.
Thanks
Does anyone know?
Thanks
unobrandon is offline   Reply With Quote
Old 09-12-2010, 12:29 PM   #5 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 50
Paul10 is on a distinguished road
Default

You could just hide the image:

If your UIImageView is called image,

image.hidden = YES;
__________________
Paul
New iPhone Developer
Paul10 is offline   Reply With Quote
Old 09-12-2010, 12:30 PM   #6 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 50
Paul10 is on a distinguished road
Default

Oops, somehow posted 2x...can't seem to delete.
__________________
Paul
New iPhone Developer
Paul10 is offline   Reply With Quote
Old 09-12-2010, 12:45 PM   #7 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by Paul10 View Post
Oops, somehow posted 2x...can't seem to delete.
No that does not work? It is something to do with the if statement?
if(Score>1000){
platform1.hidden = YES;
}

The warning said: Comparison between pointer and integer.

Does anyone how to work this?
unobrandon is offline   Reply With Quote
Old 09-12-2010, 02:24 PM   #8 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 146
Yves is on a distinguished road
Default

Quote:
Originally Posted by unobrandon View Post
No that does not work? It is something to do with the if statement?
if(Score>1000){
platform1.hidden = YES;
}

The warning said: Comparison between pointer and integer.

Does anyone how to work this?
are u still there?
Yves is offline   Reply With Quote
Old 09-12-2010, 03:01 PM   #9 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by Yves View Post
are u still there?
yea? I want to know if anyone know how to solve this problem?
unobrandon is offline   Reply With Quote
Old 09-12-2010, 09:42 PM   #10 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by unobrandon View Post
yea? I want to know if anyone know how to solve this problem?
can someone please tell me?
unobrandon is offline   Reply With Quote
Old 09-12-2010, 10:26 PM   #11 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

The error message implies that Score is actually a pointer and not a number. You are going to have to post some code or we have no idea how to help you. We probably at least need to see where you are declaring Score and how you are using it.
JasonR is offline   Reply With Quote
Old 09-12-2010, 11:19 PM   #12 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by JasonR View Post
The error message implies that Score is actually a pointer and not a number. You are going to have to post some code or we have no idea how to help you. We probably at least need to see where you are declaring Score and how you are using it.
ok! thanks for responding. And here is the code that is declaring the score: score += (int)differance;
NSString *nssScore = [NSString stringWithFormat:@"Score:%i", score];
Score.text = nssScore;

does that help?
Thanks
unobrandon is offline   Reply With Quote
Old 09-13-2010, 04:30 AM   #13 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 15
Varedis is on a distinguished road
Default

"score" is your int, you are trying to check if your string "Score" > 1000 which is probably causing your crash
Varedis is offline   Reply With Quote
Old 09-13-2010, 09:43 PM   #14 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 31
unobrandon is on a distinguished road
Default

Quote:
Originally Posted by Varedis View Post
"score" is your int, you are trying to check if your string "Score" > 1000 which is probably causing your crash
O WOW!!!! it works thanks so much! Now the problem is that when the score hits 1000 it goes away, but when you touch it, it still effects the player? Is there any code where i can make it completely delete it self and stop rendering all of its code?
unobrandon is offline   Reply With Quote
Old 09-13-2010, 10:50 PM   #15 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 577
Speed is on a distinguished road
Default

Quote:
Originally Posted by unobrandon View Post
O WOW!!!! it works thanks so much! Now the problem is that when the score hits 1000 it goes away, but when you touch it, it still effects the player? Is there any code where i can make it completely delete it self and stop rendering all of its code?
[myimage removeFromSuperview];

That will remove it from the view not just hide it. You may want to release it after.
Speed is offline   Reply With Quote
Old 09-13-2010, 10:55 PM   #16 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 34
9livesoftware is on a distinguished road
Default

Quote:
Originally Posted by Speed View Post
[myimage removeFromSuperview];

That will remove it from the view not just hide it. You may want to release it after.
you could do that but only if he is making the image programmaitcly
9livesoftware 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: 348
9 members and 339 guests
cgokey, givensur, iGamesDev, jenniead38, mraalex, PixelInteractive, raihan.zbr, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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