Git Product home page Git Product logo

Comments (18)

sbonami avatar sbonami commented on June 14, 2024

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?

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

Never mind... after reading more, I see the answer is NO.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

Hi Scott... yes, it's an iPad app, using Core Data and I want to be able
to have multiple unique physical users be able to use a particular
Core Data store. So, sync'ing is the only way to accomplish that.

Regards,
Rolf

Scott BonAmi mailto:[email protected]
December 16, 2013 at 10:13 AM

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?

β€”
Reply to this email directly or view it on GitHub
#12 (comment).

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

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:

  • multiple databases that are dynamically named/accessed based on the user's id (and subsequently a user's permissions)
  • utilizing Parse's ACL for permissions (I haven't personally done this and I don't yet have this functionality built into PFIncrementalStore)
  • add a object-user relationship and only query objects attached to that user

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.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

Hi Scott... this app is a appointment booking app... as such, it needs
to sync with one Core Data store (SQLite) so when one user makes an
appointment, other users will see that a particular time slot has been
taken or not, and act accordingly.

I have some code I was given that will accomplish this, but needs work
and testing. Was just hoping to get something "out of the box" so to
speak... :D

R

Scott BonAmi mailto:[email protected]
December 16, 2013 at 11:00 AM

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:

  • multiple databases backed dynamically named/accessed based on the
    user's id (and subsequently a user's permissions)
  • utilizing Parse's ACL for permissions (I haven't personally done
    this and I don't yet have this functionality built into
    /PFIncrementalStore/)
  • add a object-user relationship and only query objects attached to
    that user

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
http://stackoverflow.com/questions/ask.

β€”
Reply to this email directly or view it on GitHub
#12 (comment).

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

"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.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

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

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

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.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

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

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

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. :-{

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

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 0.0.1 release to my satisfaction this library and its specification has not yet been pushed to Cocoapods, thus you must explicitly declare the git location.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

You don't need 'install'?

R

Scott BonAmi mailto:[email protected]
December 16, 2013 at 8:58 PM

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 |0.0.1| release to my satisfaction this
library and its specification has not yet been pushed to Cocoapods,
thus you must explicitly declare the git location.

β€”
Reply to this email directly or view it on GitHub
#12 (comment).

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

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 pod install to generate a Pods directory, workspace, etc.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

How do I get your updates to PFIncrementalStore?

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

Keep an eye on the repo. As changes are made, you can just call pod from the same directory as your Podfile to fetch the latest updates from GitHub.

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

Here's my two cents worth -- when you get a chance, I think you need to
elaborate on the instructions for including PFIncrementalStore in the
developer's app (where, how, etc)... I'm lost! :-{

From what I've read, once I have this set up and registered, apparently
none of my calls to MR for Core Data change... it's all handled under
the covers, so to speak. Am I on the right track?

Sorry for the lame question... to give you a little background: I've
been programming since the 1960's on mainframes, mid-range, PCs and now
iApps... I'm 71 years old! I do this as a sort of hobby... keeps my
mind active!

R

Scott BonAmi mailto:[email protected]
December 17, 2013 at 6:31 AM

Keep an eye on the repo. As changes are made, you can just call |pod|
from the same directory as your |Podfile| to fetch the latest updates
from GitHub.

β€”
Reply to this email directly or view it on GitHub
#12 (comment).

from pfincrementalstore.

Spokane-Dude avatar Spokane-Dude commented on June 14, 2024

Hi Scott... two questions:

  • Do I really need the Facebook, etc stuff? (my login info is self
    contained within the app)
  • When you say "attach PFIncrementalStore to my existing project", do
    you mean "Add files to project" ?

R

Scott BonAmi mailto:[email protected]
December 16, 2013 at 6:11 PM

"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.

β€”
Reply to this email directly or view it on GitHub
#12 (comment).

from pfincrementalstore.

sbonami avatar sbonami commented on June 14, 2024

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.

from pfincrementalstore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.