Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 6, 2012, 05:52 AM   #1
ramy1989
macrumors newbie
 
Join Date: Nov 2012
Problems understanding ARC and zombies

I started learning Cocoa when there still was the manual counting, but after few time I got the new OS update and ARC was available.
I know how to user retain-release if I don't use ARC, but the problem comes with ARC enabled.I always used strong references and everything was fine, never had leaks nor dangling pointers.
But I want to understand better how it works.

Now I am running a project for debugging, with zombies enabled.I tried do do this:
Code:
    __unsafe_unretained NSString* str;
    @autoreleasepool
    {
        str= @"Hello";
    }
    NSLog(@"%@",str);
I would except that str is zombie because @"Hello" should be autoreleased, and I print it outside the pool.But instead it just prints "Hello" and all goes fine.Why?

Also a tip, should I start making some projects with manual counting to understand how ARC works?
ramy1989 is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump


All times are GMT -5. The time now is 11:21 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC