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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:00:15+00:00 2026-06-03T06:00:15+00:00

I have a property of @property (nonatomic, strong) NSMutableArray *timesArray; It is used to

  • 0

I have a property of

@property (nonatomic, strong) NSMutableArray *timesArray;

It is used to populate the data in my UITableView. When I want to clear my view, I do this:

- (void)clearView {
    self.nameField.text = @"";
    self.noteField.text = @"";
    if ([_timesArray count] > 0) {
        [self.timesArray removeAllObjects];
        [self.customTableView reloadData];
    }
}

The removeAllObjects causes a crash. I am not sure why. I looked around and a lot of posts talk about an object being overreleased. How is that happening if I’m using ARC and not calling retain/release on any objects. My _timesArray just holds NSDate objects I get from a UIDatePicker.

My stack trace looks like:

enter image description here

My insertPill looks like:

- (void)insertPill:(id)sender {
    //[[NSNotificationCenter defaultCenter] postNotificationName:InsertPillNotification object:self];

    [self clearView];
}

If I don’t removeAllObjects, and just do:

NSMutableArray *emptyArray = [[NSMutableArray alloc] initWithCapacity:0];
self.timesArray = emptyArray;

This works. But I’d still like to know why by removing the objects it does not work.

Edit: I initialize the array in viewDidLoad:

_timesArray = [[NSMutableArray alloc] initWithCapacity:0];

When I want to add a new object to the array, I do this:

NSMutableArray *tempUnsortedArray = [[NSMutableArray alloc] initWithArray:_timesArray];        
        [tempUnsortedArray addObject:_datePicker.date];
        self.timesArray = tempUnsortedArray;

I’m not sure if the way I’m adding data the array is causing the issue or not.

  • 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-03T06:00:16+00:00Added an answer on June 3, 2026 at 6:00 am

    You’re getting a doesNotRecognizeSelector: exception. This probably means that the object you think is a NSMutableArray is not really one. It is probably an NSArray. Where are you assigning the object?

    To start debugging the issue, po the object before calling removeAllObjects. What type of object is it reported as?

    Otherwise it could be possible that there is a non NSObject element in timesArray.

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

Sidebar

Related Questions

I have a variable declared like this: @property (nonatomic, retain) NSMutableArray *aInfo; At the
Do I have this right ... // Reactor.h @property(nonatomic, retain) NSMutableArray *reactorCore; // Reactor.m
Say I have two properties defined as such: @property (nonatomic, strong) UITableView *parentTableView; @property
I have a custom UITableViewController with 2 properties: @property (strong, nonatomic) IBOutlet VenueHeaderViewController *header;
I have the following property: @property (nonatomic, assign) double lastSynced; and here's my custom
I have these 2 properties that are set in a NSObject @property (nonatomic, readonly,
For example, I have a UIViewController, and have a value: NSString *testString; @property (nonatomic,
MyObject : NSObject @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSArray *notificationsArray; I
This is the original codes when I am getting this error ClassA.h +(ClassA*)methodA:(NSData*)data; @property
I have an NSMutableArray I am trying to populate using a for-loop and making

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.