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 8068537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:43:21+00:00 2026-06-05T12:43:21+00:00

I have loaded a new view using the code UIViewController* newController = [[UIViewController alloc]

  • 0

I have loaded a new view using the code

UIViewController* newController = [[UIViewController alloc] initWithNibName:@"NFCController" bundle:nil];
[self.view addSubview:newController.view];

and this loads in the new view perfectly. However, I have connected a button in the new view to a class so that I can use the press event to do things. However, even though the method is still only:

- (IBAction)donePress:(id)sender {}

the app still crashes. I get the error EXC_BAD_ACCESS on the main method in main.m.

Has anyone got any ideas what could be causing this? I can provide more information on request.

Thanks.

Edit: This happens with all controls that are connected to methods.

  • 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-06-05T12:43:22+00:00Added an answer on June 5, 2026 at 12:43 pm

    your controller is getting released as it is not retained anywhere leading to crash. only your controller’s view is being retained.

    Keeping your controller retained like with

    //declaring newController as (strong) in .h file and use
    self.newController = [[UIViewController alloc] initWithNibName:@"NFCController" bundle:nil];
    
    [self.view addSubview:self.newController.view];
    

    Now your controller is also being retained. Your code will work fine now.

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

Sidebar

Related Questions

I am quite new to intellij and i have loaded in a project that
We have a new filestream database that will be initially loaded with 65GB data,
I have loaded an XML file using simplexml_load_file($filePath,'SimpleXMLElement', LIBXML_NOCDATA); And for most of the
I have 2 sections within a table view and I have loaded one section
I am using MSXML3 and have loaded an xml document which is a HTML
HI have a custom view class that is loaded and placed within my main
I have a grid view which is populated using a custom ImageAdapter class extending
I'm new to Prism, but I have successfully built several WPF/Mvvm-Light applications. I'm using
I am new to iphone development, i have created sms application using Text Links(sms:)
I have a data grid view with images loaded into it. The table which

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.