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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:39:35+00:00 2026-05-26T18:39:35+00:00

I have a integer named marbles, and am trying to save it into an

  • 0

I have a integer named marbles, and am trying to save it into an array using the following code:

[records setValue:marbles forKey:@"marbles"];

With this code, I get the warning:

warning: Semantic Issue: Incompatible integer to pointer conversion sending ‘int’ to parameter of type ‘id’

So, How do I set the value for an NSInteger.

Next Question, How do re-upload the array into core data? I fetch the array, make changes, and how do I apply those changes back to Core Data?

Thanks

  • 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-26T18:39:36+00:00Added an answer on May 26, 2026 at 6:39 pm

    Initialize an NSNumber (which is what CoreData is expecting) with your integer:

    NSNumber *marbleNumber = [NSNumber numberWithInt:marbles];
    [records setObject:marbleNumber forKey@"marbles"];
    

    Or:

    [records setMarbles:[NSNumber numberWithInt:marbles]];
    

    To persist your changes, you save your context:

    NSError *error;
    [myManagedObjectContext save:&error];
    
    //handle your error
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two maps of type Map<Long, Integer>, one named oldValues representing the old
I have an integer array in my Objective-C program. I'd like to sort it
I have an old client side application that is writing to named pipes using
Let's say you have a table with a integer primary key named 'table_id' Is
I have some picture named like this . (like 2.jpeg, 1234.gif etc.) how can
.i have the following code: $task_id = mysql_query(SELECT MAX(task_id) from it_task); echo $task_id; .what
I have the following code to return multiple values from pl/python: CREATE TYPE named_value
I have the following conversation scoped backing bean: @Named @ConversationScoped public class TestConversation implements
I have a column named 'parent_id' that I am trying to add a default
I have the following model classes declared by SQLAlchemy: class User(Base): id = Column(Integer,

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.