![]() |
CFStringCreateWithCharacters | Header: CFString.h |
Creates a CFString object from a buffer of Unicode characters.
CFStringRef CFStringCreateWithCharacters ( CFAllocatorRef alloc, const UniChar *chars, CFIndex numChars );
Pass a reference to an allocator used to create the object or pass NULL to request the default allocator.
Pass a pointer to a buffer that contains Unicode characters that will be copied into the CFString.
Pass an integer specifying the number of characters in the buffer pointed to by chars. Only this number of characters will be copied to internal storage.
A reference to an immutable CFString object or NULL if there was a problem creating the object.
The CFStringCreateWithCharacters function creates an immutable CFString object from a client-supplied Unicode buffer. You must supply a count of the characters in the buffer. This function always copies the characters in the provided buffer into internal storage.
To save memory, this function might choose to store the characters internally in a 8-bit backing store. That is, just because a buffer of UniChar characters was used to initialize the object does not mean you will get back a non-NULL result from CFStringGetCharactersPtr.