like many other application framework, ZFFramework use single inheritance, most of elements inherit from ZFObject
and, we use retain count logic to manage memory, just like Object-C
to create an object, you must use one of alloc function supplied by ZFFramework:
#define zfnull
same as NULL, defined for future use
Definition ZFCoreTypeDef_CoreType.h:50
#define zfRelease(obj)
release an object, see ZFObject
Definition ZFObjectRetain.h:140
#define zfAlloc(T_ZFObject,...)
alloc an object, see ZFObject
Definition ZFObjectRetain.h:96
#define zfRetain(obj)
retain an object, see ZFObject
Definition ZFObjectRetain.h:120
base class of all objects
Definition ZFObjectCore.h:214
once allocated, you may use object's member method just like normal C++ object:
Advanced
tired of writing retain and release everywhere? we also supply some utility methods to make it easier to manage allocated object:
{
}
{
}
#define zflineRelease(obj)
convenient method to release the object after code line end
Definition ZFObjectAutoPtr.h:89
#define zfautoRelease(obj)
make object autorelease, which would be released by the owner thread
Definition ZFThread_zfautoRelease.h:38
a ZFObject holder which would release content object automatically when destroyed
Definition zfautoFwd.h:34
util class to alloc and hold ZFObject type
Definition ZFObjectAutoPtr.h:163
it's recommended to use zfauto for API design when your function needs to return an allocated object