i have a program that i am writing that has a table view with two columns. one of then is for a customer name and the other one is for an ID which has to be generated randomly when a new customer is created using core data.
I have so far been able to generate a random number but i have no idea on how to insert into the id column when a new customer is created. as i am using the add action from the nsarraycontroller i can't give the button the command to do it.
here is my code that makes the number:
int number = arc4random() %(100);
this is the code that i have in my .m file
import Foundation/Foundation.h
include stdlib.h
@interface tableViewData : NSObject{
IBOutlet NSTextField *randomeNumber;
IBOutlet NSTableColumn *customerId;
IBOutlet NSTableColumn *customerName;
}
- (IBAction)numer:(id)sender;
- (IBAction)customerID:(id)sender;
any help would be appreciated
thanks
G
p.s. i am using Xcode 4.2.1 and programming for osx