ObjC runtime model mapping
In the Objective-C days, YYModel and MJExtension turned JSON into models and even handled NSCoding archiving from nothing but the class definition. Which runtime feature made that possible?
In the Objective-C days, YYModel and MJExtension turned JSON into models and even handled NSCoding archiving from nothing but the class definition. Which runtime feature made that possible?
Reflection in the ObjC runtime. class_copyPropertyList enumerates a class's properties at runtime to read their names and types, and KVC's setValue:forKey: injects the JSON values. Archiving walks the properties the same way to encode them, and the property metadata is cached once per class for performance.
PersistenceShort answerBasics
Legacy code saves model objects to a file with NSKeyedArchiver, and on recent OS versions…
#codable #nssecurecoding
ArchitectureShort answerBasics
How does KVO in the Objective-C runtime detect property changes under the hood?
#kvc
Build and distributionShort answerAdvanced
A shipped app has a critical bug and you can't wait for App Store review. Why did Apple…
#objective-c
ConcurrencyShort answerAdvanced
You want a property that several threads can read at the same time while writes happen…
#objective-c