Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
Created February 9, 2013 23:40
Show Gist options
  • Save MikeSilvis/4747604 to your computer and use it in GitHub Desktop.
Save MikeSilvis/4747604 to your computer and use it in GitHub Desktop.
class Contact
def self.all
people.collect do |p|
{
title: "#{p.first_name} #{p.last_name}",
action: :open_contact,
image: { image: p.photo }
}
end
end
def self.people
AddressBook::Person.all
end
def full_name(person)
"#{person.first_name} #{person.last_name}"
end
end
class ContactsIndex < ProMotion::TableScreen
searchable placeholder: "Search friends..."
title "Contacts"
def on_load
set_tab_bar_item title: "Current"
end
def table_data
[
cells: Contact.all
]
end
def open_contact
open_screen ContactShow.new(nav_bar: true)
end
end
1.9.3 cuddle-ruby master $ rake
Build ./build/iPhoneSimulator-6.1-Development
Build vendor/Pods
Link ./build/iPhoneSimulator-6.1-Development/cuddle-ruby.app/cuddle-ruby
Create ./build/iPhoneSimulator-6.1-Development/cuddle-ruby.dSYM
Simulate ./build/iPhoneSimulator-6.1-Development/cuddle-ruby.app
(main)> 2013-02-09 18:39:08.604 cuddle-ruby[27543:c07] -[__NSCFData _isResizable]: unrecognized selector sent to instance 0xa261000
2013-02-09 18:39:08.680 cuddle-ruby[27543:c07] sectioned_table.rb:176:in `tableView:cellForRowAtIndexPath:': NSInvalidArgumentException: -[__NSCFData _isResizable]: unrecognized selector sent to instance 0xa261000 (RuntimeError)
from app_delegate.rb:31:in `load_root_screen:'
from screen_tabs.rb:36:in `open_tab_bar:'
from app_delegate.rb:6:in `on_load:'
from app_delegate.rb:11:in `application:didFinishLaunchingWithOptions:'
2013-02-09 18:39:08.681 cuddle-ruby[27543:c07] *** Terminating app due to uncaught exception 'RuntimeError', reason: 'sectioned_table.rb:176:in `tableView:cellForRowAtIndexPath:': NSInvalidArgumentException: -[__NSCFData _isResizable]: unrecognized selector sent to instance 0xa261000 (RuntimeError)
from app_delegate.rb:31:in `load_root_screen:'
from screen_tabs.rb:36:in `open_tab_bar:'
from app_delegate.rb:6:in `on_load:'
from app_delegate.rb:11:in `application:didFinishLaunchingWithOptions:'
'
*** First throw call stack:
(0xddf012 0x468e7e 0x20c904 0xf5e2 0xeeb1)
libc++abi.dylib: terminate called throwing an exception
*** simulator session ended with error: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "The simulated application quit." UserInfo=0x100127580 {NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
rake aborted!
Command failed with status (1): [DYLD_FRAMEWORK_PATH="/Applications/Xcode.a...]
/Library/RubyMotion/lib/motion/project.rb:101:in `block in <top (required)>'
/Users/mikesilvis/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/mikesilvis/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => default => simulator
(See full trace by running task with --trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment