Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Let me see if I have understood your question correctly. You have a button and you want to set an image on top of the button. Maybe this piece of code will help you out
if there is any confusion its because i didnt ask the question properly!
i have set up the button in interface builder, not in code (this is my first experience with interface builder, i usually do everything by code...)
i dont want to change the button image, all i want to do is display another image on the screen when a button is pressed.
the code works fine in that an image is displayed with the button is pressed. my problem is that the button is in the wrong place.
i am trying to set the center of the image to the center of the button so that the image sits on top of the button (no change to the actually button image).
currently, when i push the button the image is displayed in the top left hand corner of the screen (default 0,0 coordinates).
incidentally, I was also having trouble with my buttons not changing their image when they were being deactivated... I left that on the "to fix later" list but this solution also solved that problem... so double thank you!!