slackhq / SlackTextViewController

⛔️**DEPRECATED** ⛔️ A drop-in UIViewController subclass with a growing text input view and other useful messaging features
https://slack.com/
MIT License
8.32k stars 1.08k forks source link

View Controller goes in infinite loop when adding programmatically. #142

Closed hagile closed 9 years ago

hagile commented 9 years ago

As title say, when I try to push to my view controller which subclass of SlackTextViewController it goes in some infinite loop and at last crashed the app at some 400+mb memory.

I'm not sure what's wrong here?

What I'm doing to use SlackTextViewController into app.

  1. I've installed SlackTextViewController through pod.
  2. #import <SlackTextViewController.h> in a view controller, where I wants to use it.
  3. make it parent for the my view controller.
  4. added below method

    - (id)init    
    {
       self = [super initWithTableViewStyle:UITableViewStylePlain];
    
       if (self) {
           // Register a subclass of SLKTextView, if you need any special appearance and/or behaviour customisation.
           [self registerClassForTextView:[MessageTextView class]];
       }
    
       return self;
    }
  5. This isn't working.

Note, my view controller's init method is getting called, however it never jump into viewDidLoad method.

Failed into this method, - (void)slk_setupViewConstraints.

dzenbot commented 9 years ago

Are you registering a custom subclass of SLKTextView? It seems you copy/pasted too much. I'm talking about this line: [self registerClassForTextView:[MessageTextView class]];

hagile commented 9 years ago

Yes, I’ve registered it, I thought I’ve to do this for customisation, isn’t it? Please correct me if I’m wrong. Thanks.

On 17-Mar-2015, at 6:26 pm, Ignacio Romero Zurbuchen notifications@github.com wrote:

Are you registering a custom subclass of SLKTextView? It seems you copy/pasted too much. I'm talking about this line: [self registerClassForTextView:[MessageTextView class]];

— Reply to this email directly or view it on GitHub https://github.com/slackhq/SlackTextViewController/issues/142#issuecomment-82330860.

dzenbot commented 9 years ago

Try not to. Perhaps there is an issue in your custom class.

hagile commented 9 years ago

There should be no issue as I've added the same class from your demo project ! However I'm going to try it without adding that custom class. Will let you know.

hagile commented 9 years ago

Checked, problem isn't with those copy/pasted lines! Uncommented them back.

dzenbot commented 9 years ago

Please create a gist, showing your view controller's implementation. I can't help much without seeing some code.

hagile commented 9 years ago

Can you answer to this issue, https://github.com/slackhq/SlackTextViewController/issues/143 ?

hagile commented 9 years ago

@dzenbot , please check this gist to get an idea on what I'm doing wrong? https://gist.github.com/hagile/87f77b2344165e4904a2

dzenbot commented 9 years ago

You are naming your interface ViewController, but your implementation is named ConversationScreenVC. That's probably the issue.

hagile commented 9 years ago

@dzenbot , hey sorry, that was a bad typo. I don't want to show what exactly the file name is, thought I've changed its name too.

hagile commented 9 years ago

@dzenbot , I've tested it in a test project as well, there's no issue with your classes, I think something wrong in my code only! Any idea? I've tried with a plain (newly added) view controller as well, but there's still no luck. :( hope to have an answer from you.

P.S. I'm working in XCode 6.1. and target is iOS 8.1. And running on a simulator iPhone5s.