MacRuby example of using Core Data to search for Category objects
class AuctionTableDatasource | |
attr_writer :app_delegate | |
attr_accessor :view | |
. | |
. | |
. | |
def set_selected_category(category_name) | |
context = @app_delegate.managedObjectContext | |
@current_category = Category.find_first(context, by_name:category_name) | |
all = @current_category.auctions.allObjects | |
@all_rows = all.collect do |row| | |
# This converts the Core Data object into a hash that the rest of the data source uses to display. | |
translate_row(row) | |
end | |
view.reloadData | |
end | |
end |
require 'entity' | |
class Category < Entity | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment