P. 1
The Objective-C Programming Language - Book

The Objective-C Programming Language - Book


|Views: 689|Likes:
Published by Nikunj Soni

More info:

Published by: Nikunj Soni on Dec 01, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF or read online from Scribd
See more
See less


To break an association, you typically useobjc_setAssociatedObject, passingnil as the value.

Continuing the example shown in Listing 7-1 (page 83), you could break the association between the array
and the stringoverview using the following line of code:

objc_setAssociatedObject(array, &overviewKey, nil, OBJC_ASSOCIATION_ASSIGN);

(Given that the associated object is being set tonil, the policy isn’t actually important.)

you are discouraged from using this since this breaks all associations for all clients. You only use this function
if you need to restore an object to “pristine condition.”

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->