Thank you for reading the Dispatch
I enjoy writing the Dispatch, but that wouldn’t matter without you, the reader, using some of your limited time to read it. Thank you.
In the “Poll of the Week” below, I ask what parts of the Dispatch you like, I’d appreciate it if you would let me know.
Do you want write a section as a “guest writer”? Email me: firstname.lastname@example.org
Happy coding, Todd Werth (@twerth)
Articles, News, and Blog Posts
Jan 17th, 2014 – “Breaking Cyclical References in RubyMotion with Proc#weak” by Justin DeWind
Jan 13th, 2014 – “Core Data with NSFetchedResultsController in RubyMotion” by Lori Olson
Poll of the Week
This week I’m doing a bit of market research, asking you what sections you like in the Dispatch. Let me know if you’d like another section (email@example.com).
Last week’s poll, “OS X, iOS, or both?”:
- I build for iOS now – 18 votes (46%)
- I want to build for OS X in the future – 12 votes (31%)
- I build for OS X now – 5 votes (13%)
- I want to build for iOS in the future – 4 votes (10%)
RubyMotion App of the Week
RubyMotion Tip – by Mark Rickert
Use the awesome_print_motion gem instead of puts to get auto-formatted & colored output in the console. It detects the object type and makes it much easier to read than a simple “puts”.
After installing, use the ap command:
Traversing (or moving around the tree)
You can easily move around the tree with RMQ. There is a lot to traversing, but I’ll show you the five most common methods.
view_controller – this simple returns the current view_controller. This is used often.
root_view – this returns the view controller’s root view.
which is exactly the same as
closest – moves up the tree returning the first view it finds that matches the selectors. Think of this as searching through the view’s ancestors, starting with its parent, then grandparent, etc. Returns one or none, not many.
find – returns all children, grandchildren, great grandchildren, etc, that match the selector. This example disables all buttons and styles them as disabled inside a view that contains them:
parent – returns the view’s parent.