Closed acoustep closed 9 years ago
I could be wrong but from what I recall.
If you've ran it on the simulator and then changed schema files you need to do a hard reset on your simulator. Either 'reset content and settings on the menu' or using the new clear gem.
Any schema that gets included in an app and then pushed to a device or simulator cannot be changed you need to bump it up with a migration. That being said what @kemiller suggested to me was you can change while in dev (but you will need to reset the simulator when changed) but once you push a release that may be on a device that file must remain as is and a migration needs added.
Yeah, just use my reset-sim
gem (included in newclear
) to reset everything and start over again from scratch whenever i make a change to the schema.
Try that and let us know if that fixes the problem. If not, we'll keep digging :)
I've just tried both rake newclear
and "Resent Content and Settings..." and I'm receiving the same error still:
2015-07-11 18:38:29.914 todo2[24678:2332632] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I've also tried updating app.sdk_version
and app.deployment_target
from 7.1 to 8.4 but I'm still getting the error.
Thank you for helping :)
So your error: __NSArrayM insertObject:atIndex:
seems like you're trying to do something to an array, like adding to it. Can you post some relevant code? It doesn't seem to be giving you a line number for the error.
This is what I've been trying to find. Here are the files that I've edited:
schemas/0001_intiial.rb
schema "0001 initial" do
# Examples:
#
entity "Person" do
string :name, optional: false
has_many :posts
end
entity "Post" do
string :title, optional: false
string :body
datetime :created_at
datetime :updated_at
has_many :replies, inverse: "Post.parent"
belongs_to :parent, inverse: "Post.replies"
belongs_to :person
end
end
app/models/person.rb
class Person < CDQManagedObject
end
app/models/post.rb
class Post < CDQManagedObject
end
app/screens/home_screen.rb
class HomeScreen < PM::Screen
title "Your title here"
stylesheet HomeScreenStylesheet
def on_load
set_nav_bar_button :left, system_item: :camera, action: :nav_left_button
set_nav_bar_button :right, title: "Right", action: :nav_right_button
@hello_world = append!(UILabel, :hello_world)
end
def nav_left_button
mp 'Left button'
end
def nav_right_button
mp 'Right button'
end
# You don't have to reapply styles to all UIViews, if you want to optimize, another way to do it
# is tag the views you need to restyle in your stylesheet, then only reapply the tagged views, like so:
# def logo(st)
# st.frame = {t: 10, w: 200, h: 96}
# st.centered = :horizontal
# st.image = image.resource('logo')
# st.tag(:reapply_style)
# end
#
# Then in will_animate_rotate
# find(:reapply_style).reapply_styles#
# Remove the following if you're only using portrait
def will_animate_rotate(orientation, duration)
find.all.reapply_styles
end
end
It's a fresh project so there isn't much else to show, I can put the whole thing on Github if you think it will help.
I may try it running through it on my old Mac and see if I get the same issue.
Yeah if you can push to github I could clone and help debug, assuming mark doesn't beat me to it :)
Here's the code: https://github.com/acoustep/rptodo
Thank you for taking a look, I've just made a fresh app on my old Mac and I'm getting the same issue.
At this point I'm hoping I haven't missed something incredibly obvious.
These are the step's I'm doing:
potion create todo
cd todo
cdq create model person
cdq create model post
rake
So it looks like this might be some kind of CDQ error. I was able to reproduce your steps exactly and get the isssue. Perhaps @kemiller could chime in. I see a few commits in master regarding YAML stuff, but I get a different error when pointing the gemfile to github.
*\ Terminating app due to uncaught exception 'NameError', reason: 'config.rb:38:in `block in initialize:': uninitialized constant CDQ::CDQConfig::YAML (NameError)
Not sure why this isn't working out of the box.
@acoustep @markrickert ill pull it down and try and poke around soon too - thanks for bringing this up @acoustep !
I over-fixed the YAML issue. Try again now.
I've updated to CDQ 1.0.6 from master and now I'm getting the same error as @markrickert.
This fix should be a temporary workaround while we fix the issue once and for all in CDQ: https://github.com/infinitered/cdq/issues/105#issuecomment-120950301
Haha, finally it works! Thank you for all of your help :)
I'm not sure if this is an issue with RedPotion, CDQ or myself being a noob but after running through the CDQ tutorial here http://docs.redpotion.org/en/latest/cookbook/core_data/ I'm getting an error when trying to run the iOS simulator. So far I've uncommented the schema and generated the model files.
*** Starting simulator 2015-07-11 14:56:30.203 todo2[73446:1865241] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I've tried this with the iOS 7.0 and the 8.4 simulator. I've even tried recreating a blank project to make sure it wasn't my own code causing it. The app works fine until I make the schema and model files.
I'm using the following gem versions:
RedPotion 1.3.0 ProMotion 2.4.2 CDQ 1.0.3
StackTrace:
Any ideas if I'm doing something wrong?