Ok, i made a small application with a small ball bouncing on the screen. That was esay.
Now i’d like to have more than one ball… so i think the best way is to create a new class : the ball.
How can i do it?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
encapsulate the information about the ball from your first app into variables, and create methods for any actions you think the ball performs. This sounds a lot like an object-oriented design problem..perhaps you should take a look at an Object Oriented Programming guide, such as this one OOP Guide
but if you are asking how to create a custom object class..
put this in your Ball.h:
then in your .m file: