Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7495133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:59:15+00:00 2026-05-29T17:59:15+00:00

I use nsfetchedresultscontroller to maintain entity Product. But i set a predicate forUser==%@, currentUser

  • 0

I use nsfetchedresultscontroller to maintain entity “Product”.
But i set a predicate "forUser==%@", currentUser", User is another entity.

Though i can load in the currentUser at runtime, but I wanted to save the “CurrentUser” somewhere in nsuserdefaults, in SQL i’d save the primaryKey of that User there,
On appDidFinishLaunching i could grab that and get the entity.

Im not sure what exactly i should save when it comes to an Entity in the NSUserDefaults.

I don’t want to add an extra attribute of

“last accessed”

to the user, cuz at a time, there is only One current user, and it makes sense to just same some kinda ID. I can save the lastName or firstName, but was thinking about a better way to do it, like some kinda integerID.

Saving NSManagedObjectID URI was also an option, but that would change incase of any migration or core data graph changes, and break the app on update.

please help me understand this in core data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:59:16+00:00Added an answer on May 29, 2026 at 5:59 pm

    You have to add an id given the usecase you mentioned. You wanted to store it in NsUserDefaults right?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use case: user clicks the link on a webpage - boom! load of files
What's the best way to design/use my model and NSFetchedResultsController so that I can
I would like to know if I can do this VIEW 1: use NSFetchedResultsController
use this website a lot but first time posting. My program creates a number
Use Case When a user goes to my website, they will be confronted with
How could I use the NSFetchedResultsController with translated sort key and sectionKeyPath? Problem: I
Is it wrong to use an NSFetchedResultsController purely for data management, i.e., without using
I'm developing an iPhone app where I use a NSFetchedResultsController in the main table
2011-12-28 10:52:13.633 BadgerNew[663:707] CoreData: error: (NSFetchedResultsController) object <Business: 0x628c8e0> (entity: Business; id: 0x628c870 <x-coredata://8D661026-BBFA-4C41-B434-167800D925DD/Business/p88>
In a UITableViewController , I use an NSFetchedResultsController for my data. Everything works fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.