Questions tagged [cfstring]

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

107 questions
1
vote
3 answers

How to use CFDictionarySetValue in swift?

Currently, I am converting the hardware decoding Obj-C code to Swift version. (Xcode 8, Swift 3). I don't know how to set up a dictionary to set up an output option on the screen, also, I don't know how to use it. The following code works fine in…
1
vote
2 answers

Writing text on pdf ios

Hello I have followed this guide to write text on pdf file. This guide maybe old but follows the same approach as in apple docs What I have done so far: PdfCreator.m const int A4_WIDTH = 612; const int A4_HEIGHT = 792; @interface…
Sanandrea
  • 2,112
  • 1
  • 27
  • 45
1
vote
0 answers

-[CFString retain]: message sent to deallocated instance

I am getting the error: "-[CFString retain]: message sent to deallocated instance" when returning [NSString stringWithFormat:@"%d is reserved for future use",reportID]; to objectValueForTableColumn in an NSOutlineController. But when the literal…
oregonduckman
  • 389
  • 2
  • 13
1
vote
1 answer

Extra \N{...} when using kCFStringTransformToUnicodeName or NSStringTransformToUnicodeName

let string = "\u{00A0}" // no-break space let transformed = string.stringByApplyingTransform(NSStringTransformToUnicodeName, reverse: false) Expected result: NO-BREAK SPACE Actual result: \N{NO_BREAK_SPACE} Why the extra \N{ and }? What are they…
Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
1
vote
1 answer

Converting Swift to Objective-C explanation of compiler warning?

I want to create a wrapper around the NSURLSession and I found some nice code but was written in Swift.https://github.com/daltoniam/SwiftHTTP.But since I still write production code in Objective-C I started borrowing the idea of the above code,…
George Taskos
  • 8,324
  • 18
  • 82
  • 147
1
vote
1 answer

Memory issue with CFString

When I turn off the WiFi during a series of AFNetworking server requests, I am getting increase of memory without any reason. I have provided the memory profile given by instruments. Why is this increasing while not doing anything? How can I get rid…
1
vote
2 answers

NSData encoding

Currently, I'm trying to parse an NSData in my iOS app. Problem is, I can't seem to find a proper hebrew encoding for parsing. I must decode the data using the Windows-1255 encoding (hebrew encoding type for windows) or ISO 8859-8 encoding, or I'll…
Lior Pollak
  • 3,362
  • 5
  • 27
  • 48
1
vote
2 answers

Can't seem to cast from NSString* to CFString* using ARC

I am using the following code to obtain a file's file type in Objective-C (Mac OS X Cocoa Application): NSString *kind = nil; NSURL *url = [NSURL fileURLWithPath:[path stringByExpandingTildeInPath]]; LSCopyKindStringForURL((CFURLRef)url,…
Nickersoft
  • 684
  • 1
  • 12
  • 30
1
vote
2 answers

How to know the object name based on memory address in objective c

Hi one of my app is crashing repeatedly and giving below error. *** -[CFString release]: message sent to deallocated instance 0x1b7a3b70 Is there any way to get the object name by using memory address. I used instruments (Zombie) and even i…
Naresh
  • 21
  • 3
1
vote
2 answers

Are UniChar (from CFString) and unichar (from NSString) the same?

I was triggered to this question because I used a category method on NSString from this answer to count the number of occurrences for a specific character: https://stackoverflow.com/a/15947190/472599 This method is very fast, by using the special…
Bjinse
  • 1,339
  • 12
  • 25
1
vote
1 answer

How to replace old ParamText/StandartAlert with newer CFString replacements?

ParamText() is an really old way of replacing parameters in a string that is based on Pascal strings. Also StandardAlert is not quite Unicode ready. The new message box (not so new) replacement is CFUserNotificationDisplayNotice but this one expects…
sorin
  • 161,544
  • 178
  • 535
  • 806
1
vote
1 answer

Create constant NSString from constant CFStringRef

I am attempting to create a Cocoa Framework that is an object-oriented wrapper around a procedural framework written in the Core Foundation. The procedural framework has a number of constants that are all defined as extern CFStringRef…
Randall
  • 725
  • 9
  • 27
1
vote
0 answers

CFString allocations issue using ARC

In my application I am dealing with uploading of images. My images are in documents directory. I am using NSFileManager to get the data from it and converting to base 64 encoding. Everything goes good while uploading. But after successful uploading…
Pooja M. Bohora
  • 1,311
  • 1
  • 14
  • 42
1
vote
1 answer

Code segfaults unless esp incremented

I have the following code all it is suppose to do is print Hello World using CoreFoundation functions. However whenever I seemingly have a proper aligned stack it doesn't work, seg faulting. But then when I finally got it working the stack isn't…
Zimm3r
  • 3,369
  • 5
  • 35
  • 53
1
vote
3 answers

Incompatible pointer types sending 'const CFStringRef' (aka 'const struct __CFString *const') to parameter of type 'id'

I am trying this in my cocoa app to get the information of directory/Files in system. This method return me a dictionary with some key attribute listed -(NSDictionary *) metadataForFileAtPath:(NSString *) path { NSURL *url = [[[NSURL alloc]…
Surjeet Singh
  • 11,691
  • 2
  • 37
  • 54