GrowingTextView
GrowingTextView copied to clipboard
EXC_BAD_ACCESS when setting properties on GrowingTextView referenced from Storyboard (IBOutlet)
Code looks like this:
import UIKit
import GrowingTextView
class CommentsViewController: UIViewController {
@IBOutlet var commentTextView: GrowingTextView!
// MARK:- View lifecycle
override func viewDidLoad() {
super.viewDidLoad()
customizeCommentTextView()
}
func customizeCommentTextView() {
commentTextView.maxLength = 255
commentTextView.trimWhiteSpaceWhenEndEditing = true
commentTextView.minHeight = 40.0
commentTextView.delegate = self
}
}
when trying to run any of the lines inside customizeCommentTextView()
it gives me Thread 1: EXC_BAD_ACCESS (code=257, address=0x1d4474082)
.
Any idea what might be happening? I followed the README instructions for Storyboard usage and I am using Carthage 0.29.0 to install GrowingTextView 0.5.
Thanks!
I think you might not set the textview's class to GrowingTextView? Try this: Go to storyboard, select the textview, open identity inspector, clear the "class" textbox, then input "GrowingTextView" again.
I could solve this problem! Thanks.
https://github.com/KennethTsang/GrowingTextView/issues/14#issuecomment-319243956