merge two images into one image in iPhone - iphone

I need to merge two images into one image, here is my code:
-(UIImage*)mergeImage:(UIImage*)mask overImage:(UIImage*)source inSize:(CGSize)size
{
//Capture image context ref
UIImageView *totalimage=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
UIImageView *firstImage=[[UIImageView alloc] initWithImage:mask];
UIImageView *secondImage=[[UIImageView alloc] initWithImage:source];
[totalimage addSubview:firstImage];
[totalimage addSubview:secondImage];
UIGraphicsBeginImageContext(totalimage.bounds.size);
[totalimage.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//Draw images onto the context
[source drawInRect:CGRectMake(0, 0, source.size.width, source.size.height)];
[mask drawInRect:CGRectMake(0, 0, mask.size.width, mask.size.height)];
return viewImage;
}
I call this method as follows:
UIImage *totalImage = [self mergeImage:self.Apicimage overImage:questionImage inSize:CGSizeMake(100, 100)];
but on execution I get this output:
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSaveGState: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSetBlendMode: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSetAlpha: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextTranslateCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextScaleCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextConcatCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextDrawImage: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextRestoreGState: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSaveGState: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSetBlendMode: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextSetAlpha: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextTranslateCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextScaleCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextConcatCTM: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextDrawImage: invalid context 0x0
Jun 15 16:11:06 iPad-2 VueGuides[9195] <Error>: CGContextRestoreGState: invalid context 0x0
can anyone guide me please. How can I merge two images?

your code
[source drawInRect:CGRectMake(0, 0, source.size.width, source.size.height)];
[mask drawInRect:CGRectMake(0, 0, mask.size.width, mask.size.height)];
should be written before
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

Related

App crash in didFinishPickingMediaWithInfo

My app is crashing when the user records a video and then clicks choose. Here is my code:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
//picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType];
picker.allowsEditing = NO;
picker.delegate = self;
picker.videoQuality = UIImagePickerControllerQualityTypeMedium;
[self presentModalViewController:picker animated:YES];
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// [self dismissModalViewControllerAnimated:YES];
AppDelegate *del = [[UIApplication sharedApplication]delegate];
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
moviePath = [[info objectForKey:UIImagePickerControllerMediaURL]path];..//using this for upload
del.globalMoviePath = moviePath;
if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0)== kCFCompareEqualTo)
{
moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
del.globalMoviePath = moviePath;
picker.videoMaximumDuration = 60.0f;
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
NSLog(#"nrgkrg===>%#",moviePath);
videoUrl=(NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];
NSLog(#"Urlllll===>%#",videoUrl);
videoData = [NSData dataWithContentsOfURL:videoUrl];
del.globalMoviePath = moviePath;
NSLog(#"video is====>%#",del.globalMoviePath);
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoUrl];
UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
[player stop];
videoImage = [[UIImageView alloc]initWithImage:thumbnail];
//NSLog(#"imegsvideo====>%#",thumbnail);
//if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath))
//{
// UISaveVideoAtPathToSavedPhotosAlbum (moviePath, self, #selector(video:didFinishSavingWithError:contextInfo:), nil);
// }
//MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoUrl];
//UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
}
[self dismissModalViewControllerAnimated:YES];
//[[picker parentViewController] dismissModalViewControllerAnimated: YES];
}
When the user records a video and clicks choose app gets crashed but works fine when selected from camera roll.
Please help!!
Here's the log:
Nov 29 20:28:14 ReportCrash[259] <Notice>: Formulating crash report for process [254]
Nov 29 20:28:14 com.apple.launchd[1] <Warning>: (UIKitApplication:[0xcc37]) Job appears to have crashed: Segmentation fault: 11
Nov 29 20:28:14 backboardd[52] <Warning>: Application 'UIKitApplication:[0xcc37]' exited abnormally with signal 11: Segmentation fault: 11
Nov 29 20:28:14 ReportCrash[259] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Nov 29 20:28:14 ReportCrash[259] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/ using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) mstreamd: Checking on job state for Photo Stream
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) mstreamd: No jobs scheduled for Photo Stream.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) mstreamd: Checking on job state for Shared Stream
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) mstreamd: No jobs scheduled for Shared Stream.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) PS: Media stream daemon stopping.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1ee72590>: Shared Streams daemon shutting down.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1ee72590>: Shutting down state machine for personID 1446684163.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSASStateMachine: 0x1ed3e060>: Shutting down uploader.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSASStateMachine: 0x1ed3e060>: Shutting down downloader.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSASStateMachine: 0x1ed3e060>: Shutting down state machine.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1ee72590>: Shutting down model.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSASServerSideModel: 0x1ed39d50>: Command Queue has shut down.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1ee72590>: Model has shut down.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1ee72590>: Shared Streams daemon has shut down.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Note ) mstreamd: <MSPowerBudget: 0x1ed394b0>: Stopping post-foreground timer.
Nov 29 20:28:38 mstreamd[257] <Notice>: (Warn ) mstreamd: mstreamd shutting down.
Nov 29 20:49:16 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_screen_off even though we are not in it, doing nothing
Nov 29 20:49:16 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableDetect 0
Nov 29 20:49:16 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableType Detached
Nov 29 20:49:16 kernel[0] <Debug>: virtual IOReturn AppleUSBDeviceMux::message(UInt32, IOService *, void *) - kMessageInterfaceWasDeActivated
Nov 29 20:49:16 kernel[0] <Debug>: AppleUSBDeviceMux::reportStats: USB mux statistics:
Nov 29 20:49:16 kernel[0] <Debug>: USB mux: 190 reads / 0 errors, 899 writes / 0 errors
Nov 29 20:49:16 kernel[0] <Debug>: USB mux: 0 short packets, 0 dups
Nov 29 20:49:16 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_charging even though we are not in it, doing nothing
Nov 29 20:49:16 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_screen_off even though we are not in it, doing nothing
Nov 29 20:49:16 ptpd[104] <Notice>: PTP interface has been deactivated.
Nov 29 20:49:18 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_asleep even though we are not in it, doing nothing
Nov 29 20:49:18 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableDetect 1
Nov 29 20:49:18 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableType USBHost
Nov 29 20:49:18 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_screen_off even though we are not in it, doing nothing
Nov 29 20:49:18 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_screen_off even though we are not in it, doing nothing
Nov 29 20:49:19 ptpd[104] <Notice>: PTP interface has been activated at high speed.
Nov 29 20:49:56 lockdownd[29] <Notice>: 2fe93000 special_case_get: MGCopyAnswer(kMGQMobileEquipmentIdentifier) returned NULL
Nov 29 20:49:56 lockdownd[29] <Notice>: 2fe93000 copy_phonenumber: CTSettingCopyMyPhoneNumber() returned NULL
Nov 29 20:49:56 mobile_installation_proxy[265] <Error>: 0x3cbd7b88 MobileInstallationSlowLookupBreak: MobileInstallationBrowse was called without specifying an options dictionary containing kLookupReturnAttributesKey. This usage is inefficient and may cause performance problems. Break on MobileInstallationSlowLookupBreak to debug.
Nov 29 20:49:56 mobile_installation_proxy[265] <Error>: 0x3cbd7b88 MobileInstallationSlowLookupBreak: Existing options dictionary: <CFBasicHash 0x1c545b90 [0x3bfb1100]>{type = mutable dict, count = 1,
entries =>
6 : <CFString 0x1c545bc0 [0x3bfb1100]>{contents = "ApplicationType"} = <CFString 0x1c545b30 [0x3bfb1100]>{contents = "User"}
}
Nov 29 20:49:57 mc_mobile_tunnel[267] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:49:57 mc_mobile_tunnel[267] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:49:57 mc_mobile_tunnel[268] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:49:57 mc_mobile_tunnel[268] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:49:57 lockdownd[29] <Notice>: 2fe93000 set_response_error: handle_start_session SessionActive
Nov 29 20:49:57 lockdownd[29] <Notice>: 2fe93000 set_response_error: handle_start_session SessionActive
Nov 29 20:50:03 mc_mobile_tunnel[270] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:50:03 mc_mobile_tunnel[270] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:51:31 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_screen_off even though we are not in it, doing nothing
Nov 29 20:51:31 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableDetect 0
Nov 29 20:51:31 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableType Detached
Nov 29 20:51:31 kernel[0] <Debug>: virtual IOReturn AppleUSBDeviceMux::message(UInt32, IOService *, void *) - kMessageInterfaceWasDeActivated
Nov 29 20:51:31 kernel[0] <Debug>: AppleUSBDeviceMux::reportStats: USB mux statistics:
Nov 29 20:51:31 kernel[0] <Debug>: USB mux: 195 reads / 0 errors, 493 writes / 0 errors
Nov 29 20:51:31 kernel[0] <Debug>: USB mux: 0 short packets, 0 dups
Nov 29 20:51:31 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_charging even though we are not in it, doing nothing
Nov 29 20:51:31 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_screen_off even though we are not in it, doing nothing
Nov 29 20:51:31 ptpd[104] <Notice>: PTP interface has been deactivated.
Nov 29 20:51:41 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_asleep even though we are not in it, doing nothing
Nov 29 20:51:41 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableDetect 1
Nov 29 20:51:41 kernel[0] <Debug>: AppleD1881PMUPowerSource: AppleUSBCableType USBHost
Nov 29 20:51:41 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state unplugged_screen_off even though we are not in it, doing nothing
Nov 29 20:51:41 UserEventAgent[13] <Warning>: PLAggregateState Error: Leaving state pluggedin_screen_off even though we are not in it, doing nothing
Nov 29 20:51:41 ptpd[272] <Error>: ptpd: startResponder
Nov 29 20:51:41 kernel[0] <Debug>: launchd[272] Builtin profile: ptpd (sandbox)
Nov 29 20:51:42 ptpd[272] <Notice>: PTP interface has been activated at high speed.
Nov 29 20:51:43 lockdownd[29] <Notice>: 2ffcf000 verify_pair_record: The strings don't match. Is this really a UUID?
Nov 29 20:51:43 lockdownd[29] <Notice>: 2ffcf000 store_escrow_record: Creating escrow bag (hash=9263ecf9c114f3a5cecdf7a52df193b4ce25044f) for 30264900-17792825678462560
Nov 29 20:51:52 lockdownd[29] <Notice>: 01442000 verify_pair_record: The strings don't match. Is this really a UUID?
Nov 29 20:51:52 lockdownd[29] <Notice>: 01442000 store_escrow_record: Creating escrow bag (hash=9de39584e1758f58137d28e4bd8c2fd79b5ba0a2) for 30264900-1682617038156454252
Nov 29 20:51:53 lockdownd[29] <Notice>: 01442000 special_case_get: MGCopyAnswer(kMGQMobileEquipmentIdentifier) returned NULL
Nov 29 20:51:53 lockdownd[29] <Notice>: 01442000 copy_phonenumber: CTSettingCopyMyPhoneNumber() returned NULL
Nov 29 20:51:53 mobile_installation_proxy[275] <Error>: 0x3cbd7b88 MobileInstallationSlowLookupBreak: MobileInstallationBrowse was called without specifying an options dictionary containing kLookupReturnAttributesKey. This usage is inefficient and may cause performance problems. Break on MobileInstallationSlowLookupBreak to debug.
Nov 29 20:51:53 mobile_installation_proxy[275] <Error>: 0x3cbd7b88 MobileInstallationSlowLookupBreak: Existing options dictionary: <CFBasicHash 0x1c5119d0 [0x3bfb1100]>{type = mutable dict, count = 1,
entries =>
6 : <CFString 0x1c511a00 [0x3bfb1100]>{contents = "ApplicationType"} = <CFString 0x1c511970 [0x3bfb1100]>{contents = "User"}
}
Nov 29 20:51:53 mc_mobile_tunnel[277] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:51:53 mc_mobile_tunnel[277] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:51:53 mc_mobile_tunnel[278] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:51:53 mc_mobile_tunnel[278] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:51:55 mc_mobile_tunnel[280] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:51:55 mc_mobile_tunnel[280] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
Nov 29 20:52:01 iPhone4S mc_mobile_tunnel[282] <Notice>: (Note ) MC: mc_mobile_tunnel starting.
Nov 29 20:52:01 iPhone4S mc_mobile_tunnel[282] <Notice>: (Note ) MC: mc_mobile_tunnel shutting down.
this is because may be you are dismissing view just after dismissing picker:
[picker dismissModalViewControllerAnimated:YES];
[self dismissModalViewControllerAnimated:YES];
as you have used animated YES, the picker is not yet dismissed so either use new API
[picker dismissViewControllerAnimated:YES completion:^{
[self dismissModalViewControllerAnimated:YES];
}];
The App is crashes because in iOS6 [self dismissModalViewControllerAnimated:YES];
is deprecated you replace it with [picker dismissViewControllerAnimated:YES completion:nil]; may solve you issue.

App self unInstall iOS iphone

My app was auto Uninstall last night and I spend all day to found how it happened, but found nothing.
Here is the Console log:
Nov 5 20:54:48 CommCenter[62] <Notice>: MessageCenterModel is telling PDP context -1 to go active.
Nov 5 20:54:48 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/DSPersonID -> 1110853068
Nov 5 20:54:48 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/DSPersonID -> 1110853068
Nov 5 20:54:48 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/DSPersonID -> 1110853068
Nov 5 20:54:48 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/DSPersonID -> 1110853068
Nov 5 20:54:48 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/DSPersonID -> 1110853068
Nov 5 20:54:49 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/downloaded-apps -> <CFArray 0x1f533830 [0x3d1f9100]>{type = immutable, count = 9, values = (
0 : <CFString 0x1f54d7e0 [0x3d1f9100]>{contents = "com.magikid.numbersflipbook"}
1 : <CFString 0x1f54d700 [0x3d1f9100]>{contents = "com.angellecho.magikidstage"}
2 : <CFString 0x1f54c1c0 [0x3d1f9100]>{contents = "net.delusionstudio.cocomongslabfree"}
3 : <CFString 0x1f54cdf0 [0x3d1f9100]>{contents = "com.magikid.MagKidTail"}
4 : <CFString 0x1f54b5d0 [0x3d1f9100]>{contents = "com.angellecho.magikid.train"}
5 : <CFString 0x1f5335b0 [0x3d1f9100]>{contents = "com.subsplashstudio34.Church-of-the-Foothills"}
6 : <CFString 0x1f54d910 [0x3d1f9100]>{contents = "com.bingoapp.yzjj.MagicSong"}
7 : <CFString 0x1f54d0c0 [0x3d1f9100]>{contents = "com.trisw.Pinocchio"}
8 : <CFString 0x1f54c3b0 [0x3d1f9100]>{contents = "com.scholarandsaint.paddywhacks"}
)}
Nov 5 20:54:52 lockdownd[29] <Notice>: 2ff83000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/PurchaseTypes -> (null)
Nov 5 20:54:52 lockdownd[29] <Notice>: 2fe93000 set_itunes_value: set com.apple.mobiffle.iTunes.store/LibraryCUID to b4e09adbe3c01c22e1e68d4b6bb09ae5 succeeded
Nov 5 20:55:01 installd[31] <Error>: 0x2ff98000 handle_uninstall: Uninstall requested by atc
Nov 5 20:55:02 installd[31] <Error>: 0x2ff98000 MobileInstallationUninstall_Server: Uninstalling com.**.**
Nov 5 20:55:02 SpringBoard[69] <Warning>: Killing com.**.** for termination assertion
Nov 5 20:55:02 lsd[698] <Warning>: LaunchServices: Could not store lsd-identifiers file
Nov 5 20:55:02 lsd[698] <Warning>: LaunchServices: Could not store lsd-identifiers file
Nov 5 20:55:02 installd[31] <Error>: 0x20e000 __block_global_6: LS failed to unregister application file://localhost/private/var/mobile/Applications/8D93D99D-7D7F-41CE-9093-3C24E1EA3F1C/**.app/ (com.**.**)
Nov 5 20:55:02 SpringBoard[69] <Warning>: Reloading and rendering all application icons.
Nov 5 20:55:02 com.apple.launchd[1] <Notice>: (UIKitApplication:com.**.**[0xf31a]) Exited: Killed: 9
Nov 5 20:55:02 backboardd[52] <Warning>: Application 'UIKitApplication:com.**.**[0xf31a]' exited abnormally with signal 9: Killed: 9
Nov 5 20:55:03 SpringBoard[69] <Warning>: An application that SpringBoard is not tracking with bundle identifier com.**.** just exited.
Nov 5 20:55:03 SpringBoard[69] <Warning>: No transaction in -[SBWorkspace workspace:applicationWillBecomeReceiver:fromApplication:]
Nov 5 20:55:03 SpringBoard[69] <Warning>: No transaction in -[SBWorkspace workspace:applicationDidBecomeReceiver:fromApplication:]
Nov 5 20:55:03 installd[31] <Error>: 0x2ff98000 __MobileInstallationClearUninstalled_Server_block_invoke_0: Removing id com.angellecho.iphone.drluke from uninstalled list
You can see Uninstall requested by atc. I wonder what atc is.
As console log, you can see the system kill my app when it running. When I am back to the desktop, the icon disappeared!
My iPhone is not jailBreak. My app is in compiled in Debugger configuration (according to XCode).

Random img saving error on some iPhone 4s and iPod Touches

i encountered a weird error. i will like the app to save an image into camera roll.
but a small amount of device are giving me error saving msg.
EDIT: ERROR Log
"Failed to encode image for saved photos." UserInfo=0x3e7170 {NSUnderlyingError=0x389310 "Failed to encode image for saved photos.", NSLocalizedDescription=Failed to encode image for saved photos.
May 22 14:13:34 unknown assetsd[281] <Error>: ImageIO: CGImageDestinationAddImage image parameter is nil
May 22 14:13:34 unknown assetsd[281] <Error>: ImageIO: CGImageDestinationFinalize image destination does not have enough images
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetBaseCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSaveGState: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextSetFillColorWithColor: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextFillRects: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetBaseCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSaveGState: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextSetFillColorWithColor: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextFillRects: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextScaleCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextConcatCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextDrawImage: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextConcatCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextTranslateCTM: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextDrawImage: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGContextRestoreGState: invalid context 0x0
May 22 14:13:34 unknown assetsd[281] <Error>: CGBitmapContextCreateImage: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGContextRestoreGState: invalid context 0x0
May 22 14:13:34 unknown com.apple.assetsd[281] <Notice>: May 22 14:13:34 SLQ-iTouch assetsd[281] <Error>: CGBitmapContextCreateImage: invalid context 0x0
>
below are my code used to save the images.
- (IBAction)saveImage:(id)sender {
HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.dimBackground = YES;
HUD.labelText = #"Its saving!";
self.imageOverlay.alpha = 1;
self.savedImage = [self maskImage:self.imgView withMask:self.baseImgView];
UIImageWriteToSavedPhotosAlbum(self.savedImage, self, #selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), nil);
}
- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
NSString *message;
NSString *title;
if (!error) {
title = NSLocalizedString(#"Save Success", #"");
message = NSLocalizedString(#"Save Success Message", #"");
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:#"Checkmark.png"]];
HUD.mode = MBProgressHUDModeCustomView;
HUD.labelText = #"We’re saved - WooHoo!!";
[HUD hide:YES afterDelay:1.5];
saved =1;
self.imageOverlay.alpha =0.85;
[self performSelector:#selector(saveSuccess) withObject:nil afterDelay:1.5];
} else
{
title = NSLocalizedString(#"Save Failed", #"");
message = [error description];
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:#"sad_face.png"]];
HUD.mode = MBProgressHUDModeCustomView;
HUD.labelText = #"Error! Try saving photo again :p";
[HUD hide:YES afterDelay:3];
}
}
- (UIImage*) maskImage:(UIImageView *)maskImage withMask:(UIImageView *)cropImage
{
UIImage *image = nil;
UIImage *imagePNG = nil;
CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);
UIGraphicsBeginImageContextWithOptions(newImageSize, NO, 0.0); //retina res
[self.viewForImg.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *imgData = UIImagePNGRepresentation ( image ); // get PNG representation
imagePNG = [UIImage imageWithData:imgData]; // wrap UIImage around PNG representation
return imagePNG;
}
- (UIImage*) maskImage:(UIImageView *)maskImage withMask:(UIImageView *)cropImage
{
UIImage *image = nil;
UIImage *imagePNG = nil;
CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);
UIGraphicsBeginImageContextWithOptions(newImageSize, NO, 0.0); //retina res
[self.viewForImg.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
NSData *imgData = UIImagePNGRepresentation ( image ); // get PNG representation
imagePNG = [UIImage imageWithData:imgData]; // wrap UIImage around PNG representation
UIGraphicsEndImageContext();
return imagePNG;
}

Application Crashed - Wired Crash

What does this error mean?
Nov 8 17:57:10 unknown configd[25] <Notice>: jetsam: kernel memory event (91), free: 670, active: 2840, inactive: 2253, purgeable: 0, wired: 15143
Nov 8 17:57:11 unknown SpringBoard[92] <Warning>: Received memory warning. Level=2
Nov 8 17:57:11 unknown MobileMail[6432] <Warning>: Received memory warning. Level=2
Nov 8 17:57:11 unknown configd[25] <Notice>: jetsam: kernel termination snapshot being created
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobileipod[0xe0a1]) Exited: Killed: 9
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilemail[0xbebe]) Exited: Killed: 9
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:paradigm.PaymentSystemiPad[0x6c80]) Bug: launchd_core_logic.c:3795 (24506):0
Nov 8 17:57:11 unknown DTMobileIS[6377] <Warning>: _memoryNotification : <NSThread: 0x1c5361d0>{name = (null), num = 1}
Nov 8 17:57:11 unknown com.apple.debugserver-50[6480] <Warning>: 1 [1950/1503]: error: ::read ( 4, 0x2ff669f0, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:paradigm.PaymentSystemiPad[0x6c80]) Bug: launchd_core_logic.c:3794 (24506):3
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:paradigm.PaymentSystemiPad[0x6c80]) Bug: launchd_core_logic.c:3202 (24506):10
Nov 8 17:57:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:paradigm.PaymentSystemiPad[0x6c80]) Working around 5020256. Assuming the job crashed.
Nov 8 17:57:11 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:paradigm.PaymentSystemiPad[0x6c80]) Job appears to have crashed: Segmentation fault: 11
Nov 8 17:57:11 unknown SpringBoard[92] <Warning>: Application 'Mail' exited abnormally with signal 9: Killed: 9
Nov 8 17:57:12 unknown DTMobileIS[6377] <Warning>: _memoryNotification : {
OSMemoryNotificationLevel = 0;
timestamp = "2011-11-08 12:27:11 +0000";
}
Nov 8 17:57:12 unknown DTMobileIS[6377] <Warning>: _memoryNotification : <NSThread: 0x1c5361d0>{name = (null), num = 1}
Nov 8 17:57:12 unknown DTMobileIS[6377] <Warning>: _memoryNotification : {
OSMemoryNotificationLevel = 0;
timestamp = "2011-11-08 12:27:12 +0000";
}
Nov 8 17:57:12 unknown SpringBoard[92] <Warning>: Application 'PaymentSystemiPad' exited abnormally with signal 11: Segmentation fault: 11
Nov 8 17:57:12 unknown SpringBoard[92] <Warning>: Application 'iPod' exited abnormally with signal 9: Killed: 9
Nov 8 17:57:12 unknown kernel[0] <Debug>: launchd[6486] Builtin profile: MobileMail (sandbox)
Nov 8 17:57:13 unknown ReportCrash[6485] <Error>: libMobileGestalt loadBasebandMobileEquipmentInfo: CommCenter error: 1:45
Nov 8 17:57:13 unknown ReportCrash[6485] <Error>: libMobileGestalt copyInternationalMobileEquipmentIdentity: Could not get mobile equipment info dictionary
Nov 8 17:57:13 unknown ReportCrash[6485] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2011-11-08-175713.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Nov 8 17:59:12 unknown SpringBoard[92] <Notice>: MultitouchHID(1f55bf50) uilock state: 0 -> 1
This mean that you have allocated a lot of memory and Received memory warning. I assume you have memory leaks or load many images/resources into memory. Try to research your code and find places where you load resources.

iPhone Choking on Certain Image Formats

My app allows upload of an image from the camera roll. Some images are causing the app to crash when I attempt to save them to my documents directory prior to upload. I'm converting the image to a PNG prior to saving, but that hasn't helped. Here's the error...
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 32 bits/pixel; 3-component color space; kCGImageAlphaLast; 1600 bytes/row.
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextConcatCTM: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextDrawImage: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGBitmapContextCreateImage: invalid context 0x0
and here's a sample of my code...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *img = [info objectForKey:#"UIImagePickerControllerOriginalImage"];
NSData *pngData = UIImagePNGRepresentation(img);
UIImage *pngImg = [UIImage imageWithData:pngData];
... code to save image ...
}
Note also that what you are doing is redundant and a waste of memory. img and pngImg are the same. Or is there a specific reason that you convert an image to png and then back to an image?