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

View Single Post
Old 12-17-2009, 02:41 PM   #11 (permalink)
BrianSlick
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,978
BrianSlick has a spectacular aura about
Default

Quote:
Originally Posted by benoitr007 View Post
Sorry, what do you mean? All these arrays are already properties, but this is in the init method, so we said it was okay that way, didn't we? And just by curiosity, why do you recommend making them properties for that short piece of code? Do you usually make all of your instance variables properties?
Oh, I didn't realize we were still talking about the init method. Sorry.

Is there a reason that you make instance variables for the enemiesLayer1, 2, etc? If you are releasing them right away, then those instance variables don't seem to be necessary. They could be local variables. If you intend to access them again later (not via the main array, I mean), then don't release them.

And yes, I do make properties for all of my instance variables. Using instance variables directly is just begging for memory problems.

Quote:
Originally Posted by benoitr007 View Post
Finally, another quick question: using the objectAtIndex: method for an array doesn't copy it or do anything to the retain count? So it's perfectly fine to do currentArray = [objectsArrays objectAtIndex:i]; every step?
Correct.
__________________
BriTer Ideas LLC - Code review, consulting, development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is online now   Reply With Quote
 

» Advertisements
» Online Users: 691
20 members and 671 guests
.Snipe, @sandris, ADY, Alex40, baja_yu, BrianSlick, doffing81, flamingliquid, givensur, headkaze, iShailesh, mediaspree, Paul Slocum, PixelEnvision, sacha1996, SLIC, Touchmint, waghman, WallStreetVH, Xaphann
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,415
Threads: 94,015
Posts: 402,527
Top Poster: BrianSlick (7,978)
Welcome to our newest member, deannme48
Powered by vBadvanced CMPS v3.1.0

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