Le 30 janv. 2010 à 01:44, Chunk 1978 a écrit :

> i'm almost 100% sure it's not possible to return a nil on basic data
> types, but just incase i'll post the question.
> 
> ------------------------------------------------------
> - (float)panForSoundWithName:(NSString *)soundName
>       {
>       OpenALSound *sound = [soundDictionary objectForKey:soundName];
>       if (!sound) return 0.0f;        
>       return sound.pan;
>       }
> ------------------------------------------------------
> 

One solution is to change you API and use byref value.

- (BOOL)getPan:(float *)thePan ForSoundWithName:(NSString *)soundName {
        NSParameterAssert(thePan);
        OpenALSound *sound = [soundDictionary objectForKey:soundName];
        if (!sound) return NO;
        *thePan = sound.pan;
        return YES;
}

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to