Re: general questions (another noob)
Re: general questions (another noob)
- Subject: Re: general questions (another noob)
- From: Jens Bauer <email@hidden>
- Date: Sat, 6 Sep 2003 14:24:35 +0200
Hi Aubrey,
On Saturday, Sep 6, 2003, at 10:32 Europe/Copenhagen, Aubrey wrote:
I'm just beginning to learn cocoa and I was wondering if anyone could
tell me:
1. what will compare the fastest on a sort on a G4, (int, float,
object?)
I never made any tests on this, however, if looking at the sizes..
int 4 bytes
float 4 or 8 bytes (usually 8!)
object 4 bytes (pointer, however, further comparison would be needed if
the pointer isn't the same)
I'd pick int. int is always 4 bytes, the others may require more.
2. are there such things as recursive objects?
if so, is there any reason to use them?
It depends on what you mean. If you mean an object that hold an
instance of an object of the same kind, you can write a recursive
object yourself.
I'd say, if you have a list of objects, where some of them need a bunch
of children, you could probably call it recursive:
@interface MyObject : NSObject
{
NSArray *children;
}
- (NSArray *)children;
@end
You'd usually use an NSArray of MyObjects to iterate through all of
them.
But remember that ObjC is C with extensions, so everything you can do
in C, you can do in ObjC...
Love,
Jens
_______________________________________________
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.