-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this sync between two separate users? #12
Comments
Can you provide a little more detail as to what you're looking to do? Is this syncing a Parse user with a CoreData user? Is this syncing one Parse user with another? |
Never mind... after reading more, I see the answer is NO. |
Hi Scott... yes, it's an iPad app, using Core Data and I want to be able Regards,
|
Rolf, I think this has more to do with how you query the data and less to do with syncing it. There's several ways you could achieve this:
Let me know if either of these interest you, although I will add that they are falling outside the scope of PFIncrementalStore. Your questions would probably benefit from being posted on StackOverflow. |
Hi Scott... this app is a appointment booking app... as such, it needs I have some code I was given that will accomplish this, but needs work R
|
"Out of the box" is precisely why I started PFIncrementalStore :) This project still has a few more changes that need to happen before I list it on cocoapods, and even then I would consider it a development-only project until further testing can be done. That being said, I'd do the following (these are rough instructions off the top of my head):
User *currentUser = <# current user #>;
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"user = %@", currentUser];
NSError *error = nil;
NSManagedObjectContext *context = <#Managed Object Context #>;
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Appointment"];
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"appointmentUser = %@", currentUser]];
NSArray *results = [context executeFetchRequest:fetchRequest error:&error]; NOTE: PFIncrementalStore adds additional fields necessary to keep everything synced. Steps for migrating your schema should be taken or your app may crash. NOTE: PFIncrementalStore will be submitted to cocoapods soon at which time the git declaration can be dropped from the Podfile. |
It sounds like you are saying that I can do Core Data sync'ing between one Core Data store and multiple concurrent users? Is that correct? If so, I'm onboard! Now there might be one glitch: I use MagicalRecord for all of the Core Data calls... is that going to be a problem? (it doesn't look like to me, but then again, I didn't write your code! ) :D R |
If I understand everything as you've described, then yes I am saying that you can sync Core Data with multiple users. As far as MagicalRecord goes, it's a layer that sits on top of CoreData and as such shouldn't be affected by PFIncrementalStore. I've not personally used MagicalRecord so give it a shot and report back on any issues you may run into. Check out this StackOverflow q&a about connecting another incremental store with MagicalRecord. |
I'll get started on it tomorrow... Don't know where you are, but I'm in Spokane, WA, and it's getting late! :D |
I don't know anything about CocoaPods, but this line doesn't seem right: pod 'PFIncrementalStore, git: 'https://github.com/sbonami/PFIncrementalStore.git' Unbalanced single quote and there is no 'install' command... am I correct? Anyway, it can't find the specificaiton for PFIncrementalStore. :-{ |
I did say they were rough instructions 😉 I've updated the instructions to fix the unbalanced quote and clarify what I meant. Since I have not completed a |
You don't need 'install'? R
|
Cocoapods has an awesome Getting Started guide (http://beta.cocoapods.org/#get_started) to walk you through getting everything set up. After creating a Podfile and adding the line mentioned above, you will run |
How do I get your updates to PFIncrementalStore? |
Keep an eye on the repo. As changes are made, you can just call |
Here's my two cents worth -- when you get a chance, I think you need to From what I've read, once I have this set up and registered, apparently Sorry for the lame question... to give you a little background: I've R
|
Hi Scott... two questions:
R
|
As this project is still pre 0.0.1 and only available via GitHub, I have yet to write full installation and usage instructions. I appreciate that you aim to continuously learn new tech and moreso that you have interest in PFIncrementalStore, but I believe this project may require a level of understanding and attention that is more advanced. At the point in which deem the project able to launch publicly, I would highly recommend you revisit as I still believe it will solve your goals. As we've both stated: better instructions, more testing, and an example project may make the project more easily digestible. |
I'm looking for a replacement for FTASync... will this do it?
The text was updated successfully, but these errors were encountered: