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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:59:13+00:00 2026-05-28T13:59:13+00:00

I decided to create a Vector Class for my app in strict objective-C. The

  • 0

I decided to create a Vector Class for my app in strict objective-C. The way i thought this could happen is to create a Point2D class first holding each point in a (x,y) format and then create a Vector2D class holding 2 points.

Where the whole thing got stuck is in my Vector2D class. Im trying to find a way to hold 2 objects (actually 2 x Point2D objects) in an instance variable in my Vector2D class.
I thought of an NSMutableArray but i recall many problems in this situation, plus im not sure is the most efficient solution since im dealing with floats.

What i would like is some sort of guidance through a Vector class for objective-c or your tips/recommendations on my “quest”.
How would you choose to do such a thing and also what would require extra attention.

  • 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-28T13:59:14+00:00Added an answer on May 28, 2026 at 1:59 pm

    C array of fixed size (2 in your case) should be perfectly acceptable in your situation. Since your vector does not grow dynamically, I think this should work just fine:

    @interface Vector2D : NSObject {
        Point2D *points[2];
    }
    // Properties and methods
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've decided to take the advice in this question: create-excel-chart-programmatically-in-php and NOT attempt to
First some background: The company I work for have decided to create an iPhone
First I decided to create one Interface called it IDataAccessLayer and started putting everything
I've started programming on Mac OS X in Objective-C and decided to create a
This is related to this: Solr powered Tag Cloud However i decided to create
I had and app on heroku then I decided to create another app (on
I decided to create a currency converter in Java, and have it so that
I have to develop a customized tab control and decided to create it with
I'm working on a new project and for some reason decided to create two
Thinking about my other problem , i decided I can't even create a regular

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.