我们通常所说的 Objective-C 「动态性」,往往都是指 KVO。虽然还有其余的函数,但是这些是最常见、最常用的。这也就是人们所说的,Swift 缺失的部分。 而KVO是Foundation框架基于运行时实现的一个特性。因此本文先从Objective-C 的运行时 开始描述。 Objective-C 的运行时 本质上是一个库。它负责了 “Objective”...
(lldb) lookup DSObjectiveCObject 你将会得到一些比之前更漂亮的输出: -[DSObjectiveCObject setLastName:] -[DSObjectiveCObject .cxx_destruct] -[DSObjectiveCObject setFirstName:] -[DSObjectiveCObject eyeColor] -[DSObjectiveCObject init] -[DSObjectiveCObject lastName] -[DSObjectiveCObject setEyeCo...
在本章中, 你会看到非常小的一个篇幅介绍DTrace在已经编译过的应用程序中追踪Objective-C代码是如何强大.使用DTrace来观察iOS框架(比如UIKit)可以让你难以置信的洞察到在框架内部作者是如何设计他们的代码的. 坏消息 让我们先说一下坏消息, 因为从现在开始后面都是让人兴奋而又炫酷的功能. 关于DTrace这里有几件需...
NSString *m_nsFromUsr = wrap.m_nsFromUsr; //微信群号 CContactMgr *contactManager = [[objc_getClass("MMServiceCenter") defaultCenter] getService:[objc_getClass("CContactMgr") class]]; CContact *groupContact = [contactManager getContactByName:m_nsFromUsr]; NSString *group_name = grou...
You’ll explore a very small section of what DTrace is capable of doing by tracing Objective-C code in already compiled applications. Using DTrace to observe iOS frameworks (like UIKit) can give you an incredible insight into how the authors designed their code. Intermediate DTrace This ...
Although as an iOS programmer, most of the time in the work will not deal with the assembly language, but understand the assembly is still very helpful, especially when debugging a system framework or a third-party framework without the source code. Asssembly Language is a low-level machine...
Whether you’re using Swift, Objective-C, C++, C, or an entirely different language in your technology stack, you’ll need to learn how to create breakpoints. It’s easy to click on the side panel in Xcode to create a breakpoint using the GUI, but the LL
secrets behind any bit of code that piques your interest.This book is for intermediate to advanced iOS/macOS developers who are already familiar with either Swift or Objective-C and want to take their debugging skills to the next level.Topics Covered in Advanced Apple Debugging & Reverse ...
Learn Swift development for iOS using SwiftUI, UIKit, and Xcode with these free Swift 5.3 tutorials and code examples.
Swift & C 16.2 Setting up your project 16.3 Easy mode: hooking C functions 16.4 Hard mode: hooking Swift methods 16.5 Where to go from here? 17. Exploring & Method Swizzling Objective-C Frameworks 17.1 Between iOS 10 and 12 17.2 Sidestepping checks in prepareDebuggingOverlay 17...