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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:55:51+00:00 2026-05-31T13:55:51+00:00

In my app i can’t delete row from tableview. The content of the tableview

  • 0

In my app i can’t delete row from tableview. The content of the tableview comes as a web(GET) response and i display it in a tableview, i display some details of it in a second view controller(push when clickcing row at index..) Can someone help please?
Here is some of my codes:(in viewDidLoad)

 sharedDa= (BNT_AppDelegate *)([[UIApplication sharedApplication]delegate]);
    mm= [[sharedDa messagesDict]objectForKey:@"message"];//mm is NSDictionary

The mm contains a few properties(such as date, message..) and i think i need to delete object at index from Dictionary. How can i handle this situation?

EDIT-2:
Here is my JSON object;

{
    button = 30;
    message =     (
                {
            date = "2012-03-21 20:13:10";
            message = "message 1";
        },
                {
            date = "2012-03-21 20:13:42";
            message = "asdf nkop jp?l?f";
        },
                {
            date = "2012-03-22 10:06:11";
            message = "test local notification message";
        },
                {
            date = "2012-03-22 10:06:41";
            message = "second test of uilocalnotification";
        },
                {
            date = "2012-03-22 10:08:13";
            message = "third test of notification";
        }
    );
}

And here is my initializing code:

sharedDa= (BNT_AppDelegate *)([[UIApplication sharedApplication]delegate]);
//mm is mutableDictionary and the others are mutable array
        mm= [[sharedDa messagesDict]objectForKey:@"message"];
       // NSLog(@"JSON message: %@", [sharedDa messagesDict]);
        buttonVersion= [sharedDa.messagesDict objectForKey:@"button"];
        mySecondArray= [mm valueForKey:@"date"];
        myIDsArray=[mm valueForKey:@"ID"];

I parsed my mutable dictionary and initialized different mutable arrays with it, here is exactly my delegate method to delete row;

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source


        NSLog(@"Thread: %@", [NSThread currentThread]);

        [self.myIDsArray removeObjectAtIndex:indexPath.row];
         [self.myArray removeObjectAtIndex:indexPath.row];
         [self.mySecondArray removeObjectAtIndex:indexPath.row];
         [self.buttonVersion removeObjectAtIndex:indexPath.row];
        //
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; }   }

My app crashes and in the console i get these three lines:

Thread: <NSThread: 0x75719d0>{name = (null), num = 1}
[Switching to process 1472 thread 0x10a03]
(gdb) 

I know it became a very long question but can anyone give me an idea?

  • 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-31T13:55:52+00:00Added an answer on May 31, 2026 at 1:55 pm

    Firstly: name your variables a little readable, mm looks a little stupid.

    Let’s say you have three different objects in your dictionary, create three different NSMutableArrays to hold these objects and in the implementation of

    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{}
    

    use the method removeObjectAtIndex: for all of your arrays.

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

Sidebar

Related Questions

I am writing an app can load data from from web, then put the
I'm making an iphone app...can I get the source from it in objective-c? Thanks!
I'd like to test what happens if my app can't get the location coordinates.
I have an app that can open up some other forms at the user's
i want to build an app for windows mobile that can get GPS locations(longitude
I'm having some confusion if a VOIP App can have multiple tcp sockets monitored
I would like to know if a pure node.js web app can be developed,
1) I read from the Sencha site that the app can be developed locally
i need some help here, i want to make my app can open all
The users of my app can send emails to a set of people. Some

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.