Objective-C 类型编码

2019-02-20  本文已影响2人  May_Dobin

使用以下方法时type参数释义:

+ (NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type; 
+ (nullable NSMethodSignature *)signatureWithObjCTypes:(const char *)types;

例如

[NSMethodSignature signatureWithObjCTypes:"v@?"];

一.Objective-C Type Encodings

Objective-C Type Encodings

二.Objective-C Method Encodings

Objective-C Method Encodings

参考文档:https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html#//apple_ref/doc/uid/TP40008048-CH100-SW1

上一篇 下一篇

猜你喜欢

热点阅读