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 Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-10-2011, 12:22 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 12
Zanzibar7 is on a distinguished road
Default How do I add an attribute to a UIImageView?

In my game I want to give one of my images a new attribute so that in my code I can say something like: myimage.myattribute = myinteger;
I don't know if you can even do that, but if you can then how?
Zanzibar7 is offline   Reply With Quote
Old 11-10-2011, 02:20 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 12
Zanzibar7 is on a distinguished road
Default I figured it out

I don't need help with this anymore, I figured it out. I made a subclass of UIImageView and added the integer to that, then used it for my image.
Zanzibar7 is offline   Reply With Quote
Old 11-12-2011, 02:50 AM   #3 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

I know u said u don't need help with this anymore, but I just read your thread and thought of an easy solution.

Each UIObjects have a "tag" property, which is INteger based. So, you can do something like

myimage.tag = myinteger;
rocotilos is offline   Reply With Quote
Old 11-12-2011, 01:41 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 12
Zanzibar7 is on a distinguished road
Default

Quote:
Originally Posted by rocotilos View Post
I know u said u don't need help with this anymore, but I just read your thread and thought of an easy solution.

Each UIObjects have a "tag" property, which is INteger based. So, you can do something like

myimage.tag = myinteger;
That sounds like a good idea but i also wanted to give it a CGPoint, so i think the way i did it works best for my needs.
Zanzibar7 is offline   Reply With Quote
Old 11-21-2011, 08:59 AM   #5 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

Quote:
Originally Posted by Zanzibar7 View Post
That sounds like a good idea but i also wanted to give it a CGPoint, so i think the way i did it works best for my needs.
Ok, that will work. But, just to remind, CGPoints consist of CGFloats, and not integers as u said earlier.
rocotilos 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: 375
10 members and 365 guests
apatsufas, comicool, Creativ, Dalia, dansparrow, LunarMoon, mer10, Murphy, pbart, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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