Crash on on landscape view

Discussion in 'iOS Programming' started by Sergio10, Jan 11, 2010.

  1. Sergio10 macrumors regular

    Joined:
    Oct 3, 2007
    #1
    Hi guys,

    I have a problem: when rotate a device to landscape position and some UIImageView creates in the UIViewController sometimes my application crashes.
    How to avoid landscape orientation and crash?

    I've already inserted into info.plist:
    "Initial interface orientation" "Portrait (bottom home button)"

    Also added:
    PHP:
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
    {
        
    // Return YES for supported orientations
        
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    to all UIViewControllers.

    Here is a crash report:
    PHP:
    Thread 0 Crashed:
    0   libobjc.A.dylib                   0x00003ebc objc_msgSend 20
    1   UIKit                             0x0006c504 
    -[UIWindow _shouldAutorotateToInterfaceOrientation:] + 60
    2   UIKit                             0x00144b10 
    -[UIWindow _updateToInterfaceOrientation:duration:force:] + 36
    3   UIKit                             0x00087564 
    -[UIWindow _updateInterfaceOrientationFromDeviceOrientation] + 112
    4   UIKit                             0x0006e7d8 
    -[UIWindow _handleDeviceOrientationChange:] + 72
    5   Foundation                        0x0004d5d2 _nsnote_callback 
    178
    6   CoreFoundation                    0x0005150a _CFXNotificationPostNotification 
    298
    7   Foundation                        0x0004b1ac 
    -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
    8   UIKit                             0x0006e768 
    -[UIDevice setOrientation:] + 124
    9   UIKit                             0x00056d3c 
    -[UIApplication handleEvent:withNewEvent:] + 5424
    10  UIKit                             0x00055634 
    -[UIApplication sendEvent:] + 60
    11  UIKit                             0x0005508c _UIApplicationHandleEvent 
    4528
    12  GraphicsServices                  0x00005988 PurpleEventCallback 
    1044
    13  CoreFoundation                    0x00057524 CFRunLoopRunSpecific 
    2296
    14  CoreFoundation                    0x00056c18 CFRunLoopRunInMode 
    44
    15  GraphicsServices                  0x0000436c GSEventRunModal 
    188
    16  UIKit                             0x00003c28 
    -[UIApplication _run] + 552
    17  UIKit                             0x00002228 UIApplicationMain 
    960
    18  Tracker                           0x00009124 main 
    (main.m:14)
    19  Tracker                           0x00002218 start 44
    Thank you.
     
  2. anonymous2010 macrumors newbie

    Joined:
    Jan 12, 2010
    #2
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Because, mostly to avoid spam, you must be registered in order to post.
     
  4. anonymous2010 macrumors newbie

    Joined:
    Jan 12, 2010
    #4
    You'd think a simple captcha would be enough for this purpose. Never mind.
     
  5. skunkworker macrumors regular

    Joined:
    Sep 9, 2007
    #5
    captchas aren't good enough anymore. What still works is human things like.
    Is fire hot or cold?

    I had my own forums going for awhile and this is the way to stop spam.
     

Share This Page