2012-02-25 4 views
0

私はCoreDataを初めて使用しており、RestKitを使い始めました。 CoreDataでRestkitプロジェクトを作成しようとしています。 [NSManagedObject managedObjectContext]CoreDataを使用したRestKitがクラッシュする

すべてのアイデア、私が間違って何をやっている+で

アサーション失敗:しかし、私は、このランタイムエラーを取得していますか?

以下は私のコードです。私は今のところデータモデルを作成していません。

 _objectManager = [RKObjectManager objectManagerWithBaseURL:@"https://api.foursquare.com/v2/venues"]; 
    // _objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"jiffAssignment.sqlite"]; 

    RKManagedObjectMapping *locationMapping = [RKManagedObjectMapping mappingForClass:[Location class]]; 
    [locationMapping mapKeyPath:@"address" toAttribute:@"address"]; 
    [locationMapping mapKeyPath:@"crossStreet" toAttribute:@"crossStreet"]; 
    [locationMapping mapKeyPath:@"city" toAttribute:@"city"]; 
    [locationMapping mapKeyPath:@"state" toAttribute:@"state"]; 
    [_objectManager.mappingProvider setMapping:locationMapping forKeyPath:@"location"]; 

    // RKObjectMapping *statisticsMapping = [RKManagedObjectMapping mappingForClass:[Statistics class]]; 
// [statisticsMapping mapAttributes:@"checkinsCount",@"usersCount", nil]; 


    NSLog(@"VenueListController Initialized"); 
    return self; 

すべてのヘルプ/コメントをいただければ幸いです。

おかげ ヴィク

答えて

0

あなたが失敗し、実際のアサーションを使用して記事を更新することはできますか?

_objectManagerobjectStoreが設定されていない場合は、RKManagedObjectMappingを使用できません。この行は、あなたが投稿したコードでコメントアウトされています。

関連する問題