Ask a Question related to Mac Programming, Design and Development.
-
Paul Forgey #1
NSOutlineView, calling reloadData during setObjectValue causes crash?
I've got two very similar things going on in both an NSOutlineView and an
NSTableView. If the user edits the text in the leftmost column, this
changes the key in a dictionary, which can cause the data to be reordered.
If this happens in outlineView:setObjectValue:forTableColumn:byItem, I send
a reloadData: to the NSOutlineView instance after the data used by the data
source has been changed.
In an NSTableView, this works fine. In an NSOutlineView, this causes a
crash sometime after setObjectValue: has returned. I've checked and
re-checked my data source. Especially since an NSTableView works just fine,
is there a known problem or limitation that isn't documented about doing
this in an NSOutlineView? If there's something else I need to do instead,
what is it?
Paul Forgey Guest
-
#40677 [NEW]: PHP crash when calling Java
From: poon dot fung at comcast dot net Operating system: windows xp PHP version: 5.2.1 PHP Bug Type: Java related Bug... -
#39656 [NEW]: Crash when calling fetch() on a PDO statment object after closeCursor()
From: randy at rcs-comp dot com Operating system: Windows XP PHP version: 5.2.0 PHP Bug Type: Reproducible crash Bug... -
#39445 [NEW]: Calling debug_backtrace() in the __toString() function produces a crash
From: daan at parse dot nl Operating system: Slackware 10.2 PHP version: 5.2.0 PHP Bug Type: Reproducible crash Bug... -
InDesign CS CE non-stop CRASH, CRASH, CRASH, CRASH, CRASH, CRASH
Sofware is orig., and OS is win2000 pro, or 2003 server or win2000 server. Any doc with litle more text crash indesign non-stop. With any updates... -
#24850 [Opn->Bgs]: Calling 3 times php using Apache Tomcat4.1.18 causes it's crash
ID: 24850 Updated by: sniper@php.net Reported By: javri28 at hotmail dot com -Status: Open +Status: ... -
matt neuburg #2
Re: NSOutlineView, calling reloadData during setObjectValue causescrash?
In <OTidndWhkvX6IPuiXTWc-g@speakeasy.net> Paul Forgey wrote:
If you believe the problem is that you're calling reloadData *during*> I've got two very similar things going on in both an NSOutlineView and
> an NSTableView. If the user edits the text in the leftmost column,
> this changes the key in a dictionary, which can cause the data to be
> reordered. If this happens in outlineView:setObjectValue:
> forTableColumn:byItem, I send a reloadData: to the NSOutlineView
> instance after the data used by the data source has been changed.
>
> In an NSTableView, this works fine. In an NSOutlineView, this causes
> a crash sometime after setObjectValue: has returned. I've checked and
> re-checked my data source. Especially since an NSTableView works just
> fine, is there a known problem or limitation that isn't documented
> about doing this in an NSOutlineView? If there's something else I
> need to do instead, what is it?
setObjectValue, then you can test that hypothesis by calling reloadData *
after* setObjectValue has returned. You can arrange that easily through
delayed execution. m.
--
matt neuburg, phd = [email]matt@tidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
REALbasic: The Definitive Guide! 2nd edition!
[url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
Subscribe to TidBITS. It's free and smart.
matt neuburg Guest
-
Paul Forgey #3
Re: NSOutlineView, calling reloadData during setObjectValue causes crash?
matt neuburg <matt@tidbits.com> wrote in message news:<20030916095229915-0700@news.la.sbcglobal.net>...
I'm not quite certain how I would go about doing that. I did,> In <OTidndWhkvX6IPuiXTWc-g@speakeasy.net> Paul Forgey wrote:>> > I've got two very similar things going on in both an NSOutlineView and
> > an NSTableView. If the user edits the text in the leftmost column,
> > this changes the key in a dictionary, which can cause the data to be
> > reordered. If this happens in outlineView:setObjectValue:
> > forTableColumn:byItem, I send a reloadData: to the NSOutlineView
> > instance after the data used by the data source has been changed.
> >
> > In an NSTableView, this works fine. In an NSOutlineView, this causes
> > a crash sometime after setObjectValue: has returned. I've checked and
> > re-checked my data source. Especially since an NSTableView works just
> > fine, is there a known problem or limitation that isn't documented
> > about doing this in an NSOutlineView? If there's something else I
> > need to do instead, what is it?
> If you believe the problem is that you're calling reloadData *during*
> setObjectValue, then you can test that hypothesis by calling reloadData *
> after* setObjectValue has returned. You can arrange that easily through
> delayed execution. m.
however, add a temporary method to send a reloadData to the
NSOutlineView in response to a temporary menu item. The NSOutlineView
reloads just fine when I do this (that doesn't solve my problem of
course).
I'm not certain calling reloadData during setObjectValue is really the
problem, since the documentation seems to suggest reloadData simply
sets a flag that is read the next time the view is displayed.
Paul Forgey Guest
-
Michael Ash #4
Re: NSOutlineView, calling reloadData during setObjectValue causes crash?
In article <207eddbd.0309171145.5397a6f7@posting.google.com >,
[email]paulf@aphrodite.com[/email] (Paul Forgey) wrote:
It is (as usual with Cocoa) unbelievably easy.>> > You can arrange that easily through
> > delayed execution. m.
> I'm not quite certain how I would go about doing that.
Instead of:
[thingy reloadData]
you do:
[thingy performSelector:@selector(reloadData) withObject:nil withDelay:0]
This will send reloadData once you get done doing what you're doing and
your program returns to the run loop.
Michael Ash Guest
-
Paul Forgey #5
Re: NSOutlineView, calling reloadData during setObjectValue causes crash?
Michael Ash <mail@mikeash.com> wrote in message news:<mail-5C9C01.22033817092003@localhost>...
That solved it. Thanks! This means reloadData: does do more than> In article <207eddbd.0309171145.5397a6f7@posting.google.com >,
> [email]paulf@aphrodite.com[/email] (Paul Forgey) wrote:
>>> >> > > You can arrange that easily through
> > > delayed execution. m.
> > I'm not quite certain how I would go about doing that.
> It is (as usual with Cocoa) unbelievably easy.
>
> Instead of:
>
> [thingy reloadData]
>
> you do:
>
> [thingy performSelector:@selector(reloadData) withObject:nil withDelay:0]
>
> This will send reloadData once you get done doing what you're doing and
> your program returns to the run loop.
setting a state flag, and the NSOutlineView in fact can't handle
reloadData: during setObjectData:
Paul Forgey Guest



Reply With Quote

