Jump to content
  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
Sign in to follow this  

Table Programming Help

1 post in this topic

Recommended 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.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.