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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:42:08+00:00 2026-06-09T03:42:08+00:00

I have a category for each of my NSManagedObject subclasses, where factory methods sit,

  • 0

I have a category for each of my NSManagedObject subclasses, where factory methods sit, so that they are not lost when automatically regenerating the class files. So that I don’t need to know what subclass of NSManagedObject I’m using at runtime, each subclass has the same name for its factory method, e.g.

+ (id)objectWithInfo:(NSDictionary *)info inManagedObjectContext:(NSManagedObjectContext *)context;

(For clarity, in this example suppose there is an entity deriving from NSManagedObject called Item, with generated files Item.m and Item.h, and my own category with files Item+Factory.m and Item+Factory.h, where the method above resides).

In Xcode 4.3 this generates no warning: but Xcode 4.4 (and above flag it as a warning:

(null): Meta method ‘objectWithInfo:inManagedObjectContext:’ in
category from …Item+Factory.o conflicts with same method from
another category

Now, I’m well aware of the dangers of overloading a method in a category, it’s a Bad Thing. What I’m doing here, however, is simply treating objects as a more general class than they are, which as fas as I’m aware is sensible.

Is what I’m doing bad? Or is there a different way to declare my methods to remove the warning?

  • 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-09T03:42:10+00:00Added an answer on June 9, 2026 at 3:42 am

    To answer my own question:

    I was redeclaring the method in the header of each subclass. Declaring once in the superclass sorted it.

    Additionally, moving all +Factory.h #imports into the precompiled header (and removing elsewhere) vastly reduces confusion and additional warnings.

    Thanks to Paul.s for making me think along those lines.

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

Sidebar

Related Questions

I have a Categories table in which each category has a ParentId that can
I have some products that belongs to the some category. Each category can have
I have a Category and a Post model, with each Post belonging to a
I have a product catalog. Each category consists of different number (in deep) of
I have a table of categories. Each category can either be a root level
I have a site with a bunch of categories. On each category archive page,
I have a product database with several product categories. Each category has a number
So i have a picture gallery with eight categories. Each category has 400+ images,
I have a database table of events. Each event has a category and a
I have category model that has a tree structure. In my database I 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.