Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Random Rocks
View Single Post
Old 03-07-2010, 05:20 PM   #70 (permalink)
Batman
iPhone SDK learner
 
Join Date: Feb 2010
Location: Illinois, USA
Posts: 420
Batman is on a distinguished road
Default

Quote:
Originally Posted by smasher View Post
For info on creating your own class, see the sections on "Designing a Class Interface" and "Class Implementation" on this page: Cocoa Dev Central: Learn Objective-C

Whatever book you're using to learn objective-C must have a chapter on that too.

Once you have your own Rock class with a "view" property and whatever variables and properties you need, you can init that class:

Code:
//
newRock= [[Rock alloc] init];
rock.view.center = //whatever
[self.view addSubview: rock.view]; //adds meteors as subviews
[meteorArray addObject: rock.view]; //add to array
The init method for the Rock class can init the UIImageView, set up your other variables, choose a random position, and whatever other setup you need.
i feel completely lost on this whole class thing. i read those parts of the website but it did not say how to access methods in that class.
Batman is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,535
Threads: 94,052
Posts: 402,640
Top Poster: BrianSlick (7,979)
Welcome to our newest member, Chayolei001
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:59 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.