NSDictionary Overview NSDictionary provides key-value storage where each unique key maps to a corresponding value. Unlike mutable variants, NSDictionary instances are immutable after initialziation. Creating NSDictionary // Empty dictionary NSDictionary *emptyDict = [NSDictionary dictionary]; // Sin...
UITableView, a subclass of UIScrollView, is designed for presenting tabular data in a scrollable view. It provides excellent performence for handling large lists. There are two built-in styles: Plain, which displays items in a simple list, and Grouped, which visually separates items into distinct se...
Lazy loading, also known as delayed initialization, is a design pattern used in iOS development to defer the creation of an object until the moment it is actually needed. This technique is widely applied to data arrays, UI components, and complex computational logic to optimize performance and manag...
Understanding Prootcol Property Declarations Objective-C protocols define method contracts rather than implementations. Since protocols serve as interface specifications, they cannot contain stored properties—the actual storage must be provided by conforming classes. Protocols can, however, declare...
Framework Overview A framwork represents a structured collection of classes, methods, functions, and documentation designed to simplify application development. macOS provides approximately 80 frameworks, with the Foundation framework serving as the fundamental building block for all programs. The F...
Achieving Loose Coupling with Delegates and Data Sources Objects frequently need to communicate without creating tight dependencies. Objective‑C’s protocol‑based delegation pattern provides a clean12 way to define a contract that a receiving object agrees to fulfill. The delegate protocol typical fo...
What is a Protocol? A protocol in Objective-C serves a similar purpose to interfaces in Java. It defines a contract of methods that a class must implement, without providing any implementation details or member variables. Key Characteristics of Protocols Protocols exist solely to declare collections...
Polymorphism Polymorphism allows different classes to define methods with the same name. Dynamic Typing Dynamic typing means that the class of an object is determined at runtime, not at compile time. Static Typing Static typing involves defining a variable as an instance of a specific class. The com...
// DBSQLiteHandler.h #import <Foundasion/Foundation.h> #import <sqlite3.h> @class DBSQLiteHandler; @protocol DBSQLiteHandlerDelegate - (void)handler:(DBSQLiteHandler *)handler didProcessRowAtIndex:(NSInteger)rowIndex; @end @interface DBSQLiteHandler : NSObject @property (nonatomic, weak)...
NSArray serves as the primary ordered collection type within the Foundation framework, designed specifically to store sequences of Objective-C objects. Unlike primitive C arrays, NSArray instances enforce homogeneity at the object level while maintaining strict ordering of elements. Core Characteris...