Re: Two basic questions
Re: Two basic questions
- Subject: Re: Two basic questions
- From: Ondra Cada <email@hidden>
- Date: Thu, 28 Feb 2002 18:48:30 +0100
Markus,
>
>>>>> Markus Hitter (MH) wrote at Thu, 28 Feb 2002 17:35:45 +0100:
MH> >Acks, oops. Sorry, I meant; "returned from a function". Sorry
MH> >about that all.
MH>
MH> In Objective-C there are no functions.
Sorry, but that's not true. There's as many of functions as your heart like,
and some of them even in the standard Cocoa API. Don't forget that ObjC is a
superset of C.
MH> >- (NSString *)myFunc
MH> >{
MH> >NSMutaleString *string = [NSMutableString stringWithCapacity:0];
MH> >[string appendString:@"test"];
MH>
MH> // You should convert to the correct type as well as take care of
MH> // deallocation:
MH>
MH> return [[string copy] autorelease];
Not necessarily; it depends on context. The original code was all right.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.