== Why is this an issue?

C-style definitions should not be made inside Objective-C structures such as ``++@interface++``s. Doing so appears to limit their scope to the interface, but in fact, it imposes no such restriction. Such symbols are available globally, and may result in future confusion. Instead, such definitions should be moved to the top level, to make it clear that they're globally available.


=== Noncompliant code example

[source,cpp]
----
@interface Example : NSObject
typedef int T; // Noncompliant - defines type, which is visible outside of @interface
void fun(); // Noncompliant - declares global function
@end
----


=== Compliant solution

[source,cpp]
----
typedef int T;
void fun();

@interface Example : NSObject
@end
----



ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Move this "x" out of "y".


=== Highlighting

Entire line for single-line declarations

First line for multi-line declarations, such as structs.


'''
== Comments And Links
(visible only on this page)

=== on 29 Jan 2016, 12:53:08 Alban Auzeill wrote:
I removed "int v;" from examples because it compiles only with gcc and not Xcode or clang.

endif::env-github,rspecator-view[]
