Hey guys, so I have a button that opens an AlertView. In the alert view there is an option button to Choose New Photo. When you click Choose New Photo, it opens a UIActionSheet which show 2 options "Take a new picture" and "Choose from gallery".
When i click Take a new picture it opens the camera fine but will not allow me to take a picture.
(If i open the camera with a button straight from an alert view, the camera opens fine and take a picture. It just won't work to take a picture in UIActionSheet).
Any suggestions why this could happen?
Thanks in advance,
Steve
__________________
Don't be a quitter! Never give up and keep pushing to succeed at the things you love!
Post the code where you're presenting the image picker.
Quote:
Originally Posted by nickculbertson
My guess would be that you are not dismissing/releasing the actionsheet when your selection is made, however, all anyone can do is guess when no actual code is provided.
sorry, here is my .M file where all the main code is.
I have everything labeled in green so it sorts everything out.
Again, When you click New Game in the Alert View it opens a UIActionSheet which then you can take a new picture or choose from gallery. When taking a new picture i can open the camera but not take a picture.
Let me know if you need more information!
Thanks,
Steve
__________________
Don't be a quitter! Never give up and keep pushing to succeed at the things you love!
// Show image picker
[self presentModalViewController:imagePicker animated:YES];
// After saving iamge, dismiss camera
[self dismissModalViewControllerAnimated:YES];
And why are you dismissing the controller right after presenting?!
Code:
self.tiles = [[NSMutableArray alloc] init];
If tiles is a retain or copy type property, that is a leak.
By convention, class names should begin with an upper case letter.
There are 22 objects allocated in that file but much less release calls. You alloc/init a lot of view controllers which you present modally but you never release them.
// Show image picker
[self presentModalViewController:imagePicker animated:YES];
// After saving iamge, dismiss camera
[self dismissModalViewControllerAnimated:YES];
And why are you dismissing the controller right after presenting?!
Code:
self.tiles = [[NSMutableArray alloc] init];
If tiles is a retain or copy type property, that is a leak.
By convention, class names should begin with an upper case letter.
There are 22 objects allocated in that file but much less release calls. You alloc/init a lot of view controllers which you present modally but you never release them.
Okay thank you!
I added in all my missing releases and i know about the capitalization, i was using those files in another app for testing and then moved then to my good copy but didn't bother chaining the capitalizations. The camera is still not taking pictures when it is activated through a UIActionSheet.
Still trying to defeat this issue but pretty sure I'm slowly getting their!
__________________
Don't be a quitter! Never give up and keep pushing to succeed at the things you love!
I still haven't got the camera to take pictures when activating in a UIActionSheet, but I'm trying to fix my leaks first.
I know i still have i believe 3 leaks with my sound files which i am fixing right now and i still have a leak with: