Not able to use debug view hierachy

2019-07-08 16:30发布

I am currently trying my best to debug my application in Objective-C with the newest version of Xcode7.3 I really need to use Debug View Hierarchy but I am getting an error :

Assertion failure in -[UITextView _firstBaselineOffsetFromTop], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UITextView.m:1683

If someone knows how to resolve this ! Thx

3条回答
Evening l夕情丶
2楼-- · 2019-07-08 17:14

This is a bug from Apple. There is a radar issue open : https://openradar.appspot.com/25311044

查看更多
何必那么认真
3楼-- · 2019-07-08 17:15

A workaround to resolve this issue. Strictly in debug mode.

@interface UITextView(MYTextView)
@end

@implementation UITextView (MYTextView)
- (void)_firstBaselineOffsetFromTop {}
- (void)_baselineOffsetFromBottom {}

@end

For swift

extension UITextView {
    func _firstBaselineOffsetFromTop() {}
    func _baselineOffsetFromBottom() {}
}
查看更多
一纸荒年 Trace。
4楼-- · 2019-07-08 17:25

You can implement the method

- (void)_firstBaselineOffsetFromTop {}

in a UITextView category

查看更多
登录 后发表回答