In article <20030721203124248-0700news.la.sbcglobal.net>, matt neuburg
Yes. Sorry. I proofread this several times, and still missed this.> In <210720032130382351%sgketchamcomcast.net> Steve Ketcham wrote:>> > For the past few days, I've been driving myself crazy trying to apply
> > paragraph formatting to a cell in an NSTextView.
> Do you mean an NSTableView?Yes.>>> > In -tableView:objectValueForTableColumn:row, I set up the
> > NSMutableAttributedString to contain the needed text, then apply the
> > formatting to the string with addAttribute:value:range. I also add
> > attributes to the string to change the foreground color and font size.
> > My NSTextView is a one-month calendar.
> Do you mean an NSTableView?That's what I thought too, because that's a pretty common source of>>> > When I display, everything
> > looks great. But if I move to another month, or even redisplay the
> > same month, most of the cells are not displayed. And I can't figure
> > out why.
> It sounds to me like the problem is that the value you are returning no
> longer exists. You have probably failed to retain or copy something, so
> you're passing nil or garbage by mistake. That's just a guess, but it's
> a frequent cause of this sort of thing. It works the first time because
> we're still in the initial call stack, but then the call stack ends, the
> object is released, and so the next time, it's not there. m.
problems like this. So I added "retain" to the code in -init, and when
that didn't help, I moved the creation and setup of the
NSMutableParagraphStyle into the
tableView:objectValueForTableColumn:row. Neither change makes a
difference to the behavior described.
Do you have any other ideas?