ios - Present UIViewController from subclass of UIView -
i have created subclass of uiview
, in app need present uiviewcontroller
it,
i have tried following :
poiinfocontroller = [[poiinfocontroller alloc]initwithnibname:@"poiinfocontroller" bundle:nil]; [poiinfocontroller setmodalpresentationstyle:uimodalpresentationformsheet]; [[[[uiapplication sharedapplication] keywindow] rootviewcontroller] presentmodalviewcontroller:poiinfocontroller animated:yes];
but crash terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'application tried present modally active controller .'
please help,
**edit crash log:** 2014-04-23 17:04:26.433 navigationlibsprintmom[4610:a0b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'application tried present modally active controller <viewcontroller: 0x9d52140>.' *** first throw call stack: ( 0 corefoundation 0x017c15e4 __exceptionpreprocess + 180 1 libobjc.a.dylib 0x014d08b6 objc_exception_throw + 44 2 uikit 0x0036217a -[uiviewcontroller presentviewcontroller:withtransition:completion:] + 4879 3 uikit 0x00362caf -[uiviewcontroller presentviewcontroller:animated:completion:] + 130 4 navigationlibsprintmom 0x00005f7b -[navigationview handlegesture:] + 964 5 uikit 0x005baf8c _uigesturerecognizersendactions + 230 6 uikit 0x005b9c00 -[uigesturerecognizer _updategesturewithevent:buttonevent:] + 383 7 uikit 0x005bb66d -[uigesturerecognizer _delayedupdategesture] + 60 8 uikit 0x005bebcd ___uigesturerecognizerupdate_block_invoke + 57 9 uikit 0x005beb4e _uigesturerecognizerremoveobjectsfromarrayandapplyblocks + 317 10 uikit 0x005b5248 _uigesturerecognizerupdate + 199 11 uikit 0x00281d4a -[uiwindow _sendgesturesforevent:] + 1291 12 uikit 0x00282c6a -[uiwindow sendevent:] + 1030 13 uikit 0x00256a36 -[uiapplication sendevent:] + 242 14 uikit 0x00240d9f _uiapplicationhandleeventqueue + 11421 15 corefoundation 0x0174a8af __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 15 16 corefoundation 0x0174a23b __cfrunloopdosources0 + 235 17 corefoundation 0x0176730e __cfrunlooprun + 910 18 corefoundation 0x01766b33 cfrunlooprunspecific + 467 19 corefoundation 0x0176694b cfrunloopruninmode + 123 20 graphicsservices 0x038699d7 gseventrunmodal + 192 21 graphicsservices 0x038697fe gseventrun + 104 22 uikit 0x0024394b uiapplicationmain + 1225 23 navigationlibsprintmom 0x0000374d main + 141 24 libdyld.dylib 0x01f54725 start + 0 25 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception
Comments
Post a Comment