07-01-2009, 11:47 AM
#1 (permalink )
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
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
07-01-2009, 11:52 AM
#2 (permalink )
Registered Member
Join Date: Nov 2008
Posts: 812
Quote:
Originally Posted by
aryaxt
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
07-01-2009, 12:06 PM
#3 (permalink )
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
I did that, same result
07-01-2009, 12:18 PM
#4 (permalink )
Registered Member
Join Date: Nov 2008
Posts: 812
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.
07-01-2009, 12:53 PM
#5 (permalink )
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
I did it in an ibaction, after the button is clicked
07-01-2009, 01:41 PM
#6 (permalink )
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
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 .
07-20-2009, 03:35 PM
#7 (permalink )
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 570
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
07-21-2009, 10:57 PM
#8 (permalink )
Registered Member
Join Date: Jan 2009
Location: Miami, Florida
Posts: 211
im having this same issue.
I have a UIview inside a Tab Bar Controller
09-02-2010, 01:35 PM
#9 (permalink )
Registered Member
Join Date: Sep 2010
Posts: 1
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
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
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
» 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