-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
有这么一个问题,当 Str 从服务器拿到的时候,有可能是空的。这个时候 Typeset 会崩。例如:
NSString* str = nil;
TypesetKit* result = str.typeset;
result.color([UIColor redColor]);
NSLog(@"%@", result);可以看到这里是有问题的,最后一行 callq
0x10feeb45d <+141>: movq -0x30(%rbp), %rdi
0x10feeb461 <+145>: movq %rax, %rsi
0x10feeb464 <+148>: movq -0x40(%rbp), %rcx
0x10feeb468 <+152>: movq %rax, -0x48(%rbp)
0x10feeb46c <+156>: callq *0x10(%rcx)我想了一下貌似没法避免,但是可以用其他的方式绕过去...
例如写一个:
#define TypesetBuilder(__STR__) (__STR__==nil?@"".typeset:__STR__.typeset)你觉得呢?(^~^;)ゞ
Metadata
Metadata
Assignees
Labels
No labels