Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
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
 

nickculbertson

macrumors regular
Nov 19, 2010
226
0
Nashville, TN
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.
 

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
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.

here is the link: http://www.mediafire.com/file/rwwb81c5cufrbjf/SliderController.m

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
 

nickculbertson

macrumors regular
Nov 19, 2010
226
0
Nashville, TN
Hmm. I'm not at my computer to test any of this (that's my disclaimer ;) ) but the line after you show the instance of the Alertview you should release it since the void method with the dismiss statement is commented out near the end. I wonder if the problem is happening when you call the actionsheet from the alertview? Are you able to get the camera working from the actionsheet via viewDidLoad (bypassing the alertview)? You could also try dismissing the actionview onclick like the alertview method which is commented out. It also seems funny that your picker is presented and then dismissed in the very next line. Perhaps the intent is to dismiss after an action occurs.

Good luck,
Nick
 

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
Hmm. I'm not at my computer to test any of this (that's my disclaimer ;) ) but the line after you show the instance of the Alertview you should release it since the void method with the dismiss statement is commented out near the end. I wonder if the problem is happening when you call the actionsheet from the alertview? Are you able to get the camera working from the actionsheet via viewDidLoad (bypassing the alertview)? You could also try dismissing the actionview onclick like the alertview method which is commented out. It also seems funny that your picker is presented and then dismissed in the very next line. Perhaps the intent is to dismiss after an action occurs.

Good luck,
Nick

Thanks nick,
I have release a bunch of things since i last posted my code to you.
It would not allow me to use ViewDidLoad with ViewDidAppear. Or else i would get an error message but the application would still run. So I commented out the ViewDidLoad and used ViewDidAppear which fixed that error.

The Camera will open in the action sheet but will not take a picture. If i open the camera in an alert view it will show fine and take a picture but will not dismiss!!! Its kind of weird. I could get the camera to load automatically by using ViewDidLoad but it should show my menu first.
If you want i can zip my project up and you could see if i have all my releases.
Im not looking for somebody to do my project, but hell, I've been having a headache with this for the past week!! So any help is very much appreciated!
If you do end up testing my puzzle at anytime just shake the phone to get back to the main menu. Also, please please don't steal my project like somebody did with my last one and i could not submit it!!
It would have to be tested on a device to activate the camera.

Thank you,
Steve
 
Last edited:

nickculbertson

macrumors regular
Nov 19, 2010
226
0
Nashville, TN
Wirelessly posted (Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5)

Work backwards. Try to get the camera to take pictures at the view's launch and then incorporate that code into your project. It probably has something to do with the camera delegate not being set up properly for dismissal. Fix that first.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.