Tag

Objective-C

1 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Jun 11, 2025 · Fundamentals

Mastering iOS Locks: Types, Usage, and Performance Comparison

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.

LocksObjective-Cconcurrency
0 likes · 22 min read
Mastering iOS Locks: Types, Usage, and Performance Comparison
Baidu Geek Talk
Baidu Geek Talk
Jan 22, 2025 · Mobile Development

iOS Sandbox Disk Management and Cleaning Strategies

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.

Cache CleaningDisk ManagementObjective-C
0 likes · 22 min read
iOS Sandbox Disk Management and Cleaning Strategies
Sohu Tech Products
Sohu Tech Products
Dec 25, 2024 · Mobile Development

Masonry Layout Framework: Bundle Size Impact and Optimization Solutions

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.

Auto LayoutMasonryNSLayoutConstraint
0 likes · 2 min read
Masonry Layout Framework: Bundle Size Impact and Optimization Solutions
Sohu Tech Products
Sohu Tech Products
Nov 27, 2024 · Mobile Development

Beginner's Guide to iOS Memory Analysis: Virtual Memory, Heap, Autoreleasepool, and Leaks

This beginner‑level guide explains iOS virtual‑memory and heap fundamentals, demonstrates how autorelease‑pool buildup and retain‑cycle leaks cause out‑of‑memory crashes, and shows step‑by‑step use of Xcode’s Memory Graph, Instruments Allocations, and leak detection tools, plus tips on weak versus unowned references.

AutoreleasePoolLeaksObjective-C
0 likes · 17 min read
Beginner's Guide to iOS Memory Analysis: Virtual Memory, Heap, Autoreleasepool, and Leaks
Sohu Tech Products
Sohu Tech Products
Nov 6, 2024 · Mobile Development

UIStackView Tutorial: A Comprehensive Guide to iOS Linear Layout

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.

Auto LayoutLinear LayoutObjective-C
0 likes · 8 min read
UIStackView Tutorial: A Comprehensive Guide to iOS Linear Layout
Tencent Music Tech Team
Tencent Music Tech Team
Dec 22, 2023 · Mobile Development

Root Cause Analysis of iOS Crash Caused by Method Swizzle on NSString

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.

Class ClusterCrash DebuggingMethod Swizzle
0 likes · 11 min read
Root Cause Analysis of iOS Crash Caused by Method Swizzle on NSString
Baidu Geek Talk
Baidu Geek Talk
Nov 15, 2023 · Mobile Development

Automated OC Code Refactoring Practice (Part 3): Data Item Read/Write Class Encapsulation and Call Site Adaptation

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.

Data ChannelObjective-CPython
0 likes · 11 min read
Automated OC Code Refactoring Practice (Part 3): Data Item Read/Write Class Encapsulation and Call Site Adaptation
Tencent Music Tech Team
Tencent Music Tech Team
Oct 20, 2023 · Mobile Development

Root Cause Analysis of OOM Crash in iOS Karaoke App Caused by Swizzled NSMutableArray Protection

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.

AutoreleasePoolMemory LeakObjective-C
0 likes · 21 min read
Root Cause Analysis of OOM Crash in iOS Karaoke App Caused by Swizzled NSMutableArray Protection
Sohu Tech Products
Sohu Tech Products
Sep 13, 2023 · Mobile Development

iOS Interaction Blocking: Intercepting User Events at UIApplication Level

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.

Event HandlingObjective-CSwift
0 likes · 8 min read
iOS Interaction Blocking: Intercepting User Events at UIApplication Level
Python Programming Learning Circle
Python Programming Learning Circle
Sep 6, 2023 · Fundamentals

Five Programming Languages Likely to Disappear Within the Next 20 Years

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.

HaskellObjective-CPerl
0 likes · 8 min read
Five Programming Languages Likely to Disappear Within the Next 20 Years
Baidu App Technology
Baidu App Technology
Jul 10, 2023 · Mobile Development

Baidu App iOS Package Size Optimization: Code Optimization Techniques

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.

AB testingLink MapMach-O
0 likes · 15 min read
Baidu App iOS Package Size Optimization: Code Optimization Techniques
Baidu Geek Talk
Baidu Geek Talk
May 23, 2023 · Mobile Development

Swift Optional Types: Common Pitfalls and Best Practices

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.

Code PracticesNullabilityObjective-C
0 likes · 13 min read
Swift Optional Types: Common Pitfalls and Best Practices
NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
May 18, 2023 · Mobile Development

In‑App Purchase (IAP) Overview and Implementation Guide for iOS

The guide explains Apple’s four in‑app purchase types, how to create and configure products in App Store Connect, implements the StoreKit purchase flow (including product request, payment, transaction observation, and receipt verification on server), addresses common pitfalls, and introduces NetEase’s NEStoreKit wrapper for easier integration.

In-App PurchaseObjective-CReceipt Verification
0 likes · 15 min read
In‑App Purchase (IAP) Overview and Implementation Guide for iOS
JD Tech
JD Tech
Dec 21, 2022 · Fundamentals

Understanding Key‑Value Coding (KVC) in Objective‑C: Principles, Execution Flow, and Advanced Applications

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.

Data BindingKVCKey-Value Coding
0 likes · 15 min read
Understanding Key‑Value Coding (KVC) in Objective‑C: Principles, Execution Flow, and Advanced Applications
Baidu App Technology
Baidu App Technology
Oct 24, 2022 · Mobile Development

Understanding SIGKILL Crashes and Capturing Them with MetricKit on iOS

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.

MetricKitObjective-CSIGKILL
0 likes · 10 min read
Understanding SIGKILL Crashes and Capturing Them with MetricKit on iOS
NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Sep 21, 2022 · Mobile Development

Optimizing Startup Performance of NetEase Cloud Music iOS App

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.

Binary ReorderingInstrumentationObjective-C
0 likes · 34 min read
Optimizing Startup Performance of NetEase Cloud Music iOS App
Tencent Cloud Developer
Tencent Cloud Developer
Sep 5, 2022 · Fundamentals

Static Function Hooking in Objective-C Using LLVM Pass

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.

Compilation ProcessFunction HookingIR Modification
0 likes · 11 min read
Static Function Hooking in Objective-C Using LLVM Pass
HomeTech
HomeTech
Aug 23, 2022 · Mobile Development

Extracting Car Outlines from Sample Images for 360° Vehicle Capture in an iOS App

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.

BezierPathContour DetectionObjective-C
0 likes · 8 min read
Extracting Car Outlines from Sample Images for 360° Vehicle Capture in an iOS App
Sohu Tech Products
Sohu Tech Products
Jun 30, 2022 · Mobile Development

Understanding the Implementation of weak Pointers in the Objective‑C Runtime

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.

C++ templatesMemory ManagementObjective-C
0 likes · 19 min read
Understanding the Implementation of weak Pointers in the Objective‑C Runtime
Sohu Tech Products
Sohu Tech Products
Jun 8, 2022 · Mobile Development

Practical Uses of RunLoop in iOS: Thread Keep‑Alive, Stopping, Lazy Image Loading, Lag Detection, Crash Protection, and Integration in the Matrix Framework

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.

Objective-CPerformance MonitoringRunLoop
0 likes · 18 min read
Practical Uses of RunLoop in iOS: Thread Keep‑Alive, Stopping, Lazy Image Loading, Lag Detection, Crash Protection, and Integration in the Matrix Framework