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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:57:31+00:00 2026-06-02T04:57:31+00:00

A game on iOS is using this: there is a metal ball, and the

  • 0

A game on iOS is using this: there is a metal ball, and the ballRect is a property of the Model class, but the corresponding ball which is a UIImageView object, is a property of the ViewController class.

Can this design be made so that both ballRect and ball are properties of the Model class? In other game sample, I see only 2 properties of the ViewController class: the model object and a timer object. That’s it. I wonder why this time, there are extra properties that become the ViewController class and should they go to the Model class?

  • 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-02T04:57:35+00:00Added an answer on June 2, 2026 at 4:57 am

    It would make more sense to make a BallView that holds a pointer to a Ball (Model) and hosts an image view that shows the ball sprite. The BallView should observe the Ball’s ballRect, and when that changes, update its (the BallView’s) frame to match.

    This arrangement would let you add other, similar relationships. For example, if there are different kinds of balls and a ball can change from one kind to another (e.g., for a temporary power-up), the BallView can observe the Ball’s kind and change the image view’s image whenever the Ball’s kind changes.

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

Sidebar

Related Questions

my problem is: I'm making a game for iOS using cocos2d and this game
I'm writing an iOS game (Using UIView), which has a randomly generated 2D city.
I have been developing a simple game for iOS which involves dragging and using
I'm considering this design pattern for a simple iOS tic-tac-toe game: GameState singleton class
My cocos2d iOS game code compiles and runs without error in Xcode 4.2.1 but
I'm creating a game for the iPad using Phonegap, which means I'm using JavaScript/
I'm currently working on a new game for iOS using Cocos2D. The game needs
I am doing iOS game development using the cocos2d framework, and I tremendously envy
I'm working on a multiplatform game (PC/iOS/Android) and was looking into using Facebook as
I'm making a game using cocos2d for iOS. When the main gameplay layer constructor

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.