 |
|
 |
|
 |
02-18-2009, 10:56 AM
|
#26 (permalink)
|
|
Registered Member
Join Date: May 2008
Posts: 583
|
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.
|
|
|
02-18-2009, 11:01 AM
|
#27 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 1,656
|
Quote:
Originally Posted by tkilmer
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.
|
|
|
02-18-2009, 11:06 AM
|
#28 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 1,656
|
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.
|
|
|
02-18-2009, 06:18 PM
|
#29 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 1,656
|
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!
|
|
|
03-25-2009, 12:16 PM
|
#30 (permalink)
|
|
New Member
Join Date: Mar 2009
Posts: 1
|
Quote:
Originally Posted by tkilmer
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.
|
|
|
03-28-2009, 12:13 PM
|
#31 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 436
|
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
|
|
|
06-01-2009, 11:39 AM
|
#32 (permalink)
|
|
New Member
Join Date: Jun 2009
Posts: 19
|
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?
|
|
|
06-01-2009, 12:29 PM
|
#33 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 436
|
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
|
|
|
06-02-2009, 02:44 AM
|
#34 (permalink)
|
|
New Member
Join Date: Jun 2009
Posts: 19
|
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.
|
|
|
07-03-2009, 11:45 PM
|
#35 (permalink)
|
|
Registered Member
Join Date: Dec 2008
Location: Oceanside, CA
Posts: 447
|
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)startCameraPickerFromViewController  UIViewC ontroller*)controller usingDelegate  id<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 presentModalViewController  icker animated:YES];
return YES;
}
|
|
|
12-27-2009, 10:40 AM
|
#36 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Posts: 1
|
Quote:
Originally Posted by daveh
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.
|
|
|
02-11-2010, 02:01 AM
|
#37 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Posts: 3
|
Quote:
Originally Posted by Magic Hands
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
|
|
|
 |
|
| 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: 390 |
| 29 members and 361 guests |
| abidins, activ8, aniuco, appbox, ataranlen, BSDimwit, chouchou, CHV, dkern, DonomaGames, Dracor, gbaldwin9, gedalia, iamjiex, javaconvert, joalta, JoshuaCaputo, kiancheong, Kyowoo, lukeca, Nori, Notable, pereorra, Piequanna, racer_X, sayer, scatterbrn, Shagpile, vargonian |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,145
Threads: 38,923
Posts: 170,776
Top Poster: smasher (2,565)
|
| Welcome to our newest member, user314159 |
|