Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-18-2011, 07:14 PM   #1 (permalink)
Registered Member
 
aceiswild's Avatar
 
Join Date: Oct 2011
Location: Canada
Posts: 62
aceiswild is on a distinguished road
Default Open camera in UIActionSheet

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!
aceiswild is offline   Reply With Quote
Old 11-18-2011, 07:52 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Post the code where you're presenting the image picker.
baja_yu is offline   Reply With Quote
Old 11-18-2011, 08:15 PM   #3 (permalink)
Registered Member
 
aceiswild's Avatar
 
Join Date: Oct 2011
Location: Canada
Posts: 62
aceiswild is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Post the code where you're presenting the image picker.
Quote:
Originally Posted by nickculbertson View Post
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: 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
__________________
Don't be a quitter! Never give up and keep pushing to succeed at the things you love!
aceiswild is offline   Reply With Quote
Old 11-18-2011, 08:48 PM   #4 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Code:
[actionSheet showInView:self.view];
[actionSheet showFromRect:actionSheet.bounds inView:actionSheet animated:YES];
Why are you showing the action sheet twice?

Code:
        // 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.

Code:
#import "howtoplay.h"
#import "ourapps.h"
#import "puzzlecomplete.h"
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.
baja_yu is offline   Reply With Quote
Old 11-18-2011, 09:37 PM   #5 (permalink)
Registered Member
 
aceiswild's Avatar
 
Join Date: Oct 2011
Location: Canada
Posts: 62
aceiswild is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Code:
[actionSheet showInView:self.view];
[actionSheet showFromRect:actionSheet.bounds inView:actionSheet animated:YES];
Why are you showing the action sheet twice?

Code:
        // 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.

Code:
#import "howtoplay.h"
#import "ourapps.h"
#import "puzzlecomplete.h"
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!
aceiswild is offline   Reply With Quote
Old 11-18-2011, 11:53 PM   #6 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Did you fix the first two problems? Post your fixed code.
baja_yu is offline   Reply With Quote
Old 11-19-2011, 12:08 AM   #7 (permalink)
Registered Member
 
aceiswild's Avatar
 
Join Date: Oct 2011
Location: Canada
Posts: 62
aceiswild is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Did you fix the first two problems? Post your fixed code.
Here is my updated code: SliderController.m

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:
Code:
 self.sliderController = [[SliderController alloc] init];
which i am reading about in the link you gave me. Still getting used to Xcode 4.2 for iOS 5!! I found everything much easier in 4.1.
__________________
Don't be a quitter! Never give up and keep pushing to succeed at the things you love!
aceiswild is offline   Reply With Quote
Reply

Bookmarks

Tags
alert, camer, picker

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 389
17 members and 372 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, chiataytuday, dre, e2applets, ipodphone, jeroenkeij, leostc, matador1978, mbadegree, n00b, pbart, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:28 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0