Re: CFURLRef -> NSRURL* ???
Re: CFURLRef -> NSRURL* ???
- Subject: Re: CFURLRef -> NSRURL* ???
- From: David Remahl <email@hidden>
- Date: Tue, 25 Mar 2003 01:04:40 +0100
Yes, it is OK to do that. The types are "toll free bridged" to their
Foundation counterparts. Look up toll free bridging in the
documentation for more information on how it is used, and what types
are bridged.
/ Rgds, David Remahl
on the archive I see this sample of code (<see at the end of the mail>)
where the guy simply cast a CFURLRef to a NSURL* !!!!
is it correct ?
does it work for CFStringRef -> NSString* and
CFNumberRef -> NSNumber* ???
// ---- code sample ----
- (NSString *)findSystemFolderType:(int)folderType
forDomain:(int)domain
{
FSRef folder;
OSErr err = noErr;
CFURLRef url;
NSString *result = nil;
err = FSFindFolder(domain, folderType, false, &folder);
if (err == noErr) {
url = CFURLCreateFromFSRef(kCFAllocatorDefault, &folder);
result = [(NSURL *)url path];
}
return result;
}
_______________________________________________
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.