glaszig / SZTextView

A drop-in UITextView replacement which gives you: a placeholder.
MIT License
683 stars 102 forks source link

selectable cause crash #45

Closed codwam closed 8 years ago

codwam commented 8 years ago

self.textView.selectable = NO; And add a button to set textView text directly,like below

This will be crashed and the console log: 2015-11-24 22:42:24.134 SZTextView[3336:137753] keyPath = attributedText, change = { kind = 1; new = ""; } 2015-11-24 22:42:24.134 SZTextView[3336:137753] keyPath = text, change = { kind = 1; new = sjldfjlksjdflksjdf; } This can be solved but I don't know it's good or not:

    if (![newAttributedText isEqual:[NSNull null]]) {
        [self setPlaceholderVisibleForText:newAttributedText.string];
    }
glaszig commented 8 years ago

can't replicate in the demo app. please consider a demo yourself and reopen the issue.