Could it be that you are not recreating the ActionSheet each time? I
have a load of working code around this, eg

https://gist.github.com/3028960

parentview, in this case, is the dialogviewcontroller that the user
was looking at when they hit the button.



On Sun, Jul 1, 2012 at 3:03 PM, Gerry High <[email protected]> wrote:
> I sent this yesterday to the list but then never saw it posted so am 
> resending it.
> =====
> I noticed an issue in using an UIActionSheet in combination with a 
> UIImagePickerController and thought I'd shared what I've seen and a work 
> around.  I ported some working code from Xcode to MonoTouch and got a crash 
> with "Application tried to present modally an active controller".  The use 
> case is a UIActionSheet displaying 2-3 buttons and then from the 
> UIActionSheet.Clicked event displaying a UIImagePickerController.
>
> On the first call from the ActionSheet to the ImagePicker it works fine all 
> the way through the cancel from the image picker.  However, the second time I 
> make the call it fails when trying to display the UIImagePickerController 
> with the above mentioned error.
>
> One thing I did in comparing my Xcode vs MT code is that I was using the 
> Clicked event on the action sheet vs the action sheet delegate method 
> didDismissWithButtonIndex.  I decided to write a simple delegate class and 
> override the Dismissed method.  Now my code works with no errors.
>
> Is there a difference in how the delegate Dismissed method works vs the 
> Clicked event?  You would think they'd behave the same but it appears that 
> they do not.
>
> Thanks.
> Gerry
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch



-- 
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

Earnest: Self-employed? Track your business expenses and income.
http://earnestapp.com
Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to