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

  • SEARCH
  • Home
  • 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 7766357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:23:42+00:00 2026-06-01T15:23:42+00:00

this document states that, in order to cooperates with codes written in a MRR(manual

  • 0

this document states that, in order to cooperates with codes written in a MRR(manual retain-release) environment, codes written in an ARC environment cannot have a accessor name that begins with “new”, I can’t figure out why ARC puts this restriction on method naming.

  • 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-06-01T15:23:43+00:00Added an answer on June 1, 2026 at 3:23 pm

    I believe the cause is because of this:

    5.2.1. Semantics of init

    Methods in the init family implicitly consume their self parameter and return a retained object. Neither of these properties can be altered through attributes.

    A call to an init method with a receiver that is either self (possibly parenthesized or casted) or super is called a delegate init call. It is an error for a delegate init call to be made except from an init method, and excluding blocks within such methods.

    As an exception to the usual rule, the variable self is mutable in an init method and has the usual semantics for a __strong variable. However, it is undefined behavior and the program is ill-formed, no diagnostic required, if an init method attempts to use the previous value of self after the completion of a delegate init call. It is conventional, but not required, for an init method to return self.

    It is undefined behavior for a program to cause two or more calls to init methods on the same object, except that each init method invocation may perform at most one delegate init call.

    Source: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#family.semantics.init

    Method names starting with new by convention used to call both the alloc and init methods in the past and I believe there are still methods used in Apple’s framwork with the ‘new’ convention. I guess ARC still takes this into account with regards to memory management.

    Also read up on the following: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#family

    An Objective-C method may fall into a method family, which is a conventional set of behaviors ascribed to it by the Cocoa conventions.

    A method is in a certain method family if:

    • it has a objc_method_family attribute placing it in that family; or if not that,
    • it does not have an objc_method_family attribute placing it in a different or no family, and
    • its selector falls into the corresponding selector family, and
    • its signature obeys the added restrictions of the method family.

    A selector is in a certain selector family if, ignoring any leading underscores, the first component of the selector either consists entirely of the name of the method family or it begins with that name followed by a character other than a lowercase letter. For example, _perform:with: and performWith: would fall into the perform family (if we recognized one), but performing:with would not.

    The families and their added restrictions are:

    • alloc methods must return a retainable object pointer type.
    • copy methods must return a retainable object pointer type.
    • mutableCopy methods must return a retainable object pointer type.
    • new methods must return a retainable object pointer type.
    • init methods must be instance methods and must return an Objective-C pointer type.

    Additionally, a program is ill-formed if it declares or contains a call to an init method whose return type is neither id nor a pointer to a super-class or sub-class of the declaring class (if the method was declared on a class) or the static receiver type of the call (if it was declared on a protocol).

    I guess the above means you could call a method something like newobject instead of newObject to avoid the mechanisms of ARC, but that might not make much sense for anyone working with your code. Perhaps you could also avoid the usual memory rules by setting an attribute on your custom new* method that forces some other method family on the property.

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

Sidebar

Related Questions

Could someone show me a regular expression that would look through this document and
In order to answer this question properly I thought that I would: Convert an
I am going through this document and this is what I gathered. <Esc> Escape
How can I convert this document: <Root> <!-- yes, I know I don't need
If I write this: document.createElement(img) The generated html is: <img> , and I can
This is a longshot but I have a file with something like this: document
I am trying to get rid of this: document.body.className = someclass; I want to
I am using 'git' to checkout chromium code by following this document: http://code.google.com/p/chromium/wiki/UsingGit And
Hai I have An XDocument .All nodes in this document have an attribute UserId.
For example, In this document < ?xml version=1.0 ? > < SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/

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.