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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:47+00:00 2026-06-04T16:49:47+00:00

I want to save to database after moving some rows in the editable UITableView,

  • 0

I want to save to database after moving some rows in the editable UITableView,
But error occurred
I can’t find reason of error. Please advice me about my code. Thanks!!

My code :

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
           return indexPath.section == 0 && indexPath.row < items.count;        
} 

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath 
  toIndexPath:(NSIndexPath *)toIndexPath {

        isReOrderNoteList= YES;

        NSString *rowContent = [items objectAtIndex:fromIndexPath.row];
        [items removeObjectAtIndex:fromIndexPath.row];
        [items insertObject:rowContent atIndex:toIndexPath.row];
 }

//I'm using UIButton instead of Navigation barbutton.
- (IBAction)EditTable:(id)sender{

       f(TableView.editing)
        {
            if(isReOrderNoteList)
            {    
                [super setEditing:NO animated:NO]; 
                [TableView setEditing:NO animated:NO];
                [btn_Edit setTitle:@"Edit" forState:UIControlStateNormal];

                FMDatabase *dbS = [FMDatabase databaseWithPath:dbPath];     
                [dbS open]; 

                NSInteger tmp = 1; 
                NSLog(@" [self.items count] : %d", [ items count]);  **// Print 6 !!.** 

                for (NSInteger i = 0; i< [items count]; i++) {

                    Note *list = [[Note alloc] init];
                    list = [items objectAtIndex:i]; 
                    NSLog(@" list.itle : %@", list.title);  **//Error occurred at this line.**
                    NSLog(@" list.IDX : %d", list.IDX);
                    [dbS executeUpdate:@"Update test set sort_seq = ? where  idx = ? ", [NSNumber numberWithInt:tmp], [NSNumber numberWithInt:list.IDX]]; 
                    [list release];
                    tmp++; 
                }
                [dbS close];      
            }

            //Re-init 
            isReOrderNoteList = NO; 
        }
        else
        {
            [super setEditing:YES animated:YES]; 
            [TableView setEditing:YES animated:YES];      
            [btn_Edit2 setTitle:@"Done" forState:UIControlStateNormal]; 
        }

}

error :

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteNotification title]: unrecognized selector sent to instance 0x892b550'
*** First throw call stack:
  • 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-04T16:49:48+00:00Added an answer on June 4, 2026 at 4:49 pm

    you release the note at the end of the code without do it on the “items” array

        Note *list = [[Note alloc] init];
        list = [items objectAtIndex:i]; 
        NSLog(@" list.itle : %@", list.title);  **//Error occurred at this line.**
        NSLog(@" list.IDX : %d", list.IDX);
        [dbS executeUpdate:@"Update test set sort_seq = ? where  idx = ? ", [NSNumber numberWithInt:tmp], [NSNumber numberWithInt:list.IDX]]; 
        [list release];
    

    it should be

        Note *list = [items objectAtIndex:i]; 
        NSLog(@" list.itle : %@", list.title);  **//Error occurred at this line.**
        NSLog(@" list.IDX : %d", list.IDX);
        [dbS executeUpdate:@"Update test set sort_seq = ? where  idx = ? ", [NSNumber numberWithInt:tmp], [NSNumber numberWithInt:list.IDX]]; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to save html-formatted text to database, but when I do that it
I want to save many pictures into a SQL Server database file. How can
I want to save Image in Database with JSON web service .without image data
i want to save current date+time into database and also want to retrieve it.
I want to save my countries local time(new zealand) in my database. I am
I want to save a query only one time in the database, this is
I want to save a pdf and mp3 file(s) to a SQL Server database
I have a DataTable which I want to save to a SQLite Database Table.
I have a Seekbar and I want to save the state to database when
I want to extracing a column from a database and save it into a

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.