GrowingTextView icon indicating copy to clipboard operation
GrowingTextView copied to clipboard

EXC_BAD_ACCESS when setting properties on GrowingTextView referenced from Storyboard (IBOutlet)

Open edulpn opened this issue 6 years ago • 2 comments

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!

edulpn avatar May 16 '18 14:05 edulpn

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.

KennethTsang avatar May 23 '18 06:05 KennethTsang

I could solve this problem! Thanks.

https://github.com/KennethTsang/GrowingTextView/issues/14#issuecomment-319243956

Misa-s avatar Feb 10 '22 08:02 Misa-s