5

i've setup this app with ember and i'm getting this weird message:

TypeError: Object # has no method 'reject'

here's my EmberJS app config:

App = Ember.Application.create();

App.Store = DS.Store.extend({
    revision: 12,
    adapter: DS.RESTAdapter.extend({
        url: 'http://localhost:8080',
        namespace: '6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b'
    })
});

App.Router.map(function() {
    this.resource('collections');
});

App.IndexRoute = Ember.Route.extend({
    redirect: function(){
        this.transitionTo('collections');
    }
});

App.CollectionsRoute = Ember.Route.extend({
    model: function(){
        return App.Collection.find();
    }
});

App.Collection = DS.Model.extend({
    name: DS.attr('string'),
    createdAt: DS.attr('date')
});

Any ideas? :(


Making threaded NSURLConnections

I have a lot of connections going when my app starts, so I wanna put them on background threads so I can make new connections other than the starting connections before they all complete.

Below, threadedRequest: is a method that's starting a NSURLConnection, but when I call performSelectorInBackground:withObject: in the if clause, the connection starts, but never finishes. The else clause works fine and returns data from the connection

if (background)
{
    [self performSelectorInBackground: @selector(threadedRequest:) withObject: args];
}
else
{
    [self performSelector: @selector(threadedRequest:) onThread: [NSThread mainThread] withObject: args waitUntilDone: NO];
}
4

1 回答 1

7

问题接缝是您使用了错误的 ember/ember-data 文件组合......这应该有效:

http://builds.emberjs.com.s3.amazonaws.com/ember-latest.js http://builds.emberjs.com.s3.amazonaws.com/ember-data-latest.js

你可以在这里获得最新的版本:http ://builds.emberjs.com

希望能帮助到你

于 2013-05-03T23:35:30.487 回答