camera problem in iphone sdk - xcode

i would like to open camera in my tab bar app..
i have open the camera but i could not taken the picture because i didnt find the camera symbol in that screen so please tell me how i can i show the camera button(for capture) in camera view? i am also tested it in my iPhone. camera opened but i could not find any button to pick the image.. how can i got if?
Thank You..
code is
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[Delegate presentModalViewController:picker animated:YES];

use
[self presentModalViewController:picker animated:YES];
instead of
[Delegate presentModalViewController:picker animated:YES];

Related

Presented UIImagePickerController camera could take photo or cancel

I have UIImagePickerController which opens a camera, as the sample code bellow shows.
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
imagePicker.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentViewController:imagePicker
animated:YES
completion:NULL];
My Problem: When I present the camera, the camera shows, but I could not take a picture nor tap to cancel. Even the flip camera icon does not respond.
Happening on iOS versions below 8, iPad.
i tried your code and its working on iPad 2 iOs7.1.2
you might try using setters, this is how i am doing it
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[picker setAllowsEditing:YES];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
[picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[picker setModalPresentationStyle:UIModalPresentationPageSheet];
}
else
[picker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[picker setDelegate:self];
[self presentViewController:picker animated:YES completion:nil];

drawViewHierarchyInRect, blinking when presenting SLComposeViewController

So, let's say I want to make screenshot and post it on Twitter. SLComposeViewController is blinking when presenting.
UIImage *image;
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
[self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
SLComposeViewController *compose = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[compose addImage:image];
[self presentViewController:compose animated:YES completion:nil];
The behavior occurs only when "afterScreenUpdates:YES", "afterScreenUpdates:NO" makes no blinking.
Why does it blink? I test it on iPhone 5.
I know this is a bit old but here is what worked for me:
Set afterScreenUpdates:NO

How to pick image from Photos Library in iPad using iOS6?

I have tried to implement the code for picking image from photos library in iPad using iOS6 but it is not working. The code i tried is shown below.
UIImagePickerController *imagePickerController=[[UIImagePickerController alloc] init];
imagePickerController.delegate=self;
UIPopoverController *popover=[[UIPopoverController alloc] initWithContentViewController:imagePickerController];
popover.delegate=self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) {
imagePickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[popover presentPopoverFromRect:CGRectMake(400, 400, 0, 0) inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
Can any one please tell me the solution for this issue.
Any help will be appreciated

How can I open modal view (formsheet) from UITableView?

I am tired try open a modal view controller from ipad application.
How I can show a modal view like formsheet?
here my code block.
like this style opening a window (full screen) but there is don't have any object from my modal view
viewDetail *hd = [[viewDetail alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
just i want open a formSheet modal view when selected a value from UITableView
by the way, i am development on xcode 4.2.1 and usind storyboard features
thanks for help.
like that give a SIGABRT error
viewDetail *hd = [[viewDetail alloc] initWithNibName:#"viewDetail" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:hd];
hd.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentModalViewController:nav animated:YES];
[hd release];
[nav release];
I fixed my solution, worked a xib file out of story board.
But why wasn't it working in storyboard? There is a way for that?
If you're using storyboards, you have to set [self.storyboard instantiateViewControllerWithIdentifier:#"viewDetail"]; as your viewDetail View Controller. (Assuming you set the Storyboard Identifier accordingly)
hope that helps.

Xcode mouse and NSView basic help?

I am making an app for school and I would love to change the cursor picture when the mouse is clicked in a certain NSView area.
I know that you can use mousedown, mouseup and other events, but I don't really know how to put them in my code in order for the cursor picture change to work.
Have the custom NSView and override resetCursorRect,
Refer the example code below
-(void)resetCursorRects{
//[self log:#"Inside Reset Cursor Rect"];
NSRect viewRect = [self frame];// change it accordingly
[self addCursorRect:viewRect cursor:[NSCursor pointingHandCursor]];
viewRect = [self.pMailImageView frame];
[self addCursorRect:viewRect cursor:[NSCursor pointingHandCursor]];
viewRect = [self.pDialImageView frame];
[self addCursorRect:viewRect cursor:[NSCursor pointingHandCursor]];
}

Resources