restkit / rkgist Goto Github PK
View Code? Open in Web Editor NEWThe RKGist application used in the RestKit Guide
License: Apache License 2.0
The RKGist application used in the RestKit Guide
License: Apache License 2.0
@blakewatters if you could add examples / guidelines (or in RKGist tutorial) some general rules on when to use mainQueueManagedObjectContext vs persistentStoreManagedObjectContext vs newChildManagedObjectContextWithConcurrencyType.
We have an use case where a background is loading a huge list (in chunks of 100 objects at a time), but the UI wants to render that list and also makes references to some other objects already in CoreData... when all that happens, I see deadlocks and I'm still not sure exactly what's going on.
Hello Blake.
When I do next stuff:
[[RKObjectManager sharedManager].operationQueue cancelAllOperations]; [[NSURLCache sharedURLCache] removeAllCachedResponses]; [RKObjectManager sharedManager].managedObjectStore.managedObjectCache = nil; NSError * error = nil; [[RKObjectManager sharedManager].managedObjectStore resetPersistentStores:&error]; if(error){ NSLog(@"error reset persistent store: %@", error.localizedDescription); }
The NSLog(@"error reset persistent store: %@", error.localizedDescription); is clear. So reset did success.
I not relaunch app, just show Login page for user and after login, in first mapping to entity, this errors appears:
restkit.core_data.cache:RKEntityByAttributeCache.m:227 Failed to retrieve managed object with ID 0x8b768c0 . Error The operation couldn’t be completed. (Cocoa error 133000.) { NSUnderlyingException = "Object's persistent store is not reachable from this NSManagedObjectContext's coordinator"; } E restkit.core_data.cache:RKEntityByAttributeCache.m:227 Failed to retrieve managed object with ID 0x8bce8e0 . Error The operation couldn’t be completed. (Cocoa error 133000.) { NSUnderlyingException = "Object's persistent store is not reachable from this NSManagedObjectContext's coordinator"; } E restkit.core_data.cache:RKEntityByAttributeCache.m:227 Failed to retrieve managed object with ID 0x8bcea30 . Error The operation couldn’t be completed. (Cocoa error 133000.) { NSUnderlyingException = "Object's persistent store is not reachable from this NSManagedObjectContext's coordinator"; }
What I do wrong?
Thank you.
Thought of contributing to completion of the tutorial, but it looks as if pull requests are ignored. Seven months and nine months. Simple contributions. No action.
Thank you for the tutorial. It is so far very encouraging.
how can i creat a XMPP chat room?
In Getting Acquainted with RestKit I spotted to issues:
Should it be exciting?
2015-03-23 08:33:56.350 RKGist[45281:1988533] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<RKGGist 0x7c055040> valueForUndefinedKey:]: the entity Gist is not key value coding-compliant for the key "timeStamp".'
*** First throw call stack:
(
0 CoreFoundation 0x0283d466 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x024c6a97 objc_exception_throw + 44
2 CoreFoundation 0x0283d081 -[NSException raise] + 17
3 CoreData 0x0072598a -[NSManagedObject valueForUndefinedKey:] + 362
4 Foundation 0x01e77f28 _NSGetUsingKeyValueGetter + 104
5 CoreData 0x006bced3 -[NSManagedObject valueForKey:] + 131
6 RKGist 0x000757a7 -[RKGDetailViewController configureView] + 183
7 RKGist 0x000756c3 -[RKGDetailViewController setDetailItem:] + 131
8 ...
Tried to enhance the sample project starting with the user information by doing
// User Entity
RKEntityMapping *userEntityMapping = [RKEntityMapping mappingForEntityForName:@"User" inManagedObjectStore:managedObjectStore];
userEntityMapping.identificationAttributes = @[@"userID"];
[userEntityMapping addAttributeMappingsFromDictionary:@{
@"id" : @"userID",
@"avatar_url" : @"avatarURL",
@"gravatar_id" : @"gravatarID",
@"url" : @"jsonURL",
@"login" : @"login"}];
RKResponseDescriptor *userResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:userEntityMapping pathPattern:@"/gists/public" keyPath:@"user" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
[objectManager addResponseDescriptor:userResponseDescriptor];
but as the json contains some users with null values I got an exception in
static NSDictionary *RKEntityIdentificationAttributesForEntityMappingWithRepresentation(RKEntityMapping *entityMapping, NSDictionary *representation)
I can see that in
- (NSArray *)mapRepresentations:(id)representations atKeyPath:(NSString *)keyPath usingMapping:(RKMapping *)mapping
the objectsToMap array some [NSNull null] value are inserted.
Couldn't find any protocol/delegate calls to avoid having null values added to this array.
Any help is appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.