1

Possible Duplicate:
What kind of leaks does automatic reference counting in Objective-C not prevent or minimize?

I'm using XCode 4.3.2 and always use ARC as it makes perfect sense to me. I have apps created that build and compile with no issues. I know that the new compiler and the ARC are pretty smart in taking care of the memory management but are there any times when I need to code a release anywhere......anything that has been "init" or "alloc'd" typically?

Thanks,

Gaz.

Community
  • 1
  • 1
Gareth Lloyd
  • 1,621
  • 1
  • 10
  • 7
  • .....I'm also getting confused on whether to use "strong", "weak" and "retain". My code works okay and as I said, compiles with no issues but I don't want to be using an assignment that I don't need!! Can anyone offer a "layman's" explanation????....thanks so much....Gaz. – Gareth Lloyd Apr 04 '12 at 15:16
  • Thanks Brad, I'll take a look now!.....Gaz. – Gareth Lloyd Apr 04 '12 at 17:27

1 Answers1

0

Short answer: No.

Longer answer: Using ARC for your compile will not even allow you to release/retain/autorelease any object. So it shouldn't be a problem as it will throw a build error and won't compile. The other links from your comments should help you out as to when to use strong/weak pointers. You can still use nonatomic, retain/assign when declaring your properties, and they will get converted at compile time for you. So you always have that option as well.

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86
  • That's a real help Bill....many thanks! I was wondering about the "retain" parameter and if it needed to be retain or something different that would deffo be released or destroyed. I'm trying to read up on it now but it's a little boggling! – Gareth Lloyd Apr 05 '12 at 09:30
  • If you are going to use ARC, you don't need to think about retain/release/autorelease anymore. The compiler will do all that for you. That is the best part of using ARC, you just stop thinking about memory. Let me repeat that, STOP THINKING ABOUT MEMORY. Trust me, you'll be happier once you understand that concept. Good luck. – Bill Burgess Apr 08 '12 at 13:38