mtonio91 / AMSmoothAlert

Cool AlertView
MIT License
1.26k stars 158 forks source link

Crash Issue #29

Open purepure opened 10 years ago

purepure commented 10 years ago

I am trying to integrate that library into my project but at anytime I call this function, it crash my app AMSmoothAlertView *ale = [[AMSmoothAlertView alloc]initFadeAlertWithTitle:NSLocalizedString(@"Database Error", nil) andText:NSLocalizedString(@"Database is not created normally", nil) andCancelButton:YES forAlertType:AlertFailure]; [ale show];

----------------------------Log-------------------------------- * Assertion failure in -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:], /Pods/GPUImage/framework/Source/iOS/GPUImagePicture.m:74 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Passed image must not be empty - it should be at least 1px tall and wide' * First throw call stack: ( 0 CoreFoundation 0x02e5d1e4 exceptionPreprocess + 180 1 libobjc.A.dylib 0x02bdc8e5 objc_exception_throw + 44 2 CoreFoundation 0x02e5d048 +[NSException raise:format:arguments:] + 136 3 Foundation 0x0085e4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 0x000c7a40 -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:] + 624 0x000c766a -[GPUImagePicture initWithCGImage:] + 90 0x000c4f46 -[GPUImageOutput newCGImageByFilteringCGImage:] + 102 0x000c5288 -[GPUImageOutput imageByFilteringImage:] + 120 0x00068b66 -[AMSmoothAlertView performScreenshotAndBlur] + 102 0x000687c1 -[AMSmoothAlertView alertPopupView] + 1249 0x000681a5 -[AMSmoothAlertView _initViewWithTitle:andText:andCancelButton:forAlertType:andColor:] + 837 0x000675c4 -[AMSmoothAlertView initFadeAlertWithTitle:andText:andCancelButton:forAlertType:andColor:] + 340 0x000673f8 -[AMSmoothAlertView initFadeAlertWithTitle:andText:andCancelButton:forAlertType:] + 200 0x0001e0c5 -[AppDelegate application:didFinishLaunchingWithOptions:] + 821 14 UIKit 0x010ce14f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309 15 UIKit 0x010ceaa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810 16 UIKit 0x010d3667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 17 UIKit 0x010e7f92 -[UIApplication handleEvent:withNewEvent:] + 3517 18 UIKit 0x010e8555 -[UIApplication sendEvent:] + 85 19 UIKit 0x010d5250 _UIApplicationHandleEvent + 683 20 GraphicsServices 0x04262f02 _PurpleEventCallback + 776 21 GraphicsServices 0x04262a0d PurpleEventCallback + 46 22 CoreFoundation 0x02dd8ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53 23 CoreFoundation 0x02dd89db CFRunLoopDoSource1 + 523 24 CoreFoundation 0x02e0368c CFRunLoopRun + 2156 25 CoreFoundation 0x02e029d3 CFRunLoopRunSpecific + 467 26 CoreFoundation 0x02e027eb CFRunLoopRunInMode + 123 27 UIKit 0x010d2d9c -[UIApplication _run] + 840 28 UIKit 0x010d4f9b UIApplicationMain + 1225 0x0002379d main + 141 30 libdyld.dylib 0x033c9701 start + 1 )

Sorry for the long log but it is the problem. Please suggest me how to fix

purepure commented 10 years ago

I found that function convertViewToImage return nil instead of a screenshot. I also try to apply that fix from: http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically But it still crash. I am running xcode 5.1.1 and ios 7.1 on simulator