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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:09:10+00:00 2026-05-15T23:09:10+00:00

My main problem is storing the data which is not supported by Core Data.

  • 0

My main problem is storing the data which is not supported by Core Data. I already have a CLLocation property stored as a transformable attribute. I think the right approach is to declare a transient coordinate property. I keep getting EXC_BAD_ACCESS errors however.

EDIT:

My current subclass has the following interface:

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@interface Event : NSManagedObject {

}

@property (nonatomic, retain) NSString* title;
@property (nonatomic, retain) NSDate* timeStamp;
@property (nonatomic, retain) CLLocation *location;

@end

So I need to add

@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;

and

- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate;

to conform to the protocol. (setCoordinate is optional, but I need it if I want to have the annotation draggable)

In core data, The location property is transformable. and I use @dynamic in the implementation to generate the accessors. I’m using this property throughout the code, so I don’t want to keep this.

I think the best way to go about it is to define my coordinate property in core data as transient, but I am not definitely doing something wrong with the implementation.

- (CLLocationCoordinate2D)coordinate {
    CLLocationCoordinate2D cor = CLLocationCoordinate2DMake(self.location.coordinate.latitude,
    self.location.coordinate.longitude);
    return cor;
}

- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate {
    CLLocation *newLoc = [[CLLocation alloc] initWithLatitude:newCoordinate.latitude
    longitude:newCoordinate.longitude];
    [self.location release];
    self.location = newLoc;
} 

I’ve tried several ways, but this is the most recent one.

Edit 2:
The EXC_BAD_ACCESS in:

_kvcPropertysPrimitiveSetters
  • 1 1 Answer
  • 2 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-05-15T23:09:11+00:00Added an answer on May 15, 2026 at 11:09 pm

    You can make a NSManagedObject subclass conform to whatever protocol you wish as long as the protocol doesn’t somehow override the context’s management of the instances. MKAnnotation protocol should be perfectly safe.

    Update:

    Your problem is most likely here:

    - (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate {
        CLLocation *newLoc = [[CLLocation alloc] initWithLatitude:newCoordinate.latitude
                                                        longitude:newCoordinate.longitude];
        [self.location release]; //<-- Don't release properties!
        self.location = newLoc;
    }
    

    The generator accessors will handle retention for you. When you release them directly you screw that management up. You’re also leaking newLoc. Try:

    - (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate {
        CLLocation *newLoc = [[CLLocation alloc] initWithLatitude:newCoordinate.latitude
                                                        longitude:newCoordinate.longitude];
        self.location = newLoc;
        [newLoc release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem #include <iostream> #include <stdio.h> #include <string.h> int main (){
The main problem is square-space builds their forms with java-script (YUI). They have are
The main problem I'm having is pulling data from tables, but any other general
I have different objects which is used to store the data from DB in
I have a program which receives data from unmanaged code about 500 to 700
I have console application in which I am doing sqldependency. My problem is when
Possible Duplicate: nullPointerException in multi column list I have following app which fetches data
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
i have a main Activity called Main which has onActivityResult Method. protected void onActivityResult(int
What is the workaround to this problem? class Program { static void Main(string[] args)

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.