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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:04:51+00:00 2026-06-14T05:04:51+00:00

I have an iOS application that uses core data. I’ve built my NSManagedObjectModel .

  • 0

I have an iOS application that uses core data.
I’ve built my NSManagedObjectModel. I have an NEOrder entity there.
I’ve generated NSManagedObject subclasses.

@interface NEOrder : NSManagedObject

@property //....

@end

I have a UIViewController’s subclass. That needs to have and instance variable of type NEOrder.
But I want it to behave like a common custom object:

@interface NEOrder : NSObject

@property //....

@end

Of course it can be done by creating another .h and .m file with declaration of NEOrder_ subclassing NSObject there. But this file will be very similar to core data generated NSObjectModels, except @synthesize/@dynamic and init method.
I don’t want to do the work twice.
Help me please, how can it be done?

if I’m adding init to the generated NEOrder app gets crashed:

-(id)init
{
    if (self=[super init])
    {
        self.name=[[NSString alloc] init];
        self.phone=[[NSString alloc] init];
        self.weight=[[NSNumber alloc] init];
        self.fromDirection=[[NEDirection alloc] init];
        self.toDirection=[[NEDirection alloc] init];
    }
    return self;
}

And another few words about how I want to use it.

//NEOrder *order is an instance of view controller
self.order=[NEOrder alloc] init]
//...
self.order.name=@"order name";
self.order.phone=@"12344321";

Is it possible? Or I have to create a separate NSObject’s subclass for that?

  • 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-14T05:04:52+00:00Added an answer on June 14, 2026 at 5:04 am

    One part of your question doesn’t make sense:

    I want it to behave like a common custom object.

    What do you mean?

    The rest of your question suggests you need a single NEOrder class, and that you should set up your view controller like this:

    MyViewController.h:

    @class NEOrder;
    
    @interface MyViewController : UIViewController
    
    @property (strong) NEOrder *order;
    
    @end
    

    MyViewController.m:

    #include "NEOrder.h"
    
    @implementation MyViewController
    
    ...
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iOS application I have made a form that should submit data into
I have an AIR application that I'm compiling to mobile. There is an iOS
I have an application that picks up some data (numbers) from the iOS and
I have an iOS application that uses a simple UIDocument model with a single
I have an iOS application that uses GPS for Location Services. A user would
I have written a web application that uses Microsoft's built-in membership authentication that is
I have an application that is developed for ios lower than ios 5.. it
I'm developing an iOS 4 application. I have a main view that contains another
for an iOS 5.0 application using ARC, i have an NSArray of objects that
i have ios application with xcdatamodeld, i want update some data so need a

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.