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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:55:18+00:00 2026-06-11T05:55:18+00:00

I have an objective c class A that owns a c++ class B that

  • 0

I have an objective c class A that owns a c++ class B that has a velocity attribute.

Is it ok to use

@property(nonatomic) float velocity;

in class A even if that class does not have an velocity attribute. When I implement the
velocity function I will ask B and return that value, so it’s kind of an implicit attribute of class A.

I guess it works, so my question is if it is good practice.

  • 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-11T05:55:19+00:00Added an answer on June 11, 2026 at 5:55 am

    Absolutely fine. Assuming that you have implemented the getter and setter correctly there is no requirement that a class with a property have a member variable at all!

    Though you might run into problems with KVO – this property isn’t KVO compliant. That’s almost certainly not a problem though 🙂

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

Sidebar

Related Questions

I have an Objective-C class with the following property: @property (nonatomic, copy) NSString *myString;
I have a C++ helper class that I use with objective-C. I would like
I have a C++ class that I would like to use in my Objective-C
If subclass in objective-c wants to override a super class's method, does it have
I have some Objective-C code that looks like this: #define myVar 10 float f
I have a class that contains multiple user objects and as such has an
I have an Objective-C class that looks something like: @interface myClass : NSObject {
I have an Objective-c class MyClass. In MyClass.m I have a class extension that
Suppose I have Objective C interface SomeClass which has a class method called someMethod
I have an Objective-C class that implements NSCoding. I need to return a representation

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.