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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 07-01-2009, 11:47 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Question Using The Camera ?!?!

I already asked this question.
I'll ask again maybe i get some help this time
Do you see anything wrong with the code below.
After loading the view i try to load the camera, but nothing is howing.
Am i missing something?
Code:
@interface DisplayPicture : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
	UIImagePickerController* imagePicker;
}

@property (nonatomic,retain) UIImagePickerController* imagePicker;
@end
Code:
@implementation DisplayPicture
@synthesize imagePicker;

- (void)viewDidLoad {
    [super viewDidLoad];
	self.imagePicker = [[UIImagePickerController alloc] init];
	self.imagePicker.allowsImageEditing = YES;
	self.imagePicker.delegate = self;
	//* UIImagePickerControllerSourceTypeCamera : to load the camera
    // * UIImagePickerControllerSourceTypePhotoLibrary : to load images from library
    //* UIImagePickerControllerSourceTypeSavedPhotosAlbum : loads all images saved	
	self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
	imagePicker.allowsImageEditing = YES;  
	[self presentModalViewController:imagePicker animated:YES]; 
}

@end
Thanks for any help in advance
aryaxt is offline   Reply With Quote
Old 07-01-2009, 11:52 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 812
Default

Quote:
Originally Posted by aryaxt View Post
I already asked this question.
I'll ask again maybe i get some help this time
Do you see anything wrong with the code below.
After loading the view i try to load the camera, but nothing is howing.
Am i missing something?
Code:
@interface DisplayPicture : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
	UIImagePickerController* imagePicker;
}

@property (nonatomic,retain) UIImagePickerController* imagePicker;
@end
Code:
@implementation DisplayPicture
@synthesize imagePicker;

- (void)viewDidLoad {
    [super viewDidLoad];
	self.imagePicker = [[UIImagePickerController alloc] init];
	self.imagePicker.allowsImageEditing = YES;
	self.imagePicker.delegate = self;
	//* UIImagePickerControllerSourceTypeCamera : to load the camera
    // * UIImagePickerControllerSourceTypePhotoLibrary : to load images from library
    //* UIImagePickerControllerSourceTypeSavedPhotosAlbum : loads all images saved	
	self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
	imagePicker.allowsImageEditing = YES;  
	[self presentModalViewController:imagePicker animated:YES]; 
}

@end
Thanks for any help in advance
do not do it in viewDidLoad
johnqh is offline   Reply With Quote
Old 07-01-2009, 12:06 PM   #3 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Default

I did that, same result
aryaxt is offline   Reply With Quote
Old 07-01-2009, 12:18 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 812
Default

Where did you do?

Don't do it in any of the view loading code. use performSelector:withObject:afterDelay to run it after the run loop comes around.
johnqh is offline   Reply With Quote
Old 07-01-2009, 12:53 PM   #5 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Default

I did it in an ibaction, after the button is clicked
aryaxt is offline   Reply With Quote
Old 07-01-2009, 01:41 PM   #6 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Default

After clicking the button to load the camera all i get is a white screen

Last edited by aryaxt; 07-01-2009 at 03:09 PM.
aryaxt is offline   Reply With Quote
Old 07-20-2009, 03:35 PM   #7 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
Default

I used a uinavigationcontroller instead of a uiview,
Honestly i don't understand what the problem was but it seems like it's solved somehow.
Thanks to all replies
aryaxt is offline   Reply With Quote
Old 07-21-2009, 10:57 PM   #8 (permalink)
Registered Member
 
MikesTooLz's Avatar
 
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
Send a message via AIM to MikesTooLz
Default

im having this same issue.

I have a UIview inside a Tab Bar Controller
MikesTooLz is offline   Reply With Quote
Old 09-02-2010, 01:35 PM   #9 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 1
Default u dont have ur imageView Object setup

Hey, in ur .h file, add the following
{
..
UIImageView *bgImage;

}

@property(retain,nonatomic) UIImageView *bgImage;


in ur .m file,
use the ur IBAction method to fethc the picture alone.

use the didFinishPickingPhoto() to store the picture in ur UIImage object.

Hope it helps..
Ram


Quote:
Originally Posted by aryaxt View Post
I already asked this question.
I'll ask again maybe i get some help this time
Do you see anything wrong with the code below.
After loading the view i try to load the camera, but nothing is howing.
Am i missing something?
Code:
@interface DisplayPicture : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
	UIImagePickerController* imagePicker;
}

@property (nonatomic,retain) UIImagePickerController* imagePicker;
@end
Code:
@implementation DisplayPicture
@synthesize imagePicker;

- (void)viewDidLoad {
    [super viewDidLoad];
	self.imagePicker = [[UIImagePickerController alloc] init];
	self.imagePicker.allowsImageEditing = YES;
	self.imagePicker.delegate = self;
	//* UIImagePickerControllerSourceTypeCamera : to load the camera
    // * UIImagePickerControllerSourceTypePhotoLibrary : to load images from library
    //* UIImagePickerControllerSourceTypeSavedPhotosAlbum : loads all images saved	
	self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
	imagePicker.allowsImageEditing = YES;  
	[self presentModalViewController:imagePicker animated:YES]; 
}

@end
Thanks for any help in advance
ramkumar is offline   Reply With Quote
Reply

Bookmarks

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: 276
17 members and 259 guests
2WeeksToGo, ADY, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, iDifferent, mer10, mystic.purple, Rudy, smethorst, stoneage, superg, tathaastu, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,224
Posts: 380,732
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

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