This article demonstrates how TypePHP enables native iOS app development entirely in PHP by compiling PHP to arm64 machine code and using a thin Objective-C++ bridge to UIKit, covering architecture, code structure, compilation, signing, deployment, and customization with concrete examples and commands.
This article walks through a real iOS crash caused by mutating an NSMutableSet during enumeration, explains how the Objective‑C copy attribute works, compares shallow and deep copies for strings and collections, and shows the underlying runtime implementation with concrete code examples.
This article demystifies Objective‑C blocks by explaining their definition, practical uses, syntax variations, common usage scenarios, underlying data structures and compilation process, copy semantics, variable capture rules, reference‑cycle pitfalls, and provides concise code examples and reference links for iOS developers.
This article explains the relationship between locks and multithreading on iOS, introduces various lock types such as NSRecursiveLock, NSConditionLock, OSSpinLock, os_unfair_lock, pthread_mutex, and @synchronized, demonstrates resource contention with code examples, and compares their performance and usage scenarios.
This article explains the relationship between locks and multithreading on iOS, introduces common lock types such as NSRecursiveLock, NSConditionLock, OSSpinLock, os_unfair_lock, pthread_mutex, and @synchronized, demonstrates resource contention with code examples, discusses lock selection, priority inversion, and provides a performance ranking of various locks.
The article explains iOS sandbox storage by detailing the four main directories, their backup rules, naming conventions, and retrieval APIs, then outlines how to calculate physical file size and implements both automatic quota‑based and manual user‑driven cleaning methods, including system cache removal for tmp, WKWebView, and dyld caches.
This article dissects iOS blocks, explaining their struct‑based memory layout, the three block types, how they are transformed into C++ code with clang, and the impact of capturing variables—including value, static, global, and object references—on block behavior and lifecycle.
Masonry, a lightweight iOS layout framework, simplifies constraints with chainable syntax but its block‑based APIs can add several megabytes to an app’s bundle when heavily used; replacing those blocks with non‑block alternatives reduces the size increase to roughly one kilobyte, preserving performance.
This tutorial explains UIStackView, Apple’s iOS 9 linear layout container that mirrors Flexbox concepts, covering axis, distribution, alignment, and spacing, showing how to add arranged subviews, hide them dynamically, adjust hugging and compression priorities, and noting its limitations such as lacking order, flex‑grow, and flex‑basis controls.
This article investigates a recurring text‑to‑speech crash on iOS 17 devices, detailing the EXC_BAD_ACCESS error, analyzing stack traces, exploring internal AVAudioEngine and AUAudioUnit_XPC structures, and presenting two remediation strategies—including a hook‑based approach that safely bypasses problematic dealloc and stop calls.
This article analyzes common iOS architectural patterns, identifies the drawbacks of traditional MVP implementations, and introduces a deep‑optimization MVP+Context solution with role definitions, automatic binding, memory‑leak prevention, and Swift support, illustrated with real‑world code and diagrams.
The app crashed on launch because a third‑party SDK swizzled NSString’s stringByAppendingString: with a method whose name conflicted with the app’s own swizzle, causing recursive calls through the __NSCFString class‑cluster and a stack overflow; renaming the methods with a unique prefix and excluding __NSCFString from swizzling resolves the issue.
The third part of the series shows how Python scripts can automatically refactor Objective‑C code by encapsulating each data item’s read/write operations in static wrapper classes and rewriting over 600 call sites to use generated XXXSettingReader and XXXSettingWriter methods, achieving zero bugs.
An OOM crash in the K‑song iOS karaoke app was traced to a configuration that swizzled several NSMutableArray methods, causing each observer lookup to autorelease objects, rapidly filling autorelease‑pool pages and exhausting memory; converting the protection code to manual reference counting eliminated the leak and stopped the crashes.
To globally block all user interactions—including touches, motion, remote control, and press events—developers can subclass UIApplication and override its sendEvent: method, providing a disableUserInteraction: API with timed re‑enabling and a counter to safely manage concurrent disable requests.
The article examines why several once‑popular programming languages—including Ruby, Visual Basic, Haskell, Perl, and Objective‑C—are losing relevance due to performance, ecosystem shifts, and lack of innovation, and predicts they may fade away in the coming two decades.
The article explains how Baidu App reduces its iOS package size by analyzing Link Map files and applying six code‑optimization techniques—unused class and module slimming, unused method pruning with LLVM, duplicate‑code detection, utility‑method consolidation, and A/B‑test hardening—yielding up to 8 MB of savings.
The article explains common Swift optional pitfalls—such as forced unwrapping, misuse of implicitly‑unwrapped optionals, and unsafe type casting—and shows how proper optional binding, explicit Objective‑C nullability annotations, and cautious casting can prevent runtime crashes and improve code maintainability.
This article details the challenges and step‑by‑step solutions the NetEase Cloud Music iOS team used to modularize legacy Objective‑C libraries, enabling seamless Swift interop through modulemap generation, CocoaPods configuration, and custom build scripts while addressing macro, header, and static‑library issues.
This article analyses the inner workings of Objective‑C’s Key‑Value Coding (KVC) by dissecting its setter and getter generation, primitive value handling, NSNumber/NSValue wrapping, and demonstrates advanced usage such as batch property updates, aggregation, and data filtering in real‑world projects.
This article details a multi‑phase approach to dramatically improve iOS app launch performance, especially on low‑end iPhone models, by analyzing slow functions, applying image compression, lazy loading, run‑loop monitoring, and eliminating unnecessary background tasks, achieving launch times under 3 seconds for 99.7% of users.
A SIGKILL crash indicates the OS forcibly terminated an iOS app, which cannot be caught directly, but MetricKit (iOS 14+) can automatically collect diagnostic payloads after restart, allowing developers to extract termination reasons, stack traces, understand codes like 0x8badf00d, and address common causes such as main‑thread watchdog timeouts and deadlocks.
To cut the NetEase Cloud Music iOS app’s sluggish launch, the team trimmed dynamic libraries, replaced costly +load registrations with static modules, swapped SBJson for native parsing, reordered binaries, lazy‑loaded heavy services and ads, and streamlined UI initialization, delivering over 30 % faster cold‑starts and urging ongoing performance monitoring.
The article presents a technique for static function hooking in Objective‑C by writing a custom LLVM Pass that modifies the intermediate representation during compilation to inject stub calls at chosen points inside a function, and details the required LLVM setup, Pass implementation, Clang integration, and Xcode configuration.
This article analyzes why image loading can become a bottleneck in iOS apps like NetEase Cloud Music, identifies factors such as image size, network conditions, and cache behavior, and presents a comprehensive solution that standardizes URL parameters, reuses local images, and extends SDWebImage's manager and cache to achieve up to 50% faster downloads and significant CDN bandwidth savings.
This article describes a step‑by‑step iOS implementation that converts example car images into bitmap points, scans edges, removes duplicate points, compensates missing vertices, and finally builds a closed BezierPath to guide 360° vehicle photography, including full Objective‑C code snippets.
This article explains how Objective‑C implements weak pointers using a hash‑based weak table, SideTables, ExplicitInit, and various low‑level C++ template functions such as storeWeak, weak_register_no_lock, and weak_clear_no_lock to ensure automatic nil‑assignment and safe deallocation.
This article explains how iOS RunLoop can be leveraged for thread keep‑alive, controlled termination, lazy image loading, various lag‑detection techniques, crash protection strategies, and demonstrates its integration within the open‑source Matrix framework, providing concrete Swift and Objective‑C code examples.
This article investigates the mismatch between iOS camera preview and captured images in VIN recognition, explains the aspect‑ratio scaling cause, derives compensation formulas, and provides Objective‑C code to adjust crop rectangles for accurate framing.
This article explains how Objective‑C’s AutoreleasePool works under ARC and MRC, covering NSAutoreleasePool, the @autoreleasepool syntax, internal C++ structures, page management, POOL_BOUNDARY handling, nested pools, and the interaction with the run‑loop for timely object release.
This article explains how to detect multiple QR codes in an iOS image using Core Image, mark each code's location, and let users select a specific code either by adding transparent buttons or by handling touch events, covering coordinate conversion, scaling, and offset calculations.
An organized iOS development knowledge map and a comprehensive list of recommended resources—including language fundamentals, UI libraries, networking tools, data storage solutions, performance monitoring, architecture design, algorithms, and multimedia development—are presented to help iOS developers systematically learn and build applications.
This article provides an in‑depth analysis of Objective‑C's runtime message‑sending process, covering the roles of objc_msgSend, method caching, dynamic method resolution, and message forwarding, with detailed code examples and assembly snippets to illustrate each step.
This article explains the design and implementation of a unified routing SDK for iOS that enables page jumps, parameter passing, return values, interceptors, redirection, and cross‑technology integration (Native, Flutter, HTML5, Mini‑Programs) while remaining non‑intrusive to existing codebases.
This article explains a technique for writing long‑TCP connection business code on mobile devices that is as efficient and concise as short‑link code, using request_id mapping, protobuf messages, and a lightweight SendCore layer with timeout handling.
This article documents a runtime crash triggered by mutating an NSMutableSet while enumerating it, explains how the Objective‑C copy attribute works, demonstrates shallow and deep copy behavior for strings and collections, and provides low‑level source analysis of the copy implementation in the Apple runtime.
This article examines how the widely used Objective‑C‑RSA library can cause RSA encryption failures on iOS when multiple threads concurrently add, delete, and query keychain entries using the same tag, leading to error‑25300 and data corruption, and proposes practical fixes.
This article details the background, current status, and engineering architecture of introducing Swift into 58 Group’s real‑estate iOS apps, explains the two main mixed‑compilation approaches (bridging header and module), presents practical module setup, discusses reflection pitfalls, binding solutions, and performance comparisons between Swift and Objective‑C implementations.
This article provides a comprehensive analysis of iOS's Key-Value Observing (KVO) mechanism, covering its fundamentals, registration and observation steps, underlying isa‑swizzling implementation, usage patterns, common pitfalls, debugging techniques, and alternative solutions such as custom KVO implementations and the KVOController library.
This article explains what Objective‑C blocks are, why they are useful, how to declare and use them in various contexts, and dives into the compiler‑generated data structures, copy/dispose mechanisms, __block semantics, memory‑management pitfalls, and reference‑cycle avoidance.
This article explains how to detect and remove unused code in mixed Swift and Objective‑C iOS applications by parsing Mach‑O files, analyzing class metadata, and leveraging AccessFunction calls, while discussing the challenges, implementation details of the WBBlades tool, and practical usage steps.
This article details 58.com’s Swift migration initiative, describing the background of Swift adoption, the objectives of the mixed‑language project, the practical steps for SDK module‑ization, bridging techniques, nullability annotations, macro handling, +load replacements, and future plans for improving Objective‑C to Swift integration.
This article introduces the major programming paradigms frequently used in Objective‑C—including chainable, reactive, functional, procedural, and object‑oriented styles—explaining their concepts, advantages, and providing concrete code examples to help developers design cleaner, more maintainable iOS applications.
This comprehensive tutorial explains how to use CocoaPods for iOS and macOS development, covering installation, project initialization, dependency management, podspec creation, private repository setup, version control, caching, and troubleshooting, enabling developers to efficiently manage third‑party libraries and create reusable modules.
This week’s WecTeam Front‑end Weekly spotlights two technical deep‑dives: a Swift‑Objective‑C mixed‑compilation technique that slashes build times by 35%, and ByteDance’s large‑scale data‑tracking governance framework that underpins its trillion‑plus real‑time analytics pipeline.
An in‑depth analysis of a memory‑growth issue observed in a Kuaishou live‑stream app reveals how ARC, autorelease pools, and NSString’s class‑cluster implementation interact, why @autoreleasepool blocks resolve the leak, and how compiler optimizations and thread‑local pools affect object release in long‑running C++ threads.
This article explains how the iOS singleton pattern works, why dispatch_once executes only once during an app's lifecycle, examines the underlying GCD source code, shows how to manually reset a singleton, and discusses the thread‑safety guarantees of the implementation.
This article shares the Kuaishou overseas client team's practical experiences and solutions for improving compilation efficiency through Swift/Objective‑C binary mixed compilation, covering single‑target and multi‑target strategies, moduleization challenges, binary compatibility, and future directions for mobile development.
This article shares the Kuaishou overseas client team's experience of improving Swift/Objective‑C mixed compilation through binary packaging, covering single‑target and multi‑target strategies, moduleization challenges, solutions for C++ and header issues, and future best‑practice recommendations for iOS development.
This article explains the internal structure of Objective‑C categories, how they are represented as structs in the runtime, the process by which the Mach‑O loader discovers and attaches them, and the distinct execution order of their +load and +initialize methods.
This article explains how to use AOP techniques such as Method Swizzle and NSProxy to hook UICollectionView and UIViewController delegate methods for precise event tracking, analyzes compatibility problems caused by multiple delegate proxies in large apps, and proposes three practical solutions to avoid crashes and maintain extensibility.
This article provides a detailed examination of the YYModel framework’s source code, explaining how it leverages Objective‑C runtime to parse JSON into model objects, covering key files, internal classes, mapping mechanisms, and the core conversion methods with illustrative code examples.
This article provides a comprehensive guide to the MVC and MVVM architectural patterns for iOS, explaining their components, interactions, KVO usage, and includes complete Objective‑C code examples that demonstrate how to implement both patterns in a real‑world news‑list app.
This article explains how Swift and Objective‑C can be mixed in iOS projects, covering prerequisite settings, CocoaPods module configuration, name mangling, compilation differences, dynamic features, method replacement techniques, and the underlying Swift runtime metadata that enable seamless inter‑language calls.
This article explains how A‑Station adopted Swift for iOS, details the prerequisites and CocoaPods configuration for mixed Swift‑Objective‑C projects, explores module usage, name mangling, dynamic features, method replacement techniques, and provides practical code examples and tooling references.
This article explains how an iOS/macOS application is launched, detailing the interaction between dyld and the Objective‑C runtime, the initialization steps performed by _objc_init, and the series of functions such as environ_init, static_init, map_images, read_images, and load_images that together realize classes, selectors, protocols and +load methods before main() is called.
This article examines how Objective‑C’s dominance in macOS and iOS development has waned since Swift’s 2014 debut, detailing recent drops in TIOBE rankings for both languages and highlighting broader trends among the top programming languages.
This article examines Objective‑C method swizzling, compares two common implementation schemes, analyzes 18 inheritance‑hook scenarios for child‑first and parent‑first hook orders, and provides practical recommendations to ensure correct execution order and avoid crashes.
This article details JD's journey from Objective‑C to Swift, explaining ABI stability, module stability, library evolution, and step‑by‑step configurations for mixed Swift‑Objective‑C compilation at both project and component levels, including build‑setting tweaks and runtime loading solutions.
This article analyzes a crash caused by NSInvocation argument out‑of‑bounds on iOS 13.3+, explains the underlying runtime changes, demonstrates how to reproduce the issue with a timer‑triggered message forwarding scenario, and provides a fix by correcting the method signature.
Brad J. Cox, co‑creator of Objective‑C and a pioneer in software reuse, passed away in 2021, leaving behind a rich personal history, influential publications, and a programming language that shaped Apple's ecosystem before gradually yielding to Swift.
To enable Objective‑C and Swift mixed programming in Baidu App, static libraries are converted to static frameworks, module stability is activated, headers are module‑ized and dependencies declared via EasyBox, allowing safe inter‑component calls, proper nullability handling, and encouraging broader Swift adoption across the codebase.
This article explores Swift’s binary representation by comparing it with Objective‑C, demonstrating runtime dynamic method invocation, dissecting Mach‑O sections such as __objc_classlist and __swift5_types, and revealing how Swift classes store their metadata and VTables.
The article analyzes five once‑popular programming languages—Ruby, Visual Basic, Haskell, Perl, and Objective‑C—explaining why their performance, ecosystem support, and community interest are declining and why they could disappear unless revitalized by strong developer investment.
Continuing the Baidu App mixed‑language guide, this article explains how EasyBox‑generated component targets (frameworks and libraries) are organized into modules, configured for Objective‑C/Swift interoperability, unit‑tested, linked across components, and packaged as binaries using module maps, build settings, and lipo merging, while recommending frameworks for smoother distribution.
The article examines why Ruby, Visual Basic, Haskell, Perl, and Objective‑C are losing popularity and argues that without community and vendor support these languages may fade away over the next two decades, while newer languages continue to dominate development.
This article explains how Objective‑C objects are deallocated in both manual reference counting (MRC) and Automatic Reference Counting (ARC), outlines common pitfalls such as using __weak in dealloc, and details the runtime flow from _objc_rootDealloc to the final memory free operation.
This article explains the fundamentals of Aspect‑Oriented Programming on iOS, compares major AOP techniques such as Method Swizzle, Aspects, MPSwizzler, ISA‑swizzle KVO, Fishhook, Thunk and Clang instrumentation, and provides practical code examples and best‑practice guidelines.
This article introduces JDTuple, an Objective‑C tuple library that uses variadic functions, type encodings, and macro tricks to pack arbitrary values, provide key‑based and sequential unpacking, and simplify multi‑parameter passing and return values in iOS development.
This article explains how to use iOS dynamic frameworks to modularize app features, enable on‑demand plugin loading and seamless runtime updates, detailing the design of SVPCore, SVPRuntime, bundle management, and integration steps with code examples.
This article explains the Tagged Pointer mechanism introduced in iOS 64‑bit environments, detailing how it reduces memory usage, speeds up object creation and method dispatch, and describing the underlying tag‑plus‑data representation, class registration, and pointer generation with code examples.
This article explains how Objective‑C creates objects by detailing the two creation methods, the internal alloc and init implementations, the callAlloc workflow, memory allocation, and the final binding of the isa pointer, with full source code excerpts for each step.
The article explains UIButton’s built‑in UIControlState bitmask, shows how to set titles and colors for normal, highlighted, disabled and selected states, demonstrates combining states, and details creating custom application‑specific states (e.g., follow, mutual, loading) by extending the state enum and overriding state‑related methods.
This article presents a detailed comparison between Swift and Objective‑C, covering language popularity, community activity, real‑world app adoption, performance benchmarks, Swift's advantages and disadvantages, ABI and module stability, Apple’s strategic support, binary size effects, and deep compiler optimizations such as SIL, inlining, generic specialization, and dispatch mechanisms.
This article outlines the preparation, framework redesign, and common challenges of integrating Swift into an existing Objective‑C iOS client, covering ABI stability, mixed compilation, module configuration, code standards, and future migration plans.
This tutorial walks through setting up an iOS demo project in Xcode, creating a yellow rectangle view, adding a clickable button and a centered image using Swift code, and then compares the Swift syntax with equivalent Objective‑C snippets, while also covering useful comment tags.
This article explains the internal data structures of the Objective‑C runtime, covering objc_object, objc_class, class_data_bits_t, class_rw_t, and class_ro_t, and illustrates how these structures define objects, classes, method caches, and associated metadata in iOS development.
This article explains what Key-Value Observing (KVO) is, how to use it in iOS development, and the runtime mechanisms—such as isa‑swizzling and dynamic subclass creation—that enable automatic property change notifications, while also showing how to build a custom KVO system.
This article explains why adding parameter‑reading code to a variadic‑function hook causes a deterministic crash due to stack context pollution, analyzes the calling‑stack layout and register usage with ARM64 assembly, and presents a heap‑based context‑saving solution using TrampolineHook to safely intercept variadic methods on iOS.
This article introduces the Sunglasses crash investigation tool, explains iOS Objective‑C runtime message handling—including method lookup, dynamic resolution, and forwarding—details method swizzling implementation with code examples, and discusses class clusters and future enhancements for mobile development debugging.
This article details Ctrip's experience of adopting Swift for iOS development, covering the language's evolution, statistical adoption, static‑library integration, ObjC‑Swift mixed compilation, module stability with swiftinterface files, CI pipeline adjustments, and strategies for seamless ObjC‑Swift interoperation.
With Swift 5’s stable ABI shrinking app bundles, developers can migrate Objective‑C code top‑down—starting at UI layers—to leverage Swift’s safety‑focused optionals, value‑type structs, powerful enums, functional and protocol‑oriented paradigms, while handling interoperability via @objc and dynamic, ultimately future‑proofing apps for SwiftUI, cross‑platform frameworks, and continued iOS/macOS relevance.
The guide details how Gaode Map’s iOS app cut cold‑start time by over 65% to sub‑400 ms through systematic analysis of launch phases, Mach‑O loading, multi‑dimensional runtime metrics, automated static source parsing, and visual trace tooling, demonstrating a repeatable method for sustained launch‑time optimization.
This article explains how to replace image‑based icons in iOS apps with vector icon fonts from Alibaba's iconFont service, covering selection, download, integration of the TTF file, Swift and Objective‑C usage examples, and common pitfalls such as font conflicts and licensing.
This article explains how JD’s dark‑mode foundation component enables iOS 9+ apps to support system and manual dark mode, detailing its architecture, integration steps, custom updaters, window‑level overrides, snapshot handling, and lessons learned for reliable night‑mode implementation.
This guide explains what the Objective‑C runtime is, where to obtain its source code, the required build environment, step‑by‑step compilation instructions, and detailed solutions for the numerous build errors encountered when compiling objc4 on macOS.
This article explains what a RunLoop is, why it exists, its internal structure and modes, how it interacts with threads, and common iOS development techniques such as keeping threads alive, image loading, timer handling, and performance monitoring.
This article explains iOS CPU architecture, why arm64 dominates iPhone hardware, compares CPU and GPU, and provides a step‑by‑step guide with Objective‑C code for implementing the QiCPUMonitor tool that tracks high‑CPU‑usage threads and records their call stacks every three seconds.
The article explains how, with Swift 5.1’s ABI stability, teams can combine Swift and Objective‑C in iOS apps by preferring CocoaPods‑based modular development over bridging headers, detailing the LLVM module system, modulemap setup, namespace and linking issues, and best‑practice steps for a smooth migration.
This article explains how iOS Key-Value Observing works under the hood, enumerates common pitfalls across iOS versions, and shows how the open‑source KVOController library mitigates those issues while providing safer, block‑based observation APIs.
This article provides a comprehensive overview of iOS push notification mechanisms, covering remote and local push differences, device token acquisition across iOS versions, silent push constraints, scheduling nuances, and the evolution of notification APIs from iOS 7 to iOS 13, with practical code examples.
This article examines a real iOS project case where a UITableView delegate method does not fire, explores Swift Intermediate Language (SIL) and thunk functions, explains the role of @objc and dynamic dispatch, and demonstrates how generic base classes affect Objective‑C visibility of delegate methods.
This article explains how to enable Xcode Canvas previews for legacy Objective‑C views by leveraging SwiftUI's PreviewProvider, detailing the required project settings, bridging‑header configuration, code examples, and troubleshooting steps for integrating preview support into large iOS codebases.
This article explains the various iOS app background execution states, short‑term background tasks, long‑term keep‑alive methods such as silent audio, continuous location, background downloads, and BGTaskScheduler, and provides Objective‑C code examples and configuration steps for developers.
This article explores how Objective‑C objects are converted to low‑level C/C++ structures, compares the results of class_getInstanceSize, malloc_size and sizeof, and explains memory‑alignment rules, member ordering, padding, and inheritance effects on the actual memory footprint of iOS objects.
This article breaks down iOS's memory layout—including stack, heap, static, data, and text sections—and examines three key management techniques: Tagged Pointers, non‑pointer isa, and SideTables, detailing their implementation, benefits, and underlying data structures.
This article explains how to implement dual‑camera capture on iOS 13+ using AVCaptureMultiCamSession, covering device limits, session configuration, code examples for camera setup, resolution adjustment, audio handling, system‑pressure monitoring, and performance tips for outdoor live streaming.
This article explores Apple's libMainThreadChecker.dylib implementation, details its environment variables and swizzling logic, demonstrates how to replicate its functionality by enumerating UIKit classes and hooking methods, and discusses pitfalls of full‑method hooking and a bridge‑based solution for reliable runtime monitoring.