PLCameraController is not adding in viewcontroller
Posted
by sujyanarayan
on Stack Overflow
See other posts from Stack Overflow
or by sujyanarayan
Published on 2010-04-15T06:11:25Z
Indexed on
2010/04/15
6:13 UTC
Read the original article
Hit count: 303
iphone
|objective-c
Hi, I've declared PLCameraContoller instance in my AppDelegate class as:- self.cameraController = [PLCameraController performSelector:@selector(sharedInstance)];[cameraController setDelegate:self];
And I'm accessing it in one of my viewcontroller class as:- del = [[UIApplication sharedApplication] delegate]; UIView previewView = [del.cameraController performSelector:@selector(previewView)]; previewView.frame = CGRectMake(0,0, 320, 480); self.view = previewView; [del.cameraController performSelector:@selector(startPreview)]; [del.cameraController performSelector:@selector(setCameraMode:) withObject:(NSNumber)1];
Where "del" is an instance of my AppDelegate class.
But i can see only black background in my viewcontroller view in iphone device.
Also if i remove "self" from the appdelegate.m code of cameracontroller it also showing blank.
How can i get camera in my view controller? I'm pretty much struggling with it.
Thanks in Adv.
© Stack Overflow or respective owner