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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:57:36+00:00 2026-06-06T07:57:36+00:00

My obj-c class uses a C library (the Chipmunk physics engine), which has an

  • 0

My obj-c class uses a C library (the Chipmunk physics engine), which has an Obj-C wrapper interface.

I want to add a property with a chipmunk type (cpLayers) to my object, like so:

@interface
@property cpLayers layers;
...

The easiest way is to #import “ObjectiveChipmunk.h”, but that seems ridiculous to import all of the headers just to get one measly type.

If I #import the C “chipmunk_types.h” file where cpLayers is defined “typedef unsigned int cpLayers;”, I get compiler errors related to ARC. They are bridge/casting errors in a macro that is defined in chipmunk_types.h and used in my .m file.

If I add just the definition, or #include chipmunk_types.h, I get redefinition errors.

Is there any better way to do this? And WHY the ARC errors?

  • 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-06T07:57:37+00:00Added an answer on June 6, 2026 at 7:57 am

    Take a look at the ObjectiveChipmunk.h, that is where it overrides the basic Chipmunk types using preprocessor defines. You can add those defines as compiler flags if you want to work around the problem, but I wouldn’t really worry about it. You are already doing Objective-C programming after all, have you ever looked at the gargantuan amount of includes that get pulled in when you import something as innocuous as Foundation.h? Importing the full ObjectiveChipmunk.h header is like 1% in comparison.

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

Sidebar

Related Questions

unit Unit7; interface uses Classes; type TListener = class(TThread) procedure Execute; override; end; TMyClass
We've made a library which uses massively (with inheritance) numpy's MaskedArrays. But I want
I have static library and another program which uses it. In the static library
We have a problem using a class template which itself uses function objects in
I have a custom class in Obj-C called RouteManager which contains an array of
I've a class in my .NET 3.5 C# WinForms application which has five methods.
What is the difference between type(obj) and obj.__class__ ? Is there ever a possibility
I have a class defined as: class Obj { public: int width, height; Obj(int
Here's some example code: class Obj attr :c, true def == that p '=='
I know that if I do something like this: class Obj { public: int*

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.