Forum Xamarin.iOS

UIView.Transition causing crashes on iPad only.

Bob_ReckBob_Reck USMember ✭✭✭
edited October 2013 in Xamarin.iOS

EDIT: I just started checking out some other stuff on my app and now these crashes are happening on the iPhone too. That has not been a problem until now. Ugh. Still looking now...

I have a tabbarcontroller and on each viewcontroller in that tabbarcontroller I have a left and right swipe gesture setup to flip the page left or right depending on the user's action. It works great on the iPhone and has for quite a while. I just recently made my app universal and on the iPad it's crashing when the animation completes.

Interestingly, in debug and in the iOS Simulator, the app does not crash. Just on the iPad after an install from testflight.

The key point here is that the animation does actual happen and finishes and then the app crashes. I had this error happening on this particular transition and also on another transition for an image viewing class I have. In that case, the animation to open the image for viewing works fine. But when the close animation happens, it crashes.

Here's my example to transition on right or left swipe. NOTE: The code below contains my work around by checking the UserInterfaceIdiom. Take that line out and the iPad crashes, but iPhone works fine.

protected void HandleLeftSwipe(UISwipeGestureRecognizer recognizer)
    if (this.TabBarController.SelectedIndex != 4) {
        UIView fromView = this.TabBarController.SelectedViewController.View;
    UIView toView = this.TabBarController.ViewControllers[this.TabBarController.SelectedIndex+1].View;

    if (UserInterfaceIdiomIsPhone) {  //This was my fix to stop the crash, but I want the animation effect to work.
        UIView.Transition (fromView, toView, .5f, UIViewAnimationOptions.TransitionFlipFromRight, null);
    this.TabBarController.SelectedIndex = this.TabBarController.SelectedIndex + 1;

protected void HandleRightSwipe(UISwipeGestureRecognizer recognizer)
    if (this.TabBarController.SelectedIndex != 0) {
    UIView fromView = this.TabBarController.SelectedViewController.View;
    UIView toView = this.TabBarController.ViewControllers[this.TabBarController.SelectedIndex-1].View;

    if (UserInterfaceIdiomIsPhone) {  //This was my fix to stop the crash, but I want the animation effect to work.
        UIView.Transition (fromView, toView, .5f, UIViewAnimationOptions.TransitionFlipFromLeft, null);
    this.TabBarController.SelectedIndex = this.TabBarController.SelectedIndex - 1;



  • RolfBjarneKvingeRolfBjarneKvinge USXamarin Team Xamurai

    Can you attach a (symbolicated) crash report and add your version information (from Xamarin Studio's about box -> Show Details)?

  • Bob_ReckBob_Reck USMember ✭✭✭

    Here's one I just created this morning. The crash happens when building as adhoc or release but does not happen when built as debug.

    Thanks for taking a look,

  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    Please always include the version of the software you're using along with the iOS version (of the simulator or devices).

    The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).

  • Bob_ReckBob_Reck USMember ✭✭✭

    Here you go. Note: I am using the alpha channel because of your post in this thread, Sebastien. ( However, the problem also was happening in the current stable release.

    === Xamarin Studio ===
    Version 4.1.12 (build 6)
    Installation UUID: 91914784-012b-4b44-a857-a0c95a2bd16f
        Mono 3.2.3 ((no/8d3b4b7)
        GTK+ 2.24.20 theme: Raleigh
        GTK# (
        Package version: 302030000
    === Xamarin.Android ===
    Version: 4.10.0 (Starter Edition)
    Android SDK: /Users/bobreck/Library/Developer/Xamarin/android-sdk-mac_x86
        Supported Android versions:
            2.1   (API level 7)
            2.2   (API level 8)
            2.3   (API level 10)
            3.1   (API level 12)
            4.0   (API level 14)
            4.0.3 (API level 15)
    Java SDK: /usr
    java version "1.6.0_65"
    Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
    Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
    === Apple Developer Tools ===
    Xcode 5.0 (3332.22)
    Build 5A1412
    === Xamarin.Mac ===
    Xamarin.Mac: Not Installed
    === Xamarin.iOS ===
    Version: (Business Edition)
    Hash: cea17d0
    Build date: 2013-18-10 17:54:48-0400
    === Build Information ===
    Release ID: 401120006
    Git revision: a9ae69a4bf37955e4ab4df0cec7804f574c51f72
    Build date: 2013-09-25 16:59:37+0000
    Xamarin addins: 761ae26f220068dda0b62f0dd2253f617589a8c6
    === Operating System ===
    Mac OS X 10.9.0
    Darwin bobs-mbp.home 13.0.0 Darwin Kernel Version 13.0.0
        Thu Sep 19 22:22:27 PDT 2013
        root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    The alpha has an issue with release builds (that includes Adhoc and AppStore). That's fixed in .215+ but it's not yet published.

    Note: that problem is not present in the stable 7.0.2 release.

  • Bob_ReckBob_Reck USMember ✭✭✭

    Ok, thanks Sebastien (Again). Good to know it has been addressed.


Sign In or Register to comment.