Apple's suite of functions in CoreFoundation for string-handling. Toll-free bridged with NSString
Questions tagged [cfstring]
107 questions
3
votes
1 answer
iphone: -[CFString release]: message sent to deallocated instance
an app I'm working on keeps crashing when run on the iPhone but not on the Simulator (although a warning is shown when run without symbolic malloc_error_break, but the app keeps working on the Sim)
I'm not manually releasing any string, instead, i…

David Homes
- 2,725
- 8
- 33
- 53
3
votes
3 answers
What Is -[NSURL _fastCharacterContents]:?
So I'm calling this in a method:
-(id)initWithContentURL:(NSString *)url {
if (self = [super init]) {
NSLog(@"xSheetMusicViewController - %@",url);
// Casting an NSString object pointer to a CFStringRef:
CFStringRef cfString =…

CodaFi
- 43,043
- 8
- 107
- 153
3
votes
1 answer
Instruments CFString (store)
I am running instruments on an app. According to instruments there aren't any leaks detected.
However, the category CFString (store) keeps rising. Does anyone know what CFString (store) is?
Could this mean I have a leak?

Michael B
- 71
- 4
3
votes
1 answer
How to cast string to cfstring in C#
I have the following code to convert a String to a CFString and backwarts:
string path = @"C:\Users\ayi\Desktop\Failed\AngryBirds.ipa";
IntPtr p_path = __CFStringMakeConstantString(path);
CoreFoundation.CFString cfstring = new…

pizixie
- 31
- 2
3
votes
1 answer
CFStringGetCStringPtr returns NULL on iOS7
I have the following code in my Application:
static void foo(CFStringRef str)
{
CFStringEncoding encoding = CFStringGetSystemEncoding();
const char * cString = CFStringGetCStringPtr(str, encoding);
//.....
}
It's been…

Yoshkebab
- 770
- 1
- 7
- 14
3
votes
1 answer
Strange behaviour from CFStringCompareWithOptions
I'm trying to find out exactly how I can match the first n characters of a string with another. Here's some code I've got at the moment:
CFStringRef myStringRef = CFSTR("hello");
CFStringRef otherStringRef = CFSTR("helloworld");
CFIndex cmpChars =…

benwad
- 6,414
- 10
- 59
- 93
2
votes
1 answer
Passing a CFStringRef pointer to a C function in MacRuby
I wanted to call the following function from OS X's DVDPlayback framework:
OSStatus DVDGetMediaVolumeCFName (
CFStringRef *outDiscVolumeCFName
);
Eventually, I came up with the following working code:
framework 'DVDPlayback'
p2 =…

Sean DeNigris
- 6,306
- 1
- 31
- 37
2
votes
2 answers
Mono C# PInvoke - Get CFString from external lib
I have a lib that returns a CFString, and I'm trying to get that string value in C#..
The problem is that I don't know how to do this in C#..
Making the external function return a CFString won't work as it throws an exception "Type…

BraCa
- 351
- 1
- 5
- 13
2
votes
2 answers
How to Iterate through dataframe using f-strings?
Iterate through dataframe using f-strings
Imagine you have the following df:
d = {'KvK': [0.21, 0.13, 0.1], 'line amount#2': [0.0, 0.05, .05], 'ExclBTW': [0.5, 0.18, .05]}
df = pd.DataFrame(data=d)
df
KvK line amount#2 ExclBTW
0 0.21 …

Max
- 493
- 2
- 9
2
votes
1 answer
How to silence Xcode 4 warning "Semantic Issue: CFString literal contains NUL character"?
I am using something like:
illegalCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"\x00\.."] retain];
Xcode 4 displays a warning for it
(Semantic issue: CFString literal
contains NUL character)
Is there any way to fix that? I…

Josh
- 61
- 2
2
votes
1 answer
large CFString allocations when running under Zombies instrument but not leaks or allocations instrument
I'm in the process of ironing out a few memory allocation issues in my iPad app and have spent a long while watching CFString grow and grow and grow (as a still living object) under the zombies instrument, it wasn't until I switched to the Leaks or…

Matt
- 4,253
- 1
- 27
- 29
2
votes
0 answers
Variable Not a CFString
I am using a database to populate a table view.
I created an NSMutable Array of object in the AppDelegate. The Array is populated from the DB as follows:
if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
const char *sql = "select…

Aaron
- 21
- 2
2
votes
1 answer
How to customize CFString transliteration in Cocoa / Cocoa Touch / Foundation
I am exploring how to use CFStringTransform to transliterate texts in Hebrew and I am stuck with a few inconsistencies in which letters that should be pronounced differently are written in the exact same way or special cases that are not taken into…

catalandres
- 1,149
- 8
- 20
2
votes
1 answer
'[CFString!]' is not convertible to '[String]'
Before Swift 1.2 I had following array:
private let phoneLabels = [
kABPersonPhoneMobileLabel,
kABPersonPhoneIPhoneLabel,
kABWorkLabel,
kABHomeLabel,
kABPersonPhoneMainLabel,
kABPersonPhoneHomeFAXLabel,
…

Shmidt
- 16,436
- 18
- 88
- 136
2
votes
2 answers
What kind of strings does CFStringCreateWithFormat expects as arguments?
The below example should work with Unicode strings but it doesn't.
CFStringRef aString = CFSTR("one"); // in real life this is an Unicode string
CFStringRef formatString = CFSTR("This is %s example"); // also tried %S but without…

sorin
- 161,544
- 178
- 535
- 806