Implementing Mouse Interaction Logic in macOS NSView Components
Overview of Event Delivery
When developing applications for macOS, understanding how input travels from the user to your application is crucial. Clicks initiated at the hardware level pass through drivers and the I/O Kit before reaching the window server. The window server then routes these events into the application's run loop for processing. ...
Posted on Tue, 20 Oct 2026 16:10:14 +0000 by incubi
Extending Objective-C Classes with Categories
Categories, also known as class extensions, are a unique feature of Objective-C. They allow developers to add new methods to an existing class without modifying its original source code, similar to extension methods in C# or partial classes in other languages.
Key Purposes of Categories
Adding functionality to framework or third-party classes ...
Posted on Fri, 09 Oct 2026 16:22:59 +0000 by irwa82
Understanding iOS Singleton Pattern in Depth
The singleton pattern is appropriate when a system component logically requires only one instance—creating additional instances would be redundant or meaningless. A classic example is CLLocationManager, which interfaces with a single physical hardware unit; multiple manager instances offer no practical benefit.
Common System-Provided Singletons ...
Posted on Wed, 07 Oct 2026 16:27:40 +0000 by ephmynus
Understanding Automatic Reference Counting in Objective-C
In Objective-C, pointers manage memory by referencing addresses. A pointer variable stores an address, its value is that address, and the memory unit value is the data at that address. By default, pointers are strong, marked with the strong keyword. Weak pointers are declared using __weak, such as __weak Person *p;.
Automatic Reference Counting ...
Posted on Fri, 18 Sep 2026 16:10:35 +0000 by raymie
Understanding Objective-C Property Attributes and Memory Management
In Objective-C, the @property directive simplifies the declaration of accessor methods and instance variables. At compile time, the compiler automatically synthesizes an instance variable (prefixed with an underscore), a getter, and a setter for each property. This process is known as "auto-synthesis".
The synthesized methods access t ...
Posted on Thu, 10 Sep 2026 16:14:05 +0000 by ezekiel
Building a Simple Login Interface for iOS
This tutorial demonstrates how to create a basic login screen for iOS, similar to QQ's login interface.
Application Entry Point
The main.m file serves as the entry point for every iOS application. It initializes the UIApplication instance and sets up the app delegate.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int ...
Posted on Sun, 09 Aug 2026 16:31:27 +0000 by r3n
Data Passing Between iOS View Controllers
This article explores the various methods for passing data between view controllers in iOS development, covering property-based approaches, delegate patterns, notifications, singletons, and closures.
Environment Setup
Before implementing data passing, set up the navigation hierarchy in the application delegate. The following code initializes th ...
Posted on Sun, 09 Aug 2026 16:19:37 +0000 by mfalomir
iOS Deep Dive: Exploring the Internals of Classes and Objects
The Essence of Classes and Objects
When we create a MyClass in Objective-C and instantiate it in main, what does Objective-C actually look like underneath?
First, we need to understand the underlying structure of Objective-C objects. Objective-C code is essentially converted to C/C++ code. Use the following command to convert main.m to C++:
cla ...
Posted on Fri, 31 Jul 2026 16:57:49 +0000 by LordMalek
Memory Management Fundamentals in Objective-C
Objective-C applications receive a memory warning from the system when memory usage exceeds approximately 20 MB. Upon receiving this warning, the application must release unnecessary memory by deallocating unused objects and variables to prevent crashes.
Memory management in Objective-C specifically handles objects that inherit from NSObject, n ...
Posted on Fri, 31 Jul 2026 16:12:25 +0000 by Crow
Building Custom iOS UI Components with XIB and Programmatic Layout
A custom UI component begins with an Interface Builder file. Start by creating a new file and selecting the User Interface category, then choose View. This generates a .xib file containing an empty view.
Design your reusable interface within this .xib file. Ensure you connect the File's Owner's Class in the "Custom Class" section to t ...
Posted on Tue, 21 Jul 2026 16:57:35 +0000 by NYSiRacer