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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:11:31+00:00 2026-05-31T23:11:31+00:00

I have a little problem, probably easy for you. Im using Core Data. I

  • 0

I have a little problem, probably easy for you. Im using Core Data. I have an entity: Session, which have three attributes: access_token, user_id and secret.

Session.h:

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

@interface Session : NSManagedObject

@property (nonatomic) NSString * access_token;
@property (nonatomic) NSNumber * user_id;
@property (nonatomic) NSString * secret;

@end

Session.m:

#import "Session.h"

@implementation Session

@dynamic access_token;
@dynamic user_id;
@dynamic secret;

@end 

There is a code, where im using this entity:

AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
    Session *newSession = [NSEntityDescription insertNewObjectForEntityForName:@"Session" inManagedObjectContext:managedObjectContext];
    if (newSession != nil) {
        NSLog(@"access_token: %@", [JSON objectForKey:@"access_token"]);
        NSLog(@"user_id: %@", [JSON objectForKey:@"user_id"]);
        NSLog(@"secret: %@", [JSON objectForKey:@"secret"]);
        newSession.access_token = [JSON objectForKey:@"access_token"];
        newSession.user_id = [JSON objectForKey:@"user_id"];
        newSession.secret = [JSON objectForKey:@"secret"];
    }
    NSError *savingError = nil;
    if ([managedObjectContext save:&savingError] == YES) {
        NSLog(@"Session saved");
    } else {
        NSLog(@"Session not saved");
    }
} failure:nil];

This code make an exception:

newSession.secret = [JSON objectForKey:@"secret"];

MyProject[7678:bc03] -[Session setSecret:]: unrecognized selector sent to instance 0x4e572d0

This is NSLog:

2012-03-25 15:17:33.987 MyProject[7730:bc03] access_token: <some_access_token>
2012-03-25 15:17:33.988 MyPriject[7730:bc03] user_id: <some_user_id>
2012-03-25 15:17:33.989 MyProject[7730:bc03] secret: <some_secret>

This is stack trace:

*** Call stack at first throw:
(
0   CoreFoundation                      0x010625a9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x013e6313 objc_exception_throw + 44
2   CoreFoundation                      0x010640bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3   CoreFoundation                      0x00fd3966 ___forwarding___ + 966
4   CoreFoundation                      0x00fd3522 _CF_forwarding_prep_0 + 50
5   MyProject                           0x00004c94 __42-[APIWrapper authWithLogin:andPassword:]_block_invoke_0 + 836
6   MyProject                           0x0000d452 __74+[AFJSONRequestOperation JSONRequestOperationWithRequest:success:failure:]_block_invoke_0 + 146
7   MyProject                           0x0000e229 __block_global_3 + 41
8   libdispatch_sim.dylib               0x014de289 _dispatch_call_block_and_release + 16
9   libdispatch_sim.dylib               0x014e1833 _dispatch_main_queue_callback_4CF + 312
10  CoreFoundation                      0x00fa1589 __CFRunLoopRun + 2521
11  CoreFoundation                      0x00fa0840 CFRunLoopRunSpecific + 208
12  CoreFoundation                      0x00fa0761 CFRunLoopRunInMode + 97
13  GraphicsServices                    0x0153a1c4 GSEventRunModal + 217
14  GraphicsServices                    0x0153a289 GSEventRun + 115
15  UIKit                               0x000ebc93 UIApplicationMain + 1160
16  MyProject                           0x0001b305 main + 181
17  MyProject                           0x000020d5 start + 53
)

Im really dont understand what’s problem here.

  • 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-05-31T23:11:32+00:00Added an answer on May 31, 2026 at 11:11 pm

    In your .h file define your properties like this.

    @property (nonatomic,retain) NSString * access_token;
    @property (nonatomic,retain) NSNumber * user_id;
    @property (nonatomic,retain) NSString * secret;
    

    And then in your .m file

    @synthesize access_token;
    @synthesize user_id;
    @synthesize secret;
    

    Basically this manages your getters and setters.

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

Sidebar

Related Questions

I have a little problem with a query. I'm selecting data using the between
I have this little problem, that I cannot figure out which arguments to pass
I have a little problem about using jQuery (I really do not know jQuery
I have a little problem, i probably included the class files wrongly, since i
I have little problem with a replacement of a little part in an url.
I have little problem in regular expressin creation. Expected input: blahblahblah, blahblahblah, 'blahblahblah', blahblahblah,
I have a little problem with a simple vbScript. The script has to run
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,
I have a little problem where I would like to insert a svn diff
I have a little problem, I have an array and I want to add

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.