Good evening,
I have an NSTableView in my application and I use bindings and a property list file to populate it. My plist-file is in the application main bundle. In my tableview I have code like this to add files to my plist:
... and this code to load from plist:
Now I want an image in one cell. How can I do this?
Thanks for any help,
Linus
I have an NSTableView in my application and I use bindings and a property list file to populate it. My plist-file is in the application main bundle. In my tableview I have code like this to add files to my plist:
Code:
- (IBAction)addFileAction:(id)sender {
filePath = [[[NSBundle mainBundle] pathForResource:@"Files" ofType:@"plist"] retain];
NSDictionary *dict =[NSDictionary dictionaryWithObjectsAndKeys:
[tableViewReihe stringValue], @"reiheName",
[tableViewTitel stringValue], @"titelName",
[tableViewRating stringValue], @"rating",
[tableViewDescription stringValue], @"description",
[audioFilePath stringValue], @"audioPath",
[coverFilePath stringValue], @"coverPath",
[hoerspielNummer stringValue], @"number",
nil];
[arrayFiles addObject:dict];
if ( ![[NSFileManager defaultManager] fileExistsAtPath:filePath] || [[NSFileManager defaultManager] isWritableFileAtPath:filePath]) {
[[arrayFiles arrangedObjects] writeToFile:filePath atomically:YES];
}
}
... and this code to load from plist:
Code:
filePath = [[[NSBundle mainBundle] pathForResource:@"Files" ofType:@"plist"] retain];
cassettes = [[NSMutableArray alloc] init];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
NSMutableArray *files = [[NSMutableArray alloc] initWithContentsOfFile:filePath];
for (id file in cassettesFile) {
[arrayFiles addObject:file];
}
}
Now I want an image in one cell. How can I do this?
Thanks for any help,
Linus