iOS Noobie ARC Question

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,224
123
so with ARC, basically i don't have to type in [whatever release]; after every pointer?


just to make sure i understood it correctly



edit: what about retain? because I've read that retain isn't necessary also, so what would be put in the header when u identify the method?


for example, is it implying i don't need the retain? if not what would i put in place of it?


Code:
@interface FirstViewController : UIViewController
{
     IBOutlet UILabel *onHand;
}

@property (nonatomic, retain) UILabel *onHand;

@end
 
Last edited:

jaikob

macrumors 6502
Jul 1, 2008
429
0
Freeland, MI
You still keep retain, it's just the compiler that takes care of the rest. Otherwise the compiler wouldn't know to retain it, and when to release the memory.

Your header files should remain largely untouched.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,703
4,328
Are there any really clear tutorials/videos on how to use ARC that anyone would recommend?
 

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,224
123
Are there any really clear tutorials/videos on how to use ARC that anyone would recommend?
isn't it just not typing in release and such things like that?



it seems like it does more from reading your question? what more does it do?


edit: and what about strong? i heard its the replacement for retain in ARC apps, if i were to convert my app to ARC would i have to change my "retains" to "strong" ? because it worked perfectly fine with retain.
 

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,224
123
no, i haven't thank you, i read it and i think its basically saying retain is replaced with strong and weak.



im reluctant to look at documentation because i still can't read/understand it yet.

but it does make more sense than it did 3 months ago lol. as I'm going through another iOS book, its more understandable, the first book i went through i didn't know what i was reading.

grasping the whole concept and terminology seems pretty tedious.
 

MattInOz

macrumors 68030
Jan 19, 2006
2,760
0
Sydney
no, i haven't thank you, i read it and i think its basically saying retain is replaced with strong and weak.

im reluctant to look at documentation because i still can't read/understand it yet.
All I can say is Don't delay reading the documentation. Even if you get to the end of part and only bits made sense, your still better off. At least then the ideas are in your mind and starting to gel. There is nothing to say you can only read it once. It helps to read it a many, many times. Different things will make sense in different contexts. Try cherry picking bits that seem interesting and the it'll lead you towards the next bit of interest.
 

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,224
123
All I can say is Don't delay reading the documentation. Even if you get to the end of part and only bits made sense, your still better off. At least then the ideas are in your mind and starting to gel. There is nothing to say you can only read it once. It helps to read it a many, many times. Different things will make sense in different contexts. Try cherry picking bits that seem interesting and the it'll lead you towards the next bit of interest.
thanks, for the advice, yea I've been rushing chapters and such also in the beginning and it wasn't too great.

i realized i have to spend a lot of time on each and practice and experiment to grasp everything. I'm just really impatient i just wished everything just made sense the first time and it gels in the first time around
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
450
The Centennial State
Don't rush! It's not helping you and, therefore, it's not helping us (provide you help). Slow down; you'll be glad you did in the long run.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.