Jump to content

Table Programming Help

  • Please log in to reply
No replies to this topic



    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
Hello, I am trying to program a table, but I need help with adding an entry, removing one is easy, and setting a default value I got down, but I want to make it where what you add in form cells 0-2 will add it to the table.

I already bound the table to the array and all the other buttons, but I think I coded it wrong.

I used a sample code to help me out, but I can't figure out how to adjust it to suit the needs of this app.

-	(NSMutableDictionary *)edit:(NSDictionary *)startingValues from:(PlayersTableController *)sender
		NSArray *editFields = [playerFormFields cells];
				[[editFields objectAtIndex:0] setStringValue:@""];
				[[editFields objectAtIndex:1] setStringValue:@""];
				[[editFields objectAtIndex:2] setStringValue:@""];
		return savedPlayerFields;

- (IBAction)addPlayer:(id)sender
				NSArray *editFields = [playerFormFields cells];
				[savedPlayerFields release];
				savedPlayerFields = [NSMutableDictionary dictionaryWithObjectsAndKeys:
											 [[editFields objectAtIndex:0] stringValue], @"fieldone",
											 [[editFields objectAtIndex:1] stringValue], @"fieldtwo",
											 [[editFields objectAtIndex:2] stringValue], @"fieldthree",
				[savedPlayerFields retain];

How can I adjust it so when I press "add", it will add to the table what you inputted into the form cells.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy