MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSCharacterSetMBS class

class, Cocoa, MBS CocoaBase Plugin (NSCharacterSet), class NSCharacterSetMBS,
Plugin version: 9.6, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: An NSCharacterSet object represents a set of Unicode-compliant characters.
Example:
// get the Symbol font
dim n as NSFontMBS = NSFontMBS.fontWithName("Symbol",10)

// what characters are defined for this font?
dim c as NSCharacterSetMBS = n.coveredCharacterSet

// display a string with all the characters
MsgBox c.StringValue
Notes:
NSString and NSScanner objects use NSCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. The cluster's two public classes, NSCharacterSet and NSMutableCharacterSet, declare the programmatic interface for static and dynamic character sets, respectively.

The objects you create using these classes are referred to as character set objects (and when no confusion will result, merely as character sets). Because of the nature of class clusters, character set objects aren't actual instances of the NSCharacterSet or NSMutableCharacterSet classes but of one of their private subclasses. Although a character set object's class is private, its interface is public, as declared by these abstract superclasses, NSCharacterSet and NSMutableCharacterSet. The character set classes adopt the NSCopying and NSMutableCopying protocols, making it convenient to convert a character set of one type to the other.

The NSCharacterSet class declares the programmatic interface for an object that manages a set of Unicode characters (see the NSString class cluster specification for information on Unicode). NSCharacterSet's principal primitive method, characterIsMember:, provides the basis for all other instance methods in its interface. A subclass of NSCharacterSet needs only to implement this method, plus mutableCopyWithZone:, for proper behavior. For optimal performance, a subclass should also override bitmapRepresentation, which otherwise works by invoking characterIsMember: for every possible Unicode value.

NSCharacterSet is "toll-free bridged" with its Cocoa Foundation counterpart, CFCharacterSet Reference. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSCharacterSet * parameter, you can pass a CFCharacterSetRef, and in a function where you see a CFCharacterSetRef parameter, you can pass an NSCharacterSet instance (you cast one type to the other to suppress compiler warnings). See Interchangeable Data Types for more information on toll-free bridging.

The mutable subclass of NSCharacterSet is NSMutableCharacterSet.

Sub classes:

Some methods using this class:

Some properties using for this class:


The items on this page are in the following plugins: MBS CocoaBase Plugin.


NSCellMBS   -   NSClipViewMBS




Links
MBS Xojo PDF Plugins