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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:16+00:00 2026-05-26T08:37:16+00:00

I want checked more cell with one click(touch). In this code I try to

  • 0

I want checked more cell with one click(touch).

In this code I try to do what I said bat … I have some problem

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *riga;
int esci=0;
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

NSDictionary *itemAtIndex = (NSDictionary *)[listad objectAtIndex:indexPath.row];
riga=[itemAtIndex objectForKey:@"riga"];

for (int i=0; i<[righeS count]; i++) {
    if ([righeS objectAtIndex:i] ==riga) {
                cell.accessoryType=UITableViewCellAccessoryNone;
        //[tableView deselectRowAtIndexPath:indexPath animated:YES];
        [righeS removeObjectAtIndex:i];
                     esci=1;
        }
}

if (esci==0) {

    [righeS addObject:riga];
             cell.accessoryType = UITableViewCellAccessoryCheckmark;


             //Check if value of qty of the next row is 0
             bool trovato=FALSE;
         for (int g =0 ;g <[listad count];g++){
             NSDictionary *rigaScan=(NSDictionary*)[listad objectAtIndex:g];
            if (trovato==TRUE) {
                 if ([[rigaScan objectForKey:@"qty"] isEqualToString: @"0"]){
                     NSString *rig;
                     rig=[rigaScan objectForKey:@"riga"];
                     [righeS addObject:rig];

                    cell.accessoryType=UITableViewCellAccessoryCheckmark;
                }else{
                   break;
                }    
            }
            if ([rigaScan objectForKey:@"riga"]==riga){
               trovato=TRUE;
            }

           [rigaScan release];
       }

           //Fine controllo


}


}

In this event I try when the user touches a cell to see if some value of the next cell is 0.
If the value is 0, I have to check also the next cell and the other value in the for iterate.
When the next value is !=0 I put break.

I believe that the logical code is correct but maybe not the syntax for cocoa.

  • 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-26T08:37:17+00:00Added an answer on May 26, 2026 at 8:37 am

    Try this wonderful post from Cocoa With Love – Multiple row selection and editing in a UITableView

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

Sidebar

Related Questions

I want to minimize the amount of code i have to write for this
http://developer.yahoo.com/yui/button More specifically, I want radio buttons. that can be checked/unchecked.
I have a project where I want to have checked arithmetic by default, except
I have a for loop that check whether some checkboxes are checked foreach (CheckBox
I want to discuss my problem clearly. I have a function to Swap value
I have checked a lot of other questions similar to this, but it seems
I'm introducing Subversion into our web shop. I want to want the checked in
I want a list of all the checked out files, by all users, in
i want to change the forecolor of the checked item when it is unchecked..
I want to unhide the hidden divCommentBody div that belongs to the checked checkbox,

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.