• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView


  • Subject: Re: NSTableView
  • From: Graham Cox <email@hidden>
  • Date: Wed, 5 Nov 2008 16:09:58 +1100


On 4 Nov 2008, at 10:13 pm, Mahaboob wrote:

NSString *content;
for(i=0;i<[tableView numberOfRows];i++)
{
if([tableView isRowSelected:i])
{
content = [[[[[tableView
tableColumnWithIdentifier:@"MediaType"] dataCellForRow:i]stringValue]
stringByAppendingString:@","]
stringByAppendingString:[[[tableView tableColumnWithIdentifier:@"Category"]
dataCellForRow:i]stringValue]] ;


NSLog(@"%@",content);
           }
       }


A further observation.

Each time through your loop you assign a value to 'content', but content itself never appears in the subsequent expression, meaning that you are discarding each value of 'content' except the last one. You would see each one in the log however... but since you are attempting to rely on the value of -dataCellForRow: which is NOT doing what you think it is (read the docs) you'll see the same values repeated on each logged line no matter what is selected.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTableView (From: Mahaboob <email@hidden>)

  • Prev by Date: Re: NSTableView
  • Next by Date: Re: NSTableView
  • Previous by thread: Re: NSTableView
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread