UITextField delegate jumping to 100% CPU usage and crashing upon using keyboard shortcut

后端 未结 3 1187
一整个雨季
一整个雨季 2021-01-02 00:59

So, I have a UITextField subclass which is it\'s own Delegate and is crashing when keyboard shortcuts are used. It maxes out on CPU an

3条回答
  •  春和景丽
    2021-01-02 01:41

    I solved this by custom customOverlayContainer and return the textFiled. eg.

    @implementation CustomTextField
    
    - (id)initWithFrame:(CGRect)frame {
        self = [super initWithFrame:frame];
        if (self) {
            self.delegate = self;
        }
        return self;
    }
    
    - (id)customOverlayContainer {
        return self;
    }
    
    @end
    

    Tested on iOS 7 and iOS 6.

提交回复
热议问题