Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:12:29+00:00 2026-05-28T06:12:29+00:00

I have a programmatically created Storyboard (as I only use it for iOS 5)

  • 0

I have a programmatically created Storyboard (as I only use it for iOS 5) with a simple Controller and a iPad View. I need a gesture recognizer and added that. But when the App loads and I make the gustier I get EXC_BAD_ACCESS:

*** -[DOiPadStoryboardViewController handleSliding:]: message sent to deallocated instance 0x238580

It must be something simple I am doing wrong. Why is the controller deallocated?

I create the storyboard with the following code:

if (isIOS5) {
    // iOS 5 with storyboard
    UIViewController *viewControler = nil;
    if([self isiPad]){
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPadStoryboard" bundle: [NSBundle mainBundle]];
        viewControler = [storyboard instantiateInitialViewController];
    } else {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhoneStoryboard" bundle: [NSBundle mainBundle]];
        viewControler = [storyboard instantiateInitialViewController];
    }
    [self.window addSubview:viewControler.view];
} 

The gesture recognizer is connected to the main view and the IBAction is in the view controller. The storyboard looks as follows (but not sure if this add anything):
Storyboard

and this is the Pan Gesture Recognizer:
Gesture properties

and finally the ‘bt’ console output:

#0  0x37d2b8a0 in ___forwarding___ ()
#1  0x37c86680 in __forwarding_prep_0___ ()
#2  0x318d2f06 in _UIGestureRecognizerSendActions ()
#3  0x31864c1c in -[UIGestureRecognizer _updateGestureWithEvent:] ()
#4  0x31a90508 in ___UIGestureRecognizerUpdate_block_invoke_0541 ()
#5  0x317dfd68 in _UIGestureRecognizerApplyBlocksToArray ()
#6  0x317de8b6 in _UIGestureRecognizerUpdate ()
#7  0x317eb3cc in _UIGestureRecognizerUpdateGesturesFromSendEvent ()
#8  0x317eb20e in -[UIWindow _sendGesturesForEvent:] ()
#9  0x317eaddc in -[UIWindow sendEvent:] ()
#10 0x317d14ec in -[UIApplication sendEvent:] ()
#11 0x317d0d2c in _UIApplicationHandleEvent ()
#12 0x37a57df2 in PurpleEventCallback ()
#13 0x37cfd552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#14 0x37cfd4f4 in __CFRunLoopDoSource1 ()
#15 0x37cfc342 in __CFRunLoopRun ()
#16 0x37c7f4dc in CFRunLoopRunSpecific ()
#17 0x37c7f3a4 in CFRunLoopRunInMode ()
#18 0x37a56fcc in GSEventRunModal ()
#19 0x317ff742 in UIApplicationMain ()
#20 0x00003050 in main (argc=1, argv=0x2fdffaa8)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:12:29+00:00Added an answer on May 28, 2026 at 6:12 am

    Set the view controller’s to be your window’s root view controller, instead of adding its view as a subview – which is obsolete and discouraged by Apple since you are detaching the views hierarchy from the view controllers hierarchy, which in turn will eventually cause nasty bugs such as your view controllers not getting rotation callbacks, etc. etc.

    As a by the way, your view controller will be retained by the window, and no more crash.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have programmatically created a second view controller (MySecondViewController) which was all done and
I have added a UILabel to my view programmatically like this: myLabel = [[UILabel
I have a TabBar which has been created programmatically. In the view controllers of
I have an iPad app that is not showing a table created programmatically. Where
I have succesfully created a view hierarchy programmatically. I now want to replicate this
I have a tab bar controller that I have created programmatically, named TPastJourneyTabbar .
I have a UIViewController subclass which is having its view created programmatically within the
I have a navigation controller created programmatically to handle the switch between the views
I have a tableLayout that is created programmatically, about 23 items are added to
I have already created UITableViewController embedded in Navigator Controller using Storyboard and Interface Builder.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.