Key-Value Observing
Key-Value Observing (KVO) has an ugly, wordy API, but it is one of Cocoa’s most powerful features.
Key-Value Observing (KVO) has an ugly, wordy API, but it is one of Cocoa’s most powerful features.
NSHashTable acts as a general version of NSSet. It is mutable, holds weak references, can copy items on input, and handles arbitrary pointers using pointer identity for equality and hashing.
NSPredicate is a Foundation class that defines logical conditions to fetch or filter data. Its syntax mixes SQL WHERE clauses with regex for expressive queries on collections.
NSExpression is a class in Cocoa that simplifies complex data tasks. It evaluates mathematical expressions, such as 4 + 5 - 2**3, which gives 1.
Enumeration makes computation powerful by applying logic to collections.
Apple stopped letting apps use the unique device identifier, called UDID, from iOS 5 onwards. Apple blocked new apps using it after May 2013.
Apple gives options like Core Data or NSKeyedArchiver with NSKeyedUnarchiver. These turn objects into data and back again.
MKLocalSearch lets your app search for places (restaurants, shops, etc.) using normal language, all powered by Apple’s own data.
NSSecureCoding is a protocol from iOS 6 / OS X Mountain Lion. It adds the class method supportsSecureCoding.
In Objective-C, Foundation has macros like NSAssert for methods and NSCAssert for functions. They also have versions for parameters: NSParameterAssert and NSCParameterAssert.
NSURLCache is the built-in, automatic HTTP(S) cache used by NSURLConnection, NSURLSession (default/ephemeral configs), and WKWebView.
NSValue is the lightweight way to put any C scalar or struct (int, float, CGPoint, CGRect, NSRange, etc.) into an object so it can live in NSArray, NSDictionary, NSSet, etc.
NSLocalizedString is a macro in Foundation that gives a localised version of a string. It takes a key to find the string and a comment to help translators.
The article discusses Key-Value Coding (KVC) Collection Operators in Objective-C, which provide a concise, Ruby-like syntax for performing aggregate operations on collections using valueForKeyPath:.
NSOrderedSet is not a subclass of NSSet due to problems with Objective-C's single inheritance and the mutable/immutable class pairs in Foundation's class clusters.
NS_ENUM and NS_OPTIONS are the modern, Apple-approved way to declare enums and bit-masks.
NSURLProtocol is the most powerful (and least-known) piece of Apple’s URL Loading System.
NSLinguisticTagger offers powerful tools to process natural language. It breaks strings into tokens, finds parts of speech and stems, pulls out names of people, places, and groups, and spots languages and scripts.
The Address Book UI framework in iOS, used alongside AddressBook.framework, provides controllers for managing contacts but includes a uniquely valuable function, ABCreateStringWithAddressDictionary(), which formats address components into a localised string.
The article explores the CFBag and CFMutableBag Core Foundation types, which implement a bag (multi-set) data structure, allowing multiple occurrences of elements with associated counts.
NSString and its toll-free bridged counterpart CFMutableString in Foundation and Core Foundation are highlighted for their exceptional Unicode handling, with CFStringTransform enabling powerful string transformations like stripping diacritics, naming Unicode characters, and transliterating between scripts such as Latin, Cyrillic, and Hiragana.
NSSortDescriptor is a Foundation class used to sort collections. It is created with a key (property to sort on), ascending (true for ascending order), and optionally a selector or comparator for comparisons.
NSCache works like NSMutableDictionary but removes objects automatically when memory runs low. This saves you from handling memory warnings or setting up timers to clear space.
NSIndexSet and its mutable version, NSMutableIndexSet, form a sorted set of unique unsigned integers. They act like an NSRange that allows gaps.
100 things you should know if you are going to design an effective and persuasive website, web application or software application.