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 > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Requests

Reply
 
LinkBack Thread Tools Display Modes
Old 10-15-2011, 05:25 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Location: UK
Posts: 82
TTStu is on a distinguished road
Default ARC - Automatic Reference Counting - iOS 5 + 4

Woah, this iOS 5 thing keeps getting more and more hectic.

I think the best way forward for new apps (and reworked apps ahem) is to use ARC.

But what are the main points to consider?

Anyone got any resources or a checklist on making arc-enabled apps that are compatible with iOS4 devices also?

For instance, I understand that the compiler adds iOS4 "glue code" to maintain backwards compatibility, and it is possible to switch off ARC on a per file basis, but what about dealloc methods for example?

I often use dealloc to set a delegate to nil. So I guess that'll still have to be done? What about instance variables? Do they get released here? I guess not... so what happens first... the ARC release or the setting of a delegate to nil... erm, I hope I explained myself correctly...

Surely this is all documented somewhere already?
TTStu is offline   Reply With Quote
Old 10-15-2011, 05:46 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2011
Location: UK
Posts: 82
TTStu is on a distinguished road
Default

Hmmm, found this:

Quote:
Do I still need to write dealloc methods for my objects?

Maybe.

Because ARC does not automate malloc/free, management of the lifetime of Core Foundation objects, file descriptors, and so on, you still free such resources by writing a dealloc method.

You do not have to (indeed cannot) release instance variables, but you may need to invoke [self setDelegate:nil] on system classes and other code that isn’t compiled using ARC.

dealloc methods in ARC do not require—or allow—a call to [super dealloc]; the chaining to super is handled and enforced by the runtime.
Here:

Loading…


Still doesn't exactly enhance my understanding, nor does it instill confidence in me...

"but you may need to invoke [self setDelegate:nil] on system classes and other code that isn’t compiled using ARC."

MAY need to... how the **** do I know?

Grrr
TTStu is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,696
Threads: 94,139
Posts: 402,963
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:15 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0