• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Putting an Image Cell in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Putting an Image Cell in NSTableView


  • Subject: Putting an Image Cell in NSTableView
  • From: Jeremy Dronfield <email@hidden>
  • Date: Wed, 17 Jul 2002 21:34:02 +0100

This question has been asked before, but I can't find a solution on mamasam appropriate to my problem. I want to put one or more 'blip' images into a cell of a TableView (like the Unread Message blip in Mail) when the user clicks a button. At the moment I'm using cruddy-looking text asterisks, thus:

- (IBAction)tagAction:(id)sender
{
NSString *tag;
NSString *theNote;
NSString *theMark;
NSMutableDictionary *selectedBookmark = [[NSMutableDictionary alloc] init];
int index = [tableView selectedRow];
id theRecord, theSegment;

theRecord = [bookmarks objectAtIndex:index]; <=My dictionary object
theSegment = [theRecord objectForKey:@"scv"];
theNote = [theRecord objectForKey:@"tag"];
theMark = [theRecord objectForKey:@"Bookmarks"];

if ([theNote isEqualToString:@"*"]) {
tag = @"**";
} else if ([theNote isEqualToString:@"**"]) { <= I want to get rid of this tat
tag = @"***";
} else if ([theNote isEqualToString:@"***"]) {
tag = @"-";
} else {
tag = @"*";
}

[selectedBookmark setObject:theSegment forKey:@"scv"];
[selectedBookmark setObject:[NSString stringWithString:tag] forKey:@"tag"];<=image here
[selectedBookmark setObject:theMark forKey:@"Bookmarks"];
[bookmarks removeObjectAtIndex:index];
[bookmarks insertObject:selectedBookmark atIndex:index];

[selectedBookmark release];
[tableView reloadData];
[self saveData];
}

I've trawled the docs and experimented with various approaches, but they either do nothing or throw exceptions all over the place. How would YOU go about it?
- jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: Properly writing an Init method
  • Next by Date: Re: Properly writing an Init method
  • Previous by thread: removeObserver
  • Next by thread: Re: Putting an Image Cell in NSTableView
  • Index(es):
    • Date
    • Thread