Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7447831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:54:01+00:00 2026-05-29T12:54:01+00:00

Maybe it’s useful if calling a method that MyClass doesn’t understand on a something

  • 0

Maybe it’s useful if calling a method that MyClass doesn’t understand on a something typed MyClass is an error rather than a warning since it’s probably either a mistake or going to cause mistakes in the future…

However, why is this error specific to ARC? ARC decides what it needs to retain/release/autorelease based on the cocoa memory management conventions, which would suggest that knowing the selector’s name is enough. So it makes sense that there are problems with passing a SEL variable to performSelector:, as it’s not known at compile-time whether the selector is an init/copy/new method or not. But why does seeing this in a class interface or not make any difference?

Am I missing something about how ARC works, or are the clang warnings just being a bit inconsistent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:54:10+00:00Added an answer on May 29, 2026 at 12:54 pm

    ARC decides what it needs to retain/release/autorelease based on the cocoa memory management conventions, which would suggest that knowing the selector’s name is enough.

    This is just one way that ARC determines memory management. ARC can also determine memory management via attributes. For example, you can declare any typedef retainable using __attribute__((NSObject)) (never, ever do this, but it’s legal). You can also use other attributes like __attribute((ns_returns_retained)) and several others to override naming conventions (these are things you might reasonably do if you couldn’t fix the naming; but it’s much better to fix the naming).

    Now, imagine a case where you failed to include the header file that declares these attributes in some files but not others. Now, some compile units (.m files) memory manage it one way and some memory manage it another. Hijinks ensure. This is much, much worse than the situation without ARC, and the resulting bugs would be mindbending because some ARC code would do one thing and other ARC code would do something different.

    So, yeah, don’t do that. (Of course you should never ignore warnings in Objective-C anyway, but this is a particularly nasty situation.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe that's only possible with SQLITE but is there also a trick to let
maybe you could help me understand why I get an unhandled exception Invalid XAML
Maybe someone that has experience with the Jquery Add to Calendar Widget (https://github.com/tardate/jquery.addtocalendar) can
maybe I am being stooped... but the fact is that I am a bit
Maybe I am just forgetting something, but I cannot seem to get NUnit to
Maybe I'm having a brain fart or something because it seems like this should
Maybe it's just me, but I cannot understand the documentation regarding Junit test integration
Maybe I don't understand real purpose of asp mvc routing. I created an application
Maybe this is gonna sound naive and all, but is there something even remotely
Maybe I'm missing something but why does visual studio break execution to tell me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.