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 8557851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:40:09+00:00 2026-06-11T15:40:09+00:00

I use the a helper class to get a block with NSManagedObjectContext in it.

  • 0

I use the a helper class to get a block with NSManagedObjectContext in it.

+ (void)openTheDocumentAndPerformBlock:(completion_handle_t)completionBlock;

And now I want to keep one of the NSManagedObject outside of the block, because I want to interact with it constantly. And if I can’t keep it in the ViewController, I have to query it everytime when I need it, and it will be really troublesome.

1, And can I pass the NSManagedObject through segue to another VC?
2, does the UIManagedDocument has to be open all the time when those thing append?
3, And Can I edit the NSManagedObject outside of the block, and save it in the Block?

  • 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-06-11T15:40:10+00:00Added an answer on June 11, 2026 at 3:40 pm

    If I am understanding your question correctly, you just need an instance variable of type NSManagedObject in your class(the view controller class) so that you can assign your managed object, that you queried out in your block to this variable. You can use this wherever you want.
    As for your other questions:
    1. Hope the following code snippet works:
    In your destination view controller class declare an instance variable to store the passed object.

    @property (strong) NSManagedObject *container;
    

    inside the prepareForSegue: method of source view controller get the destination vc and pass the managed object:

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
        UIViewController *destVC = [segue destinationViewController];
        [destVC setValue:<managed object from block> forKey:@"container"]
    }
    

    And yes you can use NSManagedObject inside and outside your block as long its the same managed object context you are using.

    And I don’t know the answer for your second question.

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

Sidebar

Related Questions

I want to use the Html Helper class to build, for example, an Html.ActionLink
Is there any way to get access to a helper class from within a
I have a problem, I'm trying to use a helper-class for a MVC project.
In Rails 3 I use the following helper in order to get a even-odd-coloured
I have a static class in my solution that is basically use a helper/ultility
We have a helper class that we use to call stored procs on SQL
I have a DB helper class which extends SQLiteOpenHelper and in onCreate, I want
I've created a very simple helper class that I can use in my ASP.Net
How should I use proguard with ormlite library on Android? Trying this: -keep class
first time asking. Here's the deal: I have a helper class (at least now

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.