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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:06:01+00:00 2026-06-05T07:06:01+00:00

For a day now I’ve been trying to get a piece of code working

  • 0

For a day now I’ve been trying to get a piece of code working to help me handle find-and-create for CoreData in a nice way (from this article I found http://emplementation.blogspot.nl/2011/12/importing-data-into-core-data-while.html). I ended up working with code blocks which I’ve never done before.

Somehow I can’t fix the following error which occurs because something is different in my typedef from what I try to define in my function. I think I understand it has something to do with the block being defined as __strong in the typedef but differently in my implementation file.

Error

Incompatible block pointer types initializing ‘_strong objectOperationBlock’ (aka ‘void (^_strong)(NSManagedObjectContext *_strong, NSDictionary *_strong, NSManagedObject *_strong)’) with an expression of type ‘void (^)(NSManagedObject *_strong, NSDictionary *_strong, NSManagedObject *_strong)’

MyViewController.h

typedef void (^objectOperationBlock)(NSManagedObjectContext *context,
                                 NSDictionary *hostObjectData,
                                 NSManagedObject *localManagedObject);

MyViewController.m

objectOperationBlock matchedBlock = ^(NSManagedObject *context, NSDictionary *hostObjectData, NSManagedObject *localManagedObject){
    NSLog(@"Dosomething");
};

In all my attempts I’ve found out that this could will build (but it’s not using the typedef)

void (^matchedBlock)(NSManagedObject*, NSDictionary*, NSManagedObject*) = ^(NSManagedObject *context, NSDictionary *hostObjectData, NSManagedObject *localManagedObject){
    NSLog(@"Dosomething");
};

Thanks in advance for all your help!

  • 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-05T07:06:03+00:00Added an answer on June 5, 2026 at 7:06 am

    Did I miss that the typedef should read:

    typedef void (^objectOperationBlock)(NSManagedObject *managedObject,
                                         NSDictionary *hostObjectData,
                                         NSManagedObject *localManagedObject);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying for about a day now to get this method to work.
I've been looking for a day now, and could not find help on what
I have been trying for about a day now to get an xml feed
I have been trying to get around this error for a day now and
I've been working on this all day now, and I just can't get it
Been trying to sort this for over a day now, and I am sure
Ok, so I've been trying to get this concept to work for the day
I have been trying to find out the problem to this for a day
I've been at this most of the day now, and I cannot get this
I have been trying to solve this issue for a day now and have

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.