CFString
and NSString
are toll-free bridged so they are the same thing. (CFSTR
is a macro to create a CFString
). However you have to explicitly signal this to the compiler as the pointers have different types. Moreover, in ARC you will have to use a bridged cast, as you are crossing the boundaries between objects and C structs.
Here's how you use a bridged cast
[[NSNotificationCenter defaultCenter] postNotificationName:(__bridge NSString *)kUpdateTeamNotification object:team];
More info on bridged casts can be found here: NSString to CFStringRef and CFStringRef to NSString in ARC?
However you might want to use a NSString
literal as opposed to a CFStringRef
and also to use a NSString *const
(as explained in Constants in Objective-C) as opposed to a #define
.
So your constant would become
Header file (.h)
FOUNDATION_EXPORT NSString *const kUpdateTeamNotification;
Implementation file (.m)
NSString *const kUpdateTeamNotification = @"kUpdateTeamNotification";