Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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 02-18-2009, 10:56 AM   #26 (permalink)
Registered Member
 
tkilmer's Avatar
 
Join Date: May 2008
Posts: 583
Default

You are cursed. It is now not working for me. It always had worked for me in the past....

Edit: Got it and sending now.
tkilmer is offline   Reply With Quote
Old 02-18-2009, 11:01 AM   #27 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,656
Default

Quote:
Originally Posted by tkilmer View Post
You are cursed. It is now not working for me. It always had worked for me in the past....

Edit: Got it and sending now.

LOL; what was it? I was thinking maybe they changed something in the new SDK.
scotopia is offline   Reply With Quote
Old 02-18-2009, 11:06 AM   #28 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,656
Default

Thank you so much. I can't check it till I get home from work at 7; but when I find out what the issue was I'll post back here so hopefully no one else has to go through this; I'm sure its going to be something fantastically silly.
scotopia is offline   Reply With Quote
Old 02-18-2009, 06:18 PM   #29 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 1,656
Default

Turns out the issue is that the Image Picker can not be displayed immediately in the viewDidLoad method of the view controller; but it can if you set a delay of .1 seconds...weird

Thanks tKilmer!
scotopia is offline   Reply With Quote
Old 03-25-2009, 12:16 PM   #30 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 1
Default

Quote:
Originally Posted by tkilmer View Post
You are cursed. It is now not working for me. It always had worked for me in the past....

Edit: Got it and sending now.
For others like me (may also be cursed) can you post the relevant code on the thread? I'm running into the same exact issue as the OP. I tried setting a NSTimer as well but alas, no luck.

FYI, I'm experiencing this behavior on SDK versions 2.0-3.0.
insanetoucan is offline   Reply With Quote
Old 03-28-2009, 12:13 PM   #31 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 436
Default

he sent it to you through email... any chance you can post your code up here.. or even the whole project
im running into the same error you were
thanks!
-OG
orange gold is offline   Reply With Quote
Old 06-01-2009, 11:39 AM   #32 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 19
Default Please!!! POST IT!!!!!!

A couple of others have hit similar problems (me included), it appears you have a solution it would be nice to share it with others on this site.

What I don't understand is: (and please don't bother to answer, just an expression of sheer unadulterated frustration...)
a) Why its so damned complicated
b) Why it doesn't work
c) Why theres so little documentation
d) Why they had to invent another language
e) Why theres no apparent error return when it is clear that the display function may not work
f) Why I am being so stupid as to waste yet more of my life with a half baked solution when frankly other companies have done it already and better
g) Why I can't open two projects at once
h) Why I can't see windows on my mac that I've minimised
i) Why there are so many keys missing from this keyboard - what was wrong with going to the start and end of lines without waiting hours for the character by character cursor movement

In fact, why?
daveh is offline   Reply With Quote
Old 06-01-2009, 12:29 PM   #33 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 436
Default

when you implement it thorugh a UIView and not a UIView controller its laggy and a pain in the butt... also apple denies it for being against the "contract"... i had this happen in my app... what i ended up doing was adding a subview (uiView) to my UIViewController and in that UIView it had my normal MainView app but when i pressed a button it set a variable, removed my UIView (my subview) and went back to the UIViewController, in the UIViewController it has an NSTimer and when that variable is set the NSTimer detects it then adds the camera, once the photo is taken it adds back my subview and saves the photo to a UIView

its confusing but not against apples contract

p.s. remember when adding a subview to a UIViewController you cannot say
[self addSubview:myUiView];
you have to say
[self.view addSubview:myUiView];

good luck
orange gold is offline   Reply With Quote
Old 06-02-2009, 02:44 AM   #34 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 19
Default Thanks... but

my 'main window' has
@class cameraClass; // this is a controller

@interface hellomainwindow : UIView
{
IBOutlet cameraClass *myCamera;
IBOutlet UILabel *myMainViewText;
IBOutlet UIImageView *myCameraImage;
}


camera class is...
@interface cameraClass : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
{
UIView *windowView;
UILabel *windowText;
UIImageView *windowCameraImage;
UIImagePickerController *cameraImgPicker;
}


so cameraClass is a UIViewController

and startTheCamera is called when the button on main window is pressed

- (bool)startTheCamera: (UIView*) aView : (UILabel*)aWindowText: (UIImageView*)aWindowCameraImage
{
bool retval = false;

windowView = aView;
windowText = aWindowText;
windowCameraImage = aWindowCameraImage;


if ( (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourc eTypeCamera]))
{
windowText.text = @"Camera not available";
}
else
{
// now start the camera
windowText.text = @"Started picker";

self.view = windowView;
self.cameraImgPicker = [[UIImagePickerController alloc] init];
self.cameraImgPicker.allowsImageEditing = YES;
self.cameraImgPicker.delegate = self;
self.cameraImgPicker.view = windowView;
//// self.cameraImgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.cameraImgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

[self presentModalViewController:self.cameraImgPicker animated:YES];
retval = true;
}
return retval;
}

If I check 'self' wen I ask it to animate the cameraImgPicker the UIViewController member is full of nulls - including the UIView *_view member(looks totally uninitialised to me), in contrast a working program from the web seems to show this member has something in it. I can't work out how the difference occurs.
daveh is offline   Reply With Quote
Old 07-03-2009, 11:45 PM   #35 (permalink)
Registered Member
 
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 447
Default

Do you see a problem with this code?
I call this in a uiviewcontroller, and as soon as i call it the screen goes all blnak and white. The code is in uiimakepickercontroller documents, so i don't see why it shouldn't work

-(BOOL)startCameraPickerFromViewControllerUIViewC ontroller*)controller usingDelegateid<UIImagePickerControllerDelegate> )delegateObject
{
if ( (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourc eTypeCamera])
|| (delegateObject == nil) || (controller == nil))
return NO;

UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
picker.allowsImageEditing = YES;

// Picker is displayed asynchronously.
[controller presentModalViewControllericker animated:YES];
return YES;
}
aryaxt is offline   Reply With Quote
Old 12-27-2009, 10:40 AM   #36 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 1
Default

Quote:
Originally Posted by daveh View Post
i) Why there are so many keys missing from this keyboard - what was wrong with going to the start and end of lines without waiting hours for the character by character cursor movement
Ctrl+A, Ctrl+E

I haven't found all the hotkeys yet, but the equivalent of HOME/END is there, and it's emacs-like.
earlye is offline   Reply With Quote
Old 02-11-2010, 02:01 AM   #37 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 3
Default

Quote:
Originally Posted by Magic Hands View Post
This is what I use, hopefully it helps:
Code:
//--------------------------Handles Picking--------------------------
-(void)openPicker 
{
	if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) 
	{
		UIImagePickerController *picker;
		picker = [[UIImagePickerController alloc]init];
		picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
		picker.allowsImageEditing = YES;
		picker.delegate = self;
		[self presentModalViewController:picker animated:YES];
	}
}

-(void)imagePickerController:(UIImagePickerController *) picker
	   didFinishPickingImage:(UIImage *)imag 
				 editingInfo:(NSDictionary *)editingInfo  
{
	
	someImage = imag;
        [someImage retain];
	//Call some method here that you want to call after they take the picture
	[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
-(void)imagePickerController:(UIImagePickerController *) picker 
{
	[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

-(UIImage*)getTheImage
{
	return  image;
}
-(void)setTheImage:(UIImage*)img
{
	image = [img retain];
}
Good luck!

Hi Multi Hands,

I just wanted to draw some more attention to your solution. I have been trying to sort out the use of the UIImagePickerController within my iPhone for about 6 months. I had read probably around 50 posts on the memory issues around this.

I read in lots of places about the app crashing after 5 pictures. However, my app would sometimes work and sometimes crash immediately (switching off the iphone and then back on often helped since it freed up memory).

I found your solution last night and tried it and it worked! I can now carry on with an app that I had stopped developing so thank you VERY much!

I think the fact you increase the referencing count by 1 (using the retain method) is what has fixed my code.

Brilliant and really appreciated,

Charlie
seligmanc 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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,145
Threads: 38,923
Posts: 170,776
Top Poster: smasher (2,565)
Welcome to our newest member, user314159
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:39 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0