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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:14:47+00:00 2026-06-01T20:14:47+00:00

I am writing an Objective-C program that deals with low level image memory. I

  • 0

I am writing an Objective-C program that deals with low level image memory. I am using ANSI-C structs for my data storage — Full blown objects seem overkill seeing as the data I am storing is 100% data, with no methods to operate on that data. Specifically, I am writing a customizable posterization algorithm which relies on an array of colors — This is where things get tricky. I am storing my colors as structs of three floats, and an integer flag (related to the posterization algorithm specifically). Everyhting is going well, except for one thing…

[actual question]

I can’t figure out how to add pointers to an NSMutableArray! I know how to add an object, but adding a pointer to a struct seems to be more difficult — I do not want NSMutableArray dereferencing my pointer and treating the struct as some sort of strange object. I want NSMutableArray to add the pointer its self to its collection. How do I go about doing this?

Thanks in advance,

G

  • 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-01T20:14:48+00:00Added an answer on June 1, 2026 at 8:14 pm

    There’s a class designed precisely for this: NSPointerArray. See Apple’s docs here. For arbitrary pointers, you’ll probably want to use the NSPointerFunctionsOpaqueMemory and NSPointerFunctionsOpaquePersonality options.

    If NSPointerArray is not available (for example, if you’re developing for iOS), then you could wrap your pointers using -[NSValue valueWithPointer:], as long as the overhead of wrapping & unwrapping doesn’t prove too slow.

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

Sidebar

Related Questions

I'm writing a program that calculates the Jacobi algorithm. It's written in Objective-C since
I’m writing an objective-c program that does some calculations based on time and will
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I am writing an Objective-C program that utilizes the garbage collector. I am getting
I am writing an objective-c model to hold all of the data parsed from
I'm writing an iPhone game in objective-C using XCode. I'd like to profile the
I'm writing a Cocoa app in Objective C that's communicating with a webservice and
I am writing a simple console application in Objective-C but I have heard that
I was recently writing a program in Objective-C and I tried the wrote the
I am writing a program in Objective-C and I need to make web requests

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.