Questions tagged [cfstring]

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

107 questions
0
votes
0 answers

How get seperated lines inside a CFString?

I want a good way for seperating lines inside a huge string. I searched and found this article: https://medium.com/@sorenlind/three-ways-to-enumerate-the-words-in-a-string-using-swift-7da5504f0062 Base on this article I want use CFStringTokenizer.…
Mohammad Eslami
  • 536
  • 1
  • 6
  • 17
0
votes
1 answer

CFString isNaturallyRTL - message sent to deallocated instance

I already googled for "CFString isNaturallyRTL" with 0 results. these are my classes: //in .H @interface myViewController : UIViewController { UITextField *from; UITextField *to; NSString *fromText; NSString *toText; } @property (nonatomic, retain)…
elp
  • 8,021
  • 7
  • 61
  • 120
0
votes
1 answer

CFStringCreateWithCString returns null for string w/ less than 10 characters

I'm trying to create a new CFStringRef from a const char* at runtime, but CFStringCreateWithCString returns null for all strings shorter than 10 characters: // Test w/ 9-character string CFStringRef str1 = CFStringCreateWithCString(NULL,…
lukas
  • 2,300
  • 6
  • 28
  • 41
0
votes
1 answer

Memory management when using CFStrings from de AddressBook

I am reading records from the AddressBook using the Apple provided API. I am still getting my head around memory management and so CFStrings are confusing me at the moment. This is how I am getting the properties: //Get Basic properties NSString*…
Zebs
  • 5,378
  • 2
  • 35
  • 49
0
votes
0 answers

Sending a UIImage over a simple socket as a CFString

I was trying to send a UIImage over a simple socket that only accepts CFString for passing data. I tried converting the UIImage into NSData into NSString into CFString and back, but the final UIImage is always nil. Conversion: NSData *dataImage =…
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
0
votes
1 answer

Trying to append a string to another string from a NSTextField for printing on a PDF file

I have a method that saves the customer data entered in on the form that calls a method to createPDFFile. I have the PDF file created and I have some filler strings in there currently so that I could lay out the PDF file and I now want to take the…
Beanno1116
  • 239
  • 2
  • 3
  • 10
0
votes
1 answer

NSString* to CFStringRef results in useless char array

I have the following code snippet: -(CFStringRef)setupFileName:(NSString*)_name :(NSString*)_extension { NSString* tmpName = [_name stringByAppendingString:_extension]; CFStringRef ref = (__bridge CFStringRef)tmpName; return ref; } When I break at…
easysaesch
  • 159
  • 1
  • 14
0
votes
2 answers

how to retrieve CFStringEncoding in Swift other than CFStringGetSystemEncoding()?

let cStringRef : CFStringRef = CFStringCreateWithCString(nil, NSBundle.mainBundle().pathForResource("Luffy", ofType: "mp3")! , kCFStringEncodingMacRoman) this encoding isn't working, though it is present in the Documentation. to get MacRoman, I…
Krishna
  • 673
  • 3
  • 6
  • 21
0
votes
1 answer

CFStringRef release gives bad access when it is nil

ABMultiValueRef phonesRef = ABRecordCopyValue(person, kABPersonPhoneProperty); for (int i=0; i < ABMultiValueGetCount(phonesRef); i++) { CFStringRef currentPhoneLabel = ABMultiValueCopyLabelAtIndex(phonesRef, i); CFStringRef…
Paras Gorasiya
  • 1,295
  • 2
  • 13
  • 33
0
votes
1 answer

Returning NSString, Error Message: Variable is not CFString

i shortly started Programming Mac OS X Applications with Cocoa, so its a realy New bee question. Sorry about this. At first my code snippet: - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn…
Dennis Stritzke
  • 5,198
  • 1
  • 19
  • 28
0
votes
1 answer

CFStringRef change color in Objective-c

Is it possible to change the color for a CFStringRef? I want to have the text red for example, by default is black, how can I change this? I tried this: -(void)drawText:(NSString*)textToDraw inFrame:(CGRect)frameRect { CFStringRef stringRef =…
Adina Marin
  • 663
  • 1
  • 4
  • 15
0
votes
1 answer

Cannot invoke 'UTTypeEqual' with an argument list of type '(CFString!, CFString!)'

How do I get this to compile? On the second line of this function: func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { let mediaType = info[UIImagePickerControllerMediaType]…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
0
votes
1 answer

Convert NSArray to CFStringRef *

I need a way to convert an NSArray to a null terminated list compatible with the arguments option of DADiskMountWithArguments. The documentation specifies the argument option to be a "Null terminated list" of type CFStringRef arguments[]. I have…
0
votes
1 answer

Why is my UILabel getting deallocated?

Im trying to track down the source of a crash. I've profiled the app to look for zombies and it appears to be related to updating the text in one of my UILabels. I don't think I am setting the text value improperly. Does this look right? This is…
0
votes
0 answers

iOS memory leaks. CFString and Unity

When I run my game made with unity with the xCode at the beginning it looks ok (main menu + intro). But when I load the first level the memory usage grows until 300MB (just 40MB when I load it on the Unity editor). Using Instruments, in the…
Javier
  • 1
  • 3