Hi friends,
I have an NSArray and a binding to one column of the NSTableView via an NSArrayController. Now I binded an NSTextField to the same variable. This text field should show the content of one entry of the nsarray of the selected row in my NSTableView.
When I try to delete one row including entry in the array with this code:
... it doesn't work. When only the NSTableView was binded, the delete action worked perfectly (the controller key in the table view column is "arrangedObjects", in the textfield it is "selection"). What do I wrong?
Thanks for any help.
Have a nice day,
Linus
I have an NSArray and a binding to one column of the NSTableView via an NSArrayController. Now I binded an NSTextField to the same variable. This text field should show the content of one entry of the nsarray of the selected row in my NSTableView.
When I try to delete one row including entry in the array with this code:
Code:
filePath = [[[NSBundle mainBundle] pathForResource:@"Games" ofType:@"plist"] retain];
NSDictionary *dict =[NSDictionary dictionaryWithObjectsAndKeys:
[loadTitle stringValue], @"gameTitle",
[loadYear stringValue], @"gameYear",
[loadPublisher stringValue], @"gamePublisher",
[loadDescription stringValue], @"gameDescription",
[loadGenre stringValue], @"gameGenre",
[loadCoverPath stringValue], @"gameCoverPath",
[loadLicense stringValue], @"gameLicense",
[loadProgress stringValue], @"gameProgress",
[loadRating stringValue], @"gameRating",
nil];
[arrayTitles removeObject:dict];
if ( ![[NSFileManager defaultManager] fileExistsAtPath:filePath] || [[NSFileManager defaultManager] isWritableFileAtPath:filePath]) {
[[arrayTitles arrangedObjects] writeToFile:filePath atomically:YES];
}
... it doesn't work. When only the NSTableView was binded, the delete action worked perfectly (the controller key in the table view column is "arrangedObjects", in the textfield it is "selection"). What do I wrong?
Thanks for any help.
Have a nice day,
Linus