Collection Object

Philip Mötteli philip.moetteli at econophone.ch
Thu Aug 3 09:49:53 CDT 2006


Am 03.08.2006 um 09:20 schrieb Ruslan Zasukhin:
> On 8/2/06 8:19 PM, "Philip Mötteli" <philip.moetteli at econophone.ch>  
> wrote:

> Sorry for little slow down in this discussion.

Well, I thought you're already working on the solution.	:-)


>
>>>> What do they inherit?
>>>
>>> Class T1 : public NSObject
>>> {
>>> }
>>>
>>> What it inherit ?
>>>
>>>     * Some RTTI ?
>>>     * Ability to be NSObject
>>>
>>> Right?
>>
>> In the dynamic environment/program, they inherit the functionality of
>> NSObject, which consists of about 150 methods, depending on the
>> linked libraries.
>
>> And again: Not important for collections. I can add to a collection
>> object an object, that is not inheriting from NSObject and it would
>> work without a hick.
>
> In C++ this is not possible

I told you, you need dynamic binding.


>> I just have to implement -retain and -release
>
> In fact this sounds for me that you inherit from IUnknown.
> May be this is hidden for you as Obj-C developer...

No, the collection just treats them as (void*) – as simple pointers.
Don't you understand: By having dynamic binding, the compiler doesn't  
need to bind the method/function at compile time. It is dynamically  
resolved at runtime. The collection only stores a bunch of numbers of  
'sizeof(void*)'.


À suivre…



More information about the Valentina mailing list