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

  • Home
  • SEARCH
  • 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 8429621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:23:16+00:00 2026-06-10T05:23:16+00:00

I have a custom UITableViewCell that extends UITableViewCell and implements MFMailComposeViewControllerDelegate . (i.e. UITableViewCell<MFMailComposeViewControllerDelegate>

  • 0

I have a custom UITableViewCell that extends UITableViewCell and implements MFMailComposeViewControllerDelegate. (i.e. UITableViewCell<MFMailComposeViewControllerDelegate>).

When a button is clicked in the custom table cell, I present a mailController with presentModalViewController. The user can then type the email or cancel, everything works.

But when didReceiveMemoryWarning is called while the mailController is present, and then when the mailController closes, the app crashes. I get this error:

“-[CustomCell respondsToSelector:]: message sent to deallocated instance 0xf4988b0”

Now I’m pretty sure its because the table view that owns the tablecell has been deallocated hence the cell has been deallocated but does anyone have any suggestions to go about fixing this? I mean I guess I could switch the MailCompose delegate to the table cell’s table view’s view controller but I’d rather not. I’d rather keep it in the table cell. Any ideas?

  • 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-10T05:23:18+00:00Added an answer on June 10, 2026 at 5:23 am

    You should not be using a table view cell as the MFMailComposeViewControllerDelegate. Because of the nature of cells and their reuse, it’s hard to pin a particular instance to be a delegate, especially a delegate of a view controller on top of the view controller the cell is being shown, and on this particular case, the memory warning might be causing a flush of the cache of cells.

    The MFMailComposeViewControllerDelegate should be the delegate of the table view where the cell is. It’s also a better MVC pattern.

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

Sidebar

Related Questions

I have a custom UITableViewCell that seems to appear multiple times on my table
I have a custom UITableViewCell that I use like this: AppTableCell *cell = [tableView
I have a custom UITableViewCell that I defined in a storyboard. I added a
Similar to this question I have a custom subclass of UITableViewCell that has a
I have a custom UITableView cell that has a UIImageView sized to the width
I have custom UITableViewCell . It contains UITextLabel . When I press this cell
I have a custom UITableViewCell subclass. I have set the contentView of my cell
I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is
I have a custom UITableViewCell nib that has an image on the left side
I have a custom UITableViewCell class, and within that I've overridden the drawRect method

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.