This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI] Implement delegates and selectors for linked table items.
This finally makes it possible to interact with Three20 table views without depending upon TTNavigator.
- Loading branch information
Showing
5 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason these don't use TT_RELEASE_SAFELY() anymore? using property notation in dealloc can have interesting side effects such as calling KVC/KVO listeners and is sometimes undesirable.
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fair point. The rationale was that the dealloc method would be less error-prone by using property methods. There is less likelihood of accidentally releasing something that isn't retained or copied this way, for example.
It's very likely that calling KVC/KVO listeners on the dealloc is far less desirable than avoiding the potential for over-releasing something. What's your opinion?
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say go with release/nil like TT_RELEASE_SAFELY does. If you call TT_RELEASE_SAFELY on an assigned property it is most certainly a bug and one that will more than likely cause a crash pretty quickly so it should be easy to identify. I just made the comment because TT_RELEASE_SAFELY is used everywhere in the framework and if anyone is using KVO/KVC they will get some unneeded notifications. Seems like a good plan to keep it all consistent.
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll second the recommendation to use TT_RELEASE_SAFELY. In the past I've tried using the accessors in dealloc methods and that just ends of causing more pain than it's worth.
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for TT_RELEASE_SAFELY
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 679e680.
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially true for dynamic setters. If the setters are not implemented properly, assigning the property to nil may cause problem.
1b946f4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually hit this the other day in one of my classes and solved it the same way... +1 for TT_RELEASE_SAFELY.