I have the following code snippet:
NSString* tmpName = [_name stringByAppendingString:_extension];
CFStringRef ref = (__bridge CFStringRef)tmpName;
CFStringRef tickWav = [self setupFileName:_name :kTick];
There is no automatic CFTypeRef memory management. If you were to return an NSString, it would be autoreleased. Not so for a CFStringRef. So you must do the work yourself.
You need to retain the CFStringRef with CFRetain and do a
__bridge_retained cast, not a
__bridge cast. You are crossing the bridge from the object world to the CFTypeRef world; you must provide memory management on this string as it crosses the bridge. You will then need to release the CFStringRef manually later on in the receiving code, or it will leak.