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

  • Home
  • SEARCH
  • 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 8269759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:20:04+00:00 2026-06-08T06:20:04+00:00

I am running the following code in the IOS 5.1 simulator: Table* sparkFront =

  • 0

I am running the following code in the IOS 5.1 simulator:

Table* sparkFront =
  [NSEntityDescription insertNewObjectForEntityForName:@"Table"
                                inManagedObjectContext:_context];
NSLog(@"%@", sparkFront);
NSEntityDescription* entity = [NSEntityDescription entityForName:@"Table"
                                          inManagedObjectContext:_context];
NSDictionary* dict = [entity propertiesByName];
for (NSObject* key in [dict allKeys])
{
  NSLog(@"%@", key);
}
sparkFront.columnValuesAddress = 0x606;

This code crashes with EXC_BAD_ACCESS on the last line. The Table object is a Core Data object implemented as follows:

@interface Table : NSManagedObject
@property (nonatomic) int32_t columnValuesAddress;
@end

I know Core Data doesn’t natively do scalar types, but this is an IOS 5+ only app, and I was under the impression the un/boxing was done automatically. The output of the above code before the crash shows that my context and entity are good:

2012-07-20 22:17:52.714 otest[95147:7b03] <NSManagedObject: 0x9c87b20> (entity: Table; id: 0x9c86a80 <x-coredata:///Table/t2C0D90D5-E381-4BD0-B65D-8FC83C6D50DB2> ; data: {
columnValuesAddress = 0;
})
2012-07-20 22:17:52.716 otest[95147:7b03] columnValuesAddress

After the crash, the problem report shows the following:

Application Specific Information:
objc_msgSend() selector name: isNSNumber__
Simulator libSystem was initialized out of order.


Thread 0 Crashed:
0   libobjc.A.dylib                 0x00635098 objc_msgSend + 12
1   CoreData                        0x05c2e833 _PFManagedObject_coerceValueForKeyWithDescription + 483
2   CoreData                        0x05bfe3d1 _sharedIMPL_setvfk_core + 209
3   CoreData                        0x05c16687 _svfk_0 + 39
4   ECMCalTests                     0x0187f8f1 -[ECMCalTests testInsertRecords] + 849 (ECMCalTests.m:73)
5   CoreFoundation                  0x003f74ed __invoking___ + 29
6   CoreFoundation                  0x003f7407 -[NSInvocation invoke] + 167
7   SenTestingKit                   0x201039c4 -[SenTestCase invokeTest] + 184
8   SenTestingKit                   0x20103868 -[SenTestCase performTest:] + 183
9   SenTestingKit                   0x201034a9 -[SenTest run] + 82
10  SenTestingKit                   0x20106db2 -[SenTestSuite performTest:] + 106
11  SenTestingKit                   0x201034a9 -[SenTest run] + 82
12  SenTestingKit                   0x20106db2 -[SenTestSuite performTest:] + 106
13  SenTestingKit                   0x201034a9 -[SenTest run] + 82
14  SenTestingKit                   0x20105e97 +[SenTestProbe runTests:] + 174
15  CoreFoundation                  0x00492d51 +[NSObject performSelector:withObject:] + 65
16  otest                           0x0000231c 0x1000 + 4892
17  otest                           0x000025be 0x1000 + 5566
18  otest                           0x00002203 0x1000 + 4611
19  otest                           0x00001f8d 0x1000 + 3981
20  otest                           0x00001f31 0x1000 + 3889

What am I doing wrong?

UPDATE: I implemented the setter/getter for the property according to the core data tutorial. It still crashes. It never hits a breakpoint in the setter so it is crashing before it even calls the setter. Am I hitting a bug in Apple’s code?

@interface Table : NSManagedObject
{
  int32_t columnValuesAddress;
}
@property (nonatomic) int32_t columnValuesAddress;
@end

@implementation Table

- (int32_t)columnValuesAddress
{
  [self willAccessValueForKey:@"columnValuesAddress"];
  int32_t address = columnValuesAddress;
  [self didAccessValueForKey:@"columnValuesAddress"];
  return address;
}

- (void)setColumnValuesAddress:(int32_t)address
{
  [self willChangeValueForKey:@"columnValuesAddress"];
  columnValuesAddress = address;
  [self didChangeValueForKey:@"columnValuesAddress"];
}

- (void)setNilValueForKey:(NSString *)key
{
  if ([key isEqualToString:@"columnValuesAddress"])
  {
    self.columnValuesAddress = 0;
  }
  else
  {
    [super setNilValueForKey:key];
  }
}

@end
  • 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-08T06:20:06+00:00Added an answer on June 8, 2026 at 6:20 am

    I created a brand new project, created the model again from scratch, and copied over the test code from the old project. This new project works fine. I don’t know why the old project doesn’t work but at least there is a solution.

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

Sidebar

Related Questions

On iOS 4.3 Simulator, the following code returns a very small number: 1e-700 on
I am running following code to create bmp image from pdf using Ghost4j i
I'm getting unexpected output when running following code, DateFormat df = new SimpleDateFormat(YYYY-MM-dd); Date
Running the following code, I get a StackOverflowError at the getPackage() line. How can
Running the following code, I get an exception: using (var client = new Pop3Client())
When running the following code I get no output but I cannot work out
I'm running the following code: new FileSystemXmlApplicationContext(/data/farm/Server/confData/1000004/contex.xml) and it throws java.io.FileNotFoundException: class path resource
When I tried running the following code product([1,2,3],['a','b']) it returned an object of the
I'm running the following code to get a random entry from a dictionary: SELECT
I'm running the following code to update the database according to the data I

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.