Questions tagged [cfstring]

Apple's suite of functions in CoreFoundation for string-handling. Toll-free bridged with NSString

107 questions
0
votes
2 answers

Filename string is used without and with @ sign

The iOS SpeakHere example code has a pair of methods in Class SpeakHereController, stopRecord and record that respectively save and initialize a file for saving the recording. The two methods handle the filename string slightly differently as you…
zerowords
  • 2,915
  • 4
  • 29
  • 44
0
votes
1 answer

CFStringCompare Overload

I am attempting to use CFStringCompare to compare strings, but I keep getting a Could not find an overload for == that accepts the supplied arguments. More specifically, the bit of code looks like: func imagePickerController(picker:…
Kengineer
  • 3
  • 4
0
votes
1 answer

typedef CFString starting with __

typedef const struct __CFString * a1; In the above typedef declaration says a1 is defined as a pointer to constant structure __CFString. Here what does "__" mean? Then I create a new definition as a2, described below. typedef const struct CFString…
NNikN
  • 3,720
  • 6
  • 44
  • 86
0
votes
1 answer

iPhone + NSString error

I have static NSString as below: static NSString *bowlerName; In the code I am assigning it with some value as below: -(void)setBowlerSpecifications:(int)playerId { Player *objPlayer = [CricketManagementDAL getBowlerSpecification…
pratik
  • 4,419
  • 8
  • 41
  • 65
0
votes
1 answer

Memory issue while uploading multiple images to server

I am uploading multiple images to server using ASIHTTPRequest. -(void)uploadImagesToServer { [[self networkQueue] cancelAllOperations]; // Creating a new queue each time we use it means we don't have to worry about clearing delegates or resetting…
Ankur Arya
  • 4,693
  • 5
  • 29
  • 50
0
votes
2 answers

IOS (AddressBook) - Unable to retrieve value of kABPersonFatherLabel and other labels

I am able to retrieve properties from an ABRecord easily. Ie: NSString *firstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty); But I am struggling to find a way to retrieve the value of CFStringRef constants from the…
PersuitOfPerfection
  • 1,009
  • 1
  • 15
  • 28
0
votes
1 answer

Search a string for an occurrence of characters of other string

I have two NSString, for example: stringOne = @"1760254913042013"; stringTwo = @"4917602549030391"; I need to compare both strings to find out if both have some string in common. In the example this common string would be @"17602549". Trying to…
0
votes
1 answer

app crash when accessing First name from address book due to memory management

I am trying to access all the first name value field from the address book. I am using this code for this CFStringRef firstName = ABRecordCopyValue(aSource, kABPersonFirstNameProperty); first_name=[NSString…
ankit mehta
  • 23
  • 1
  • 6
0
votes
0 answers

CFStringRef from char* without providing encoding type

I have a C string: unsigned char* contents = readInFile(path); //sting bytes in some unknown NSStringEncoding encoding. I want to know the current NSStringEncoding value of contents. I want to do this without using NSString usedEncoding methods. I…
ADude
  • 345
  • 5
  • 14
0
votes
3 answers

CFString: Count of characters NOT code points in a string

I'd like to know, is there any way to get number of characters (represented by the underlying Unicode code points) that are stored in CFString object in the CoreFoundation framework. There is available function: CFStringGetLength, but it does not do…
notsurewhattodo
  • 446
  • 4
  • 11
0
votes
1 answer

How do I use precomposedStringWithCanonicalMapping with CFStringref in plain C

I need to parse the defaults database for Recent files, in Mac Os X. This is done with sed. The caveat is that the filenames are stored in decomposed utf-16 inside there. So, I thought, (after having being pointed to the NSString functions) "why…
McUsr
  • 1,400
  • 13
  • 10
0
votes
1 answer

Core Foundation creates a memory leak for every call to CFSTR()

I normally use CFSTR() macro to create a CFString object from a standard c string until, after several test and checking better the documentation, I realized that every call to this function creates automatically a memory leak that lives until the…
0
votes
1 answer

Invalid CfStringRef plist (Array of dictionaries) iOS

I have the following code in my file NSString *filePath = [[NSBundle mainBundle]pathForResource:@"images" ofType:@"plist"]; NSArray *array = [[NSArray alloc]initWithContentsOfFile:filePath]; for (id dict in array)…
Dfranc3373
  • 2,048
  • 4
  • 30
  • 44
-1
votes
4 answers

variable is not a CFStringRef

I have this: partenaire_lat = 48.8160525; partenaire_lng = 2.3257800; And obtain a NSString like this: NSString *endPoint =[NSString stringWithFormat:@"%@,%@", partenaire_lat, partenaire_lng]; and after using this NSString in some context I get…
adrian
  • 4,574
  • 17
  • 68
  • 119
-1
votes
2 answers

Invalid operands to binary * ( have 'char *' and 'char *' )

Here is my code: NSString *string = @"Ciyt"; const char *City = [CityString UTF8String]; CFStringRef value = CFSTR(&City); show following error at third row in Xocde: Invalid operands to binary expression ( 'char *' and 'char *' ); Any…
Stoull
  • 1,098
  • 8
  • 13