Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: COCOAisms vs DOMisms vs CoreFoundationISMs



On Apr 18, 2006, at 8:46 AM, Matt Gough wrote:

1. When a DOM method returns a newly created object, that object will be an autoreleasing object.

e.g

- (DOMNodeIterator *)createNodeIterator:(DOMNode *)root :(unsigned long)whatToShow :(id <DOMNodeFilter>)filter :(BOOL) expandEntityReferences;

Sure, a method like this one will return an autoreleased object.

2. Where the DOM object has a detach method (DOMNodeIterator and DOMRange), that method does not need to be called (assuming that the autoreleasing assumption is correct), but it can be.

That's right. The detach method has nothing to do with the lifetime of the object reference. You can call or not as you like. This is the same in JavaScript and Objective-C.


3. All of the DOM classes inherit from DOMObject and that says it conforms to NSCopying. I am guessing however that calling [someDOMObject copy] is not going to produce a standalone copy of many object types. As such, unless there is a 'cloneXXX' method declared for the class such a standalone copy cannot be produced.

I think it's a bug that DOMObject says it conforms to NSCopying. None of the DOMObject subclasses are copyable with the "copy" method.


    -- Darin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden
References: 
 >COCOAisms vs DOMisms vs CoreFoundationISMs (From: Matt Gough <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.