• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
__bridge cast on CF object stored in NSDictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__bridge cast on CF object stored in NSDictionary?


  • Subject: __bridge cast on CF object stored in NSDictionary?
  • From: Rick Mann <email@hidden>
  • Date: Tue, 13 Dec 2011 18:40:09 -0800

I've read the docs a couple times, but still am not sure what's going on in this instance:

	CTFontRef f = CTFontCreateWithName((__bridge CFStringRef) name, inFont.pointSize, NULL);
	[self.currentAttrs setValue: (id) f forKey: (NSString*) kCTFontAttributeName];
	CFRelease(f);

self.currentAttrs is an NSMutableDictionary. The CTFontRef f is generating an error when passed to setValue:

Cast of Objective-C pointer type 'NSString *' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast

What type of __bridge cast should I use here?

Thanks,
Rick

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: __bridge cast on CF object stored in NSDictionary?
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: Static analyser less rigorous nowadays?
  • Next by Date: Re: __bridge cast on CF object stored in NSDictionary?
  • Previous by thread: Re: Does ARC require LLVM 3.0?
  • Next by thread: Re: __bridge cast on CF object stored in NSDictionary?
  • Index(es):
    • Date
    • Thread