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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:16:42+00:00 2026-06-15T00:16:42+00:00

I have a array which I fill with values from checkboxes, sliders and an

  • 0

I have a array which I fill with values from checkboxes, sliders and an NSTextField.
See below 001. And it´s working obviously.

However, when analyzing my code I get this message:

/Users/ronny/DEV/0200-ObjC4/Egg&Breakfast/Classes/TimeController.m:358:24:
Argument to 'NSArray' method 'arrayWithObjects:'
should be an Objective-C pointer type, not 'NSInteger'

I tried several things like type casting the three lines with intValue to (NSInteger). Without success. Any idea what´s wrong?

NSArray *myValues = [NSArray arrayWithObjects:
                    [isAppointment state],     //Checkbox
                    [boxForEver    state],     //Checkbox
                    [boxMakeSound  state],     //Checkbox
                    [tickTackFlag  state],     //Checkbox
                    [txtRemark   stringValue], //NSTextField
                    [slideHour      intValue], //Slider
                    [slideMin       intValue], //Slider
                    [slideSec       intValue], //Slider
                    [startAuto     state],     //Checkbox
                    nil];
  • 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-15T00:16:44+00:00Added an answer on June 15, 2026 at 12:16 am

    All of the lines that call state or intValue are incorrect.

    An NSArray can only hold references to Objective-C objects. But state and intValue return NSInteger, which is a typedef (alias) for long, which is C primitive, not an Objective-C object reference.

    You need to wrap the integers in NSNumber objects. If you’re using Xcode 4.4 or later, you can just use the new @(...) wrapper syntax to wrap your integers in NSNumber objects. You can also use the new array literal syntax @[...] to construct your array.

    NSArray *myValues = @[
                        @([isAppointment state]),     //Checkbox
                        @([boxForEver    state]),     //Checkbox
                        @([boxMakeSound  state]),     //Checkbox
                        @([tickTackFlag  state]),     //Checkbox
                        [txtRemark   stringValue], //NSTextField
                        @([slideHour      intValue]), //Slider
                        @([slideMin       intValue]), //Slider
                        @([slideSec       intValue]), //Slider
                        @([startAuto     state]),     //Checkbox
                        ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a three dimensional array which I want to fill in with values
I have an array which has many values in it . I just wanted
I have an array which i would like to sort it based on values
I have an array which i would like to sort it based on values
I am trying to fill an array/list with values from a time subtraction. I
I have an array which looks like this: $arr = ( [0]=>Int(2) [1]=>Array( ....)
I have an array which looks like this: $data = array( array('timestamp' => 1312776000,
I have an array which I want to use in a query: Array (
I have an array which contains 12 numbers and I want to save this
I have an array which contains a set of UIImage in byte forms. --My

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.