• 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: ".::welemski::." <email@hidden>
  • Date: Tue, 6 Sep 2005 15:10:36 +0800

 tried already but it seems i can't get the code to work.


What I did is that I put an identifier string from the "NSTableColumn"
inspector in the Attributes. My identifiers are "lname","fname".

here is my save action method
- (IBAction)aSave:(id)sender
{
       NSString *fname, *lname;
       NSMutableDictionary *thisDictionary=[NSMutableDictionary new];

       fname=[outletFname stringValue];
       lname=[outletLname stringValue];

       [thisDictionary setObject:fname forKey: @ "lname"];
       [thisDictionary setObject:lname forKey: @ "fname"];
       [myArray addObject:thisDictionary]; //myArray is already declared
globally and is being constructed in the -(void)awakeFromNib{} method;
}




Look at my code below and see what's wrong with it... why it can't
still display all the lists

-(int)numberOfRowsInTableView:(NSTableView *)aTableView
{
               return [myArray count];
}
-(id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)row
{
       id thisRecord, thisValue; //i also tried this -> NSDictionary thisRecord

       thisRecord=[myArray objectAtIndex:row];
       thisValue=[thisRecord objectForKey:[aTableColumn identifier]];
       return thisValue;


}


--
 -- -- -- -- -- -- -- -- -- -- --
          welemski
 -- -- -- -- -- -- --
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTableView
      • From: j o a r <email@hidden>
  • Prev by Date: Core Data, OutlineView, TreeController
  • Next by Date: CGS differences from Panther to Tiger
  • Previous by thread: Re: NSTableView
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread