iphone - UIImagePickerController not working for iOS 3 yet works for iOS 4...backwards compatibility issue -


so created entire app , works flawlessly way envisioned. created update uses uiimages, , works on ios 4 , above. reason exact same code not work same on 3.0. since original app on store @ min os being 3, not want cut off user base because of silly mistake on part. i'm not doing new, should backwards compatible.

basically app takes image chosen either camera or photo album , saves it, , displays image on screen. when go next screen pulls image file off disk , displays in image view on next screen. again, works fine on ios4 , above.

using 3.0 sim on older version of xcode, not function same way. know allowimageediting changed allowediting, allowed that, else seems according docs, should work on ios 3 , above.

below going photo album , returning.

-(ibaction) getphotofromalbum { uiimagepickercontroller *picker = [[uiimagepickercontroller alloc] init]; picker.delegate = self;  if (editingswitch.on) {      #ifdef __iphone_3_0         picker.allowsimageediting = yes;     #else         picker.allowsediting = yes;     #endif } else if (!editingswitch.on) {      #ifdef __iphone_3_0         picker.allowsimageediting = no;     #else         picker.allowsediting = no;     #endif }  picker.sourcetype = uiimagepickercontrollersourcetypephotolibrary;  [self presentmodalviewcontroller:picker animated:yes];  [picker release]; 

}

-(void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info {  [picker dismissmodalviewcontrolleranimated:yes];  uiimage *image = nil;  if (editingswitch.on) {      image = [info objectforkey:@"uiimagepickercontrollereditedimage"];     [[nsuserdefaults standarduserdefaults] setbool:yes forkey:isimageedited];  } else if (!editingswitch.on) {      image = [info objectforkey:@"uiimagepickercontrolleroriginalimage"];     [[nsuserdefaults standarduserdefaults] setbool:no forkey:isimageedited];  }   imageview.image = [self imagewithimage:image];  imageview.hidden = no;  buttonpreview.hidden = yes;   [nsthread detachnewthreadselector:@selector(mythreadsavingimage) totarget:self withobject:nil];  [activitysaving startanimating]; 

when debug, seems info coming picker has 1 key. when sets image, image blank. no image ever comes , if rare occasion does, when edit picture , not use original, not show on next page.

hopefully can app finished besides 3.0 issue , frustrating want out soon.

turns out answer not working on simulator due updates xcode program. when installed onto 3.0 device, code worked perfectly.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -