Hi all
I am very new to obj-C programming and have little experience in other OOP languages. I have some basics which I draw upon to understand code.
I am making a small 'training' iphone project to teach myself Obj-C/iphone sdk through practice and I am kind of stuck.
Basically what my program is:
Step 1.
I have a main view controller with an UIImageView *imageview instance variable, a generic button 'trybutton' (I will explain its function in following step) and a button to open the 'photolibrary' modally and select a photo and display it as imageview.image = selectedimage. Where selectedimage is the variable that UIImagePicker stores the selected image. Then I dismisses the modal view.
Step 2.
Back on the main view controller, I can now see the selected image and then I press the other button 'trybutton' and another modal view 'Name' pops up. This modal view 'Name' has a button on it called 'Done'
Step 3
This done button is linked to a method:
Code:
-(IBACTION) donebtnpressed:(id)sender
{
[self someMethod:imageView.image];
}
What I want this 'Done' button, which exists on the modal view controller 'Name' is to take the imageView.image from the main view controller and pass it onto a method 'someMethod' that takes a UIImage as a parameter input.
But when I try this, when the method -(IBACTION) donebtnpressed

id)sender is called the imageView.image is empty and hence my 'someMethod' fails to give me the desired output.
Being a noobie. I cant work out how to have the imageView.image available to donebtnpressed method.
Can you please help? What I am thinking is I maybe need to store the contents of selectedimage in a variable that is available to all methods to access in the .m file. But I dont know how to do that. Am I looking to create a static variable?
Any help will be greatly appreciated.