SlackTextViewController icon indicating copy to clipboard operation
SlackTextViewController copied to clipboard

textDidUpdate: never returns with YES flag

Open danipralea opened this issue 11 years ago • 19 comments

I call textDidUpdate with YES flag and it doesn't return. I then call it with NO flag and it doesn't return, I comment [self.view layoutIfNeeded] within the method, and it works.

danipralea avatar Oct 22 '15 13:10 danipralea

What do you mean by "it doesn't return"? What are you trying to do?

dzenbot avatar Oct 22 '15 20:10 dzenbot

It hangs on that specific line. I'm .... using it :smile:

danipralea avatar Oct 22 '15 20:10 danipralea

So, you're experiencing an exception in the line of [self.view layoutIfNeeded]?

dzenbot avatar Oct 22 '15 20:10 dzenbot

correct

danipralea avatar Oct 22 '15 20:10 danipralea

Mind sharing you backtrace? Just like you did in https://cloud.githubusercontent.com/assets/768893/10657565/2831c162-7896-11e5-9ee9-420e3275b2ce.png

dzenbot avatar Oct 22 '15 20:10 dzenbot

It never advances to [self slk_enableTypingSuggestionIfNeeded];, which means the UI completely blocks

danipralea avatar Oct 22 '15 20:10 danipralea

Is self.view nil?

dzenbot avatar Oct 22 '15 20:10 dzenbot

I would, @dzenbot, but there is no crash, meaning no backtrace

danipralea avatar Oct 22 '15 20:10 danipralea

The self.view is not nil

self.view = <UIView: 0x13e821470; frame = (0 0; 375 667); autoresize = W+H; layer = <CALayer: 0x13e8215d0>>

danipralea avatar Oct 22 '15 20:10 danipralea

I'm doing this in my view controller (I have a form of segmented control for which I have different dataflows from web sockets - just to get the general idea) :

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    dispatch_once(&_selectDefaultFilterToken, ^{ // _selectDefaultFilterToken is dispatch_once type
        [self filterSelected:GabFilterHost];
        self.filtersView.filterType = self.filterType;
    });
}

// and in filterSelected: I am calling

- (void)filterSelected:(GabFilterType)filterType {
    [self hideNewPostsButton];
    self.filterType = filterType;
    self.inputToolbar.underground = [self shouldHideInputToolbar];
    [self textDidUpdate:NO];
    [self updateFeed];
}

When I use textDidUpdate:YES, it completely hangs. When using NO, and commenting [self.view layoutIfNeeded];, it goes on

danipralea avatar Oct 22 '15 21:10 danipralea

What if you move that logic from viewDidLayoutSubviews to something like viewWillAppear: or viewDidLoad? Same thing?

dzenbot avatar Oct 22 '15 21:10 dzenbot

it's there because I already tried it and it's the only way for the screen to not look funny. By 'funny' I mean the views get overlapped and some glithces occur if I try to do it the standard way - in viewDidLoad

danipralea avatar Oct 22 '15 21:10 danipralea

Gotcha. Not sure what's going on honestly. Haven't experienced this before, and it's very strange that you're just not getting an exception.

You probably already did, but try compiling with another SDK version and/or device types.

dzenbot avatar Oct 22 '15 21:10 dzenbot

I will! Thank you for this and if I have updates, I will get back with additional info

danipralea avatar Oct 22 '15 21:10 danipralea

I'm having the same issue on iOS7. No error or exception. The app just crashed at the line [self.view layoutIfNeeded]; in SLKTextViewController. It works fine on iOS9.

sasipaants avatar Oct 27 '15 19:10 sasipaants

Crashes without exception? Did you repro on device or sim?

dzenbot avatar Oct 27 '15 19:10 dzenbot

I don't see any error messages in the console. I can reproduce the bug on my iphone 5c with ios7 installed.

sasipaants avatar Oct 27 '15 20:10 sasipaants

screen shot 2015-10-27 at 1 25 06 pm

sasipaants avatar Oct 27 '15 20:10 sasipaants

Is this still an issue? Found any work around?

dzenbot avatar Aug 28 '16 12:08 dzenbot