We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
杰哥,你好,想使用KakaJSON获取类的metadata数据,遇到一个崩溃
WTStudent
@interface WTStudent : NSObject @end @interface WTPerson : NSObject @property (nonatomic, strong) NSString *name; @property (nonatomic, assign) NSUInteger age; @property (nonatomic, strong) WTStudent *stu; @end
Student
WTPerson
class Student: WTPerson { }
let mt = Metadata.type(Student.self) as? ModelType
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2c) frame #0: 0x00007fff51b2c94d libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell + 77 frame #1: 0x0000000100b7398b Metadata扫描`__swift_memcpy60_4 at <compiler-generated>:0 * frame #2: 0x0000000100b5276d Metadata扫描`NominalType<>.builtGenericTypes(self=0x00006000022f4630) at Type.swift:47:25 frame #3: 0x0000000100b437c0 Metadata扫描`ClassType.build(self=0x00006000022f4630) at ClassType.swift:18:24 frame #4: 0x0000000100b561a2 Metadata扫描`BaseType.init(name="WTPerson", type=WTPerson, kind=class, self=0x00006000022f4630) at BaseType.swift:22:9 frame #5: 0x0000000100b6282e Metadata扫描`ModelType.init(name="WTPerson", type=WTPerson, kind=class) at <compiler-generated>:0 frame #6: 0x0000000100b44b3b Metadata扫描`ClassType.init(name="WTPerson", type=WTPerson, kind=class) at <compiler-generated>:0 frame #7: 0x0000000100b449bc Metadata扫描`ClassType.__allocating_init(name:type:kind:) at ClassType.swift:0 frame #8: 0x0000000100b72c9d Metadata扫描`static Metadata.type(type=WTPerson, self=Metadata扫描.Metadata) at Metadata.swift:49:22 frame #9: 0x0000000100b4390c Metadata扫描`ClassType.build(self=0x00006000022f45a0) at ClassType.swift:21:28 frame #10: 0x0000000100b561a2 Metadata扫描`BaseType.init(name="Student", type=Metadata扫描.Student, kind=class, self=0x00006000022f45a0) at BaseType.swift:22:9 frame #11: 0x0000000100b6282e Metadata扫描`ModelType.init(name="Student", type=Metadata扫描.Student, kind=class) at <compiler-generated>:0 frame #12: 0x0000000100b44b3b Metadata扫描`ClassType.init(name="Student", type=Metadata扫描.Student, kind=class) at <compiler-generated>:0 frame #13: 0x0000000100b449bc Metadata扫描`ClassType.__allocating_init(name:type:kind:) at ClassType.swift:0 frame #14: 0x0000000100b72c9d Metadata扫描`static Metadata.type(type=Metadata扫描.Student, self=Metadata扫描.Metadata) at Metadata.swift:49:22 frame #15: 0x0000000100b57001 Metadata扫描`AppDelegate.application(application=0x00007f8ffdf04e80, launchOptions=nil, self=0x00006000010f37c0) at AppDelegate.swift:20:27 frame #16: 0x0000000100b57183 Metadata扫描`@objc AppDelegate.application(_:didFinishLaunchingWithOptions:) at <compiler-generated>:0
The text was updated successfully, but these errors were encountered:
我也遇到了同样的问题... 这里需要父类也遵循 Convertible 协议才能可以哦 我的解决办法是, 不用kakajson解析, 甚至是遇到nsobject的对象, 都用mjextension
Sorry, something went wrong.
如果要使用 MJExtension 也已经给出了针对 Swift 的示例代码, 可以参考.
MJExtension
No branches or pull requests
WTStudent
Student
继承WTPerson
Student
的MetaData数据The text was updated successfully, but these errors were encountered: