Re: Even more DO problems
Re: Even more DO problems
- Subject: Re: Even more DO problems
- From: Sailor Quasar <email@hidden>
- Date: Tue, 10 Jun 2003 23:32:01 -0400
On Tuesday, June 10, 2003, at 10:03 PM, publiclook wrote:
Dealing with retain counts has caused me a significant amount of
confusing crashes and code tinkering. I use NSDictionary to pass data
between threads, which causes stray retains everywhere, I have to
account for the retains NSConnection takes on the delegate and root
object, the retains the local objects are doing on the proxies... I'm
sure it's very simple to someone experienced,
The reference counting was add to the frameworks largely to support
distributed objects!
but I come from a paradigm where you're always paranoid about
disposing objects because you don't know what has a grip on it... I
also got a lot of autorelease confusion over whether NSNumber's
What confusion ? Did you obtain the object with a method with the
word alloc in it ? Did you call retain ? Then why on earth would you
release or autorelease the object ? It is that simple!
+numberWithWhatever methods autorelease the objects they return.
It's always nice to crash in
It may not be autoreleased but it is non of your concern because
+numberWithWhatever does not include the word alloc!
Excuse me, but I believe I pointed out that this is obvious to the
experienced, which isn't me.
NSAutoreleasePool's release, with no indication of what the heck
object its crashing because was already disposed. I've found gdb's
call command invaluable here =). call (unsigned)[(id)[self
You can type > po [someObject retainCount] in gdb
You can type just > po someObject
That's nice to know.
You can enable zombies... This makes it easy to find which objects are
being re-released frm an autorelease pool. See NSDebug.h
Well well, how nice that someone told me about this.
ivar] retainCount] gets a bit annoying though... anyway, this appears
to work except for the fact that calling NSConnection's invalidate
and release methods on the parent NSConnection doesn't appear to
invalidate a proxy held by the remote client, even though invalidate
is specifically documented as doing so. And the continuing problem
that I can't get the message to get anywhere without the oneway
modifier...
Buy "Cocoa Programming" It includes a simple DO example. The oneway
keyword is not required and you seem to be making everything way too
difficult.
Care to explain to me what I'm making too complicated? I've read the
examples and samples and documentation. NONE of the ones I've found
provide examples for dealing with NSSocketPort, only for inter-thread
communication. I'm WELL aware that "oneway" isn't required, except that
when I don't use it everything breaks miserably. I could be messing up
the threading, to be sure.
-- Sailor Quasar, guardian of Leraz's memory
"Face of stone, mind of calm, soul of love."
Email: email@hidden
_______________________________________________
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.