[iPhone] CFAttributedStringRef autorelease - not possible?
[iPhone] CFAttributedStringRef autorelease - not possible?
- Subject: [iPhone] CFAttributedStringRef autorelease - not possible?
- From: Michael Hoy <email@hidden>
- Date: Sun, 19 Jul 2009 12:13:11 -0400
Here's some code:
NSString *m_scanString = @"This is a test.";
CFDictionaryRef emptyDic = (CFDictionaryRef)[NSDictionary dictionary];
CFAttributedStringRef attString =
CFAttributedStringCreate(kCFAllocatorDefault,
(CFStringRef)m_scanString, emptyDic);
CFMutableAttributedStringRef linkifiedString =
CFAttributedStringCreateMutableCopy(kCFAllocatorDefault, 0, attString);
NSLog(@"%@", (NSString *)CFAttributedStringGetString(linkifiedString));
[(id)linkifiedString autorelease];
Testing in a Mac OS 10.5 SDK, this code works. In the iPhone 3.1 SDK,
the last line of code (calling autorelease on
CFMutableAttributedStringRef) gives EXC_BAD_ACCESS. Everything else
works as expected.
Is CFAttributedStringRef not castable to id or NSObject* in the iPhone
environment?
Thanks,
~ Michael Hoy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden