I am new to ios developing. I have using a camera option in my iPhone application. I want to added zoom in and zoom out buttons on the Camera(UIImagePickerController). But, now i want to do zoom in and zoom out [the camera object] functions while clicking the buttons. How to do this? I alloc/init the UIImagePickerController in Class A. Zoom out button in Class B.
How to access the UIImagePickerController (In class A) from Class B?
I did the following,(for Zoom out button, it is in ClassB)
1. Import Class A in Class B.
2. Called the UIImagePickerController in this way,
ClassA *objA = [[ClassA alloc]init];
objA.imagePicker.cameraViewTransform = CGAffineTransformScale(imgpicker.cameraViewTransform, CAMERA_TRANSFORM_X+50, CAMERA_TRANSFORM_Y+50);
Now, this error is occurring (“imagePicker undeclared”).
How to solve this? I know it is very simple one, but i can’t solve this. Please help me to solve the problem.. Thanks in advance. Thanks for reading my poor English and spend your valuable time with me.
Here’s one solution: In Class B’s interface, put the declaration:
before the interface of Class B. Then add an iVar to Class B:
And include a property for it:
Then, when you create Class B from Class A, add an assignment:
Note that you are creating this as an assign, and that Class B will not be responsible for deallocing myClassA. It just has a pointer to it. Note that if you dealloc ClassA, though, the pointer from ClassB will no longer be valid.