Skip to content
Snippets Groups Projects
Commit 4a589c70 authored by Warren Hunt's avatar Warren Hunt
Browse files

Undoing accidental change to docs/LanguageExtensions.rst in my previous

patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193293 91177308-0d34-0410-b5e6-96231b3b80d8
parent 7967c958
No related branches found
No related tags found
No related merge requests found
...@@ -1181,19 +1181,23 @@ Objective-C requiring a call to ``super`` in an override ...@@ -1181,19 +1181,23 @@ Objective-C requiring a call to ``super`` in an override
-------------------------------------------------------- --------------------------------------------------------
Some Objective-C classes allow a subclass to override a particular method in a Some Objective-C classes allow a subclass to override a particular method in a
parent class but expect that the override chains to calling the same method in parent class but expect that the overriding method also calls the overridden
the parent class. In such cases it is useful to be able to mark a method as method in the parent class. For these cases, we provide an attribute to
requiring this chaining behavior. For these cases, we provide an attribute to designate that a method requires a "call to ``super``" in the overriding
designate that a method requires a "call to ``super``" in the overriden method method in the subclass.
in the subclass.
**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only be placed at the end of a method declaration: **Usage**: ``__attribute__((objc_requires_super))``. This attribute can only
be placed at the end of a method declaration:
.. code-block:: objc .. code-block:: objc
- (void)foo __attribute__((objc_requires_super)); - (void)foo __attribute__((objc_requires_super));
This attribute can only be applied the method declarations within a class, and not a protocol. This attribute can only be applied the method declarations within a class, and
not a protocol. Currently this attribute does not enforce any placement of
where the call occurs in the overriding method (such as in the case of
``-dealloc`` where the call must appear at the end). It checks only that it
exists.
Note that on both OS X and iOS that the Foundation framework provides a Note that on both OS X and iOS that the Foundation framework provides a
convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment