Not able to use debug view hierachy

。_饼干妹妹 提交于 2019-12-11 00:27:04

问题


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


回答1:


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




回答2:


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() {}
}



回答3:


You can implement the method

- (void)_firstBaselineOffsetFromTop {}

in a UITextView category



来源:https://stackoverflow.com/questions/36995770/not-able-to-use-debug-view-hierachy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!