Direct access to objective-C's Isa is deprecated...

Source: Internet
Author: User

Installed xcode 4.6 and now facing with new errors in an existing ent code I manage.

The compiler now complains about "direct access to objective-C's Isa is deprecated in favor of object_setclass () and object_getclass ()" And won't build

CcessingisaHas
Been deprecated for some time, the tools just didn't tell you this. Notably, it's been deprecated for at least as long as tagged pointers have existed in obj-C.

And yes,object_setClass()Is
The appropriate replacement.

That said, why do you even need this? It's extremely rare that replacing the class of an object is appropriate, and the only valid case I can think of is when you're trying to dynamically subclass A class in order to inject new behavior into individual instances
Without modifying the class as a whole (which is, of course, something you probably don't need to do ).

Http://stackoverflow.com/questions/14590637/replacing-self-isa-because-of-xcode-4-6-deprecation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.