Re: Archiving or copying observers and elements
Re: Archiving or copying observers and elements
- Subject: Re: Archiving or copying observers and elements
- From: Mike Engber <email@hidden>
- Date: Thu, 12 Dec 2002 09:59:19 -0800
structures. For example, the reference could be used with CFEqual to
clean
out any cached references I still have hanging around after a
UIElement is
destroyed. (Mike Engber explained that possibility to me recently.) In
the
process of designing such a system, it might prove useful on occasion
to
make a copy of the reference instead of just CFRetaining it again,
depending
on what I'm doing and how I'm handling memory management.
I don't see why you would need a copy. These element refs are immutable
objects, the ability to retain _should_ suffice for whatever management
scheme you come up with.
Now, if you're planning to send these over to a different process, then
I guess
you would need some help flattening them. If you really need this, you
could try working around it (inefficiently) by using the relative
position of a UIElement in the hierarchy (e.g. pid551's first child's
third child's second child). Yeah, it seems pretty nasty, but it's easy
to try.
In general, in Cocoa there are several commonly used operations that
require
you to mark your classes as conforming to the NSCoding or NSCopying
Notice that the creation of an observer takes a function pointer. So I
don't think it's possible to get them to work with NSCoding (i.e.
flatten them).
-ME
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.