Introduction to String Programming Guide for Cocoa
String Programming Guide for Cocoa describes how to create, search, concatenate, and draw strings. It also describes character sets, which let you search a string for characters in a group, and scanners, which convert numbers to strings and vice versa.
Who Should Read This Document
You should read this document if you need to work directly with strings or character sets.
Organization of This Document
This document contains the following articles:
“Strings” describes the characteristics of string objects in Cocoa.
“Creating and Converting String Objects” explains the ways in which
NSStringand its subclass
NSMutableStringcreate string objects and convert their contents to and from the various character encodings they support.
“Formatting String Objects” describes how to format
“String Format Specifiers” describes
printf-style format specifiers supported by
“Reading Strings From and Writing Strings To Files and URLs” describes how to read strings from and write strings to files and URLs.
“Searching, Comparing, and Sorting Strings” describes methods for finding characters and substrings within strings and for comparing one string to another.
“Paragraphs and Line Breaks” describes how paragraphs and line breaks are represented.
“Characters and Grapheme Clusters” describes how you can break strings down into user-perceived characters.
“Character Sets” explains how to use character set objects, and how to use
NSCharacterSetmethods to create standard and custom character sets.
NSScannerobjects, which interpret and convert the characters of an
NSStringobject into number and string values.
“String Representations of File Paths” describes the
NSStringmethods that manipulate strings as file-system paths.
“Drawing Strings” discusses the methods of the
NSStringclass that support drawing directly in an
For more information, refer to the following documents:
Attributed String Programming Guide is closely related to String Programming Guide for Cocoa. It provides information about
NSAttributedStringobjects, which manage sets of attributes, such as font and kerning, that are associated with character strings or individual characters.
Data Formatting Guide describes how to format data using objects that create, interpret, and validate text.
Internationalization Programming Topics provides information about localizing strings in your project, including information on how string formatting arguments can be ordered.
String Programming Guide for Core Foundation in Core Foundation, discusses the Core Foundation opaque type CFString, which is toll-free bridged with the
© 1997, 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)