Hello bro, I create a custom button like this way: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.titleLabel.font = [UIFont fontWithName:fontName size:fontSize];
Then I receive any issue from the third crash collection platform:
0 libobjc.A.dylib 0x000000018fd1e694 _objc_moveWeak + 196
1 libobjc.A.dylib 0x000000018fd1e694 _objc_moveWeak + 196
2 CoreFoundation 0x0000000197e7da94 __CFXNotificationRegistrarAddObserver + 392
3 CoreFoundation 0x0000000197e7c864 _CFXNotificationRegistrarAdd + 580
4 CoreFoundation 0x0000000197e7c040 __CFXNotificationRegisterObserver + 248
5 UIKitCore 0x000000019a1b6c98 _UILabelCommonInit + 188
6 UIKitCore 0x000000019a1b69fc -[UILabel _commonInit] + 520
7 UIKitCore 0x000000019a1cdf88 -[UILabel initWithFrame:] + 56
8 UIKitCore 0x000000019a24824c -[UIButtonLabel _initWithFrame:button:] + 100
9 UIKitCore 0x000000019a247c14 -[UIButtonLegacyVisualProvider _newLabelWithFrame:] + 84
10 UIKitCore 0x000000019a15ee80 -[UIButtonLegacyVisualProvider _setupTitleViewRequestingLayout:] + 84
11 UIKitCore 0x000000019a15d81c -[UIButtonLegacyVisualProvider titleViewCreateIfNeeded:] + 44
12 UIKitCore 0x000000019a1cfa78 -[UIButton titleLabel] + 36
So would you please tell me how to avoid it?
Post
Replies
Boosts
Views
Activity
0 CoreFoundation 0x0000000183f687cc ___exceptionPreprocess + 164
1 libobjc.A.dylib 0x000000018123b2e4 _objc_exception_throw + 88
2 CoreFoundation 0x000000018406e5f0 +[NSObject(NSObject) doesNotRecognizeSelector:] + 0
3 UIKitCore 0x0000000186849a48 -[UIButtonLegacyVisualProvider _newLabelWithFrame:] + 60
4 UIKitCore 0x00000001867652b0 -[UIButtonLegacyVisualProvider _setupTitleViewRequestingLayout:] + 84
5 UIKitCore 0x0000000186763ba4 -[UIButtonLegacyVisualProvider titleViewCreateIfNeeded:] + 44
6 UIKitCore 0x00000001867d3f74 -[UIButton titleLabel] + 36
Hello bro, in IOS 18 our team find issue ,We created a button like this:
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.titleLabel.font = [UIFont fontWithName:paramFontName size: fontSize];
Please tell me whether we need to set button frame before we call button.titleLabe?