Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKComponentController::componentTreeWillAppear not called #65

Closed
myeyesareblind opened this issue Apr 6, 2015 · 12 comments
Closed

CKComponentController::componentTreeWillAppear not called #65

myeyesareblind opened this issue Apr 6, 2015 · 12 comments
Assignees
Labels

Comments

@myeyesareblind
Copy link

Those methods are not called on CKComponentSubclass:

  • (void)componentDidAcquireView
  • (void)componentWillRelinquishView
  • (void)componentTreeWillAppear
  • (void)componentTreeDidDisappear
    Not sure if I am missing something
@adamjernst
Copy link
Contributor

They're called on CKComponentController, not CKComponent instances.

@myeyesareblind
Copy link
Author

Yeah, that is what I actually meant, see title. They are not called on ComponentController.

@adamjernst adamjernst reopened this Apr 6, 2015
@adamjernst
Copy link
Contributor

Ah I see. Can you submit an example project?

@myeyesareblind
Copy link
Author

This does happen in Example project, simply add InteractiveQuoteComponentController with those methods.
-(void).*mount methods are properly called, those 4 - not.

@adamjernst
Copy link
Contributor

componentDidAcquireView and componentWillRelinquishView will not be called because InteractiveQuoteComponent itself does not have a view. (Only its sub-component CKStackLayoutComponent does.)

However componentTreeWillAppear and componentTreeDidDisappear should be called. That warrants further investigate.

@adamjernst adamjernst added bug and removed question labels Apr 16, 2015
@adamjernst
Copy link
Contributor

Verified this is a bug. Assigning @benlodotcom to fix.

@adamjernst
Copy link
Contributor

Actually I'll take it

adamjernst added a commit to adamjernst/componentkit that referenced this issue Apr 16, 2015
Test Plan: add `componentTreeWillAppear` in the sample app and verify it's called.
benlodotcom added a commit that referenced this issue Apr 17, 2015
Actually announce tree events to listeners. Fixes #65.
@myeyesareblind
Copy link
Author

It works, thank you.
There is another thing now.
Currently, if you ask dataSource for not existing indexPath, it will crash since there is direct access to NSArray[index].
What happens for me is that I delete a cell and receive didEndDisplayingCell, the app crashes on announceDidDisappearForItemAtIndexPath because the model was deleted.
It might be better to simply return nil I guess.
Minor thing since I can actually check in my model, but still...

@adamjernst
Copy link
Contributor

That's bad — opened #129 to track.

@thanhturin
Copy link

@myeyesareblind Hi guy! Can you help me to submit your example project to me? Thank you very much!

@myeyesareblind
Copy link
Author

@thanhturin what exact issue are you working on? componentTreeWillAppear is fixed now

@thanhturin
Copy link

@myeyesareblind : I'm sorry about my late reply! I had the same problem 3 days ago. But i already fixed it. Thank you for your listening :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants