Fix improper retain level on return in [UIFont initWithCoder]#1263
Conversation
cleaned up and follow a proper format? In reply to: 257024231 [](ancestors = 257024231) Refers to: Frameworks/UIKit/UIFont.mm:311 in 99920d9. [](commit_id = 99920d9, deletion_comment = False) |
|
|
|
|
| CGFloat size = [coder decodeFloatForKey:@"UIFontPointSize"]; | ||
|
|
||
| return reinterpret_cast<UIFontPrototype*>(static_cast<UIFont*>(CTFontCreateWithName((__bridge CFStringRef)name, size, nullptr))); | ||
| } |
There was a problem hiding this comment.
Is this not valuable for derived? (if thats a thing) UIFonts. I'm just slightly confused as initWithCoder isn't a typical designated initializer is it? Is there something we should be providing on the base class that calls a different designated initializer? #ByDesign
There was a problem hiding this comment.
- re: valuable for derived: this is a WinObjC-only extension, and we don't have any UIFont derived classes, nor should we ever.
- re: designated initializers: UIFont has no initializers we could route to :(
In reply to: 85619643 [](ancestors = 85619643)
| // WinObjC-only extension for UINibUnarchiver | ||
| - (instancetype)initWithCoder:(NSCoder*)coder { | ||
| NSString* name = [coder decodeObjectForKey:@"UIFontName"]; | ||
| if ([name length] < 1) { |
There was a problem hiding this comment.
[name length] < 1 [](start = 8, length = 17)
length < 1 seems like a curious way of writing this. #Resolved
There was a problem hiding this comment.
yeah, now that you mention it (this was copied forward from some really old code). I'll change it to == 0.
In reply to: 85619699 [](ancestors = 85619699)
|
|
Fixes #1260
This change is