Note that there are some explanatory texts on larger screens.

plurals
  1. POPotentially simple Objective C bug with a protocol
    primarykey
    data
    text
    <p>This might be a super simple bug, but my eyes are practically bleeding from trying to hunt it down. At first, I thought ARC might be playing a role, but now its completely disabled, and I'm still getting the bug.</p> <p>I have a UMLLanguageProtocol protocol which defines a static method</p> <pre><code>+(NSArray *)methodFormatComponents; </code></pre> <p>I am trying to call that method within a function, but it is not being recognized by Xcode ("no known class method selector").</p> <p>Here is the code where I am trying to use it:</p> <pre><code>#import "UMLLanguageProtocol.h" @implementation UMLMethod @dynamic documentation; @dynamic name; @dynamic umlClass; +(void)validPortionOfMethod:(NSString *)method inLanguage:(Class&lt;UMLLanguageProtocol&gt;)language { [language methodFormatComponents]; &lt;-- Error: No known class method selector } @end </code></pre> <p>and the protocol itself, defined in UMLLanguageProtocol.h</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #define VISIBILITY_SPECIFIER_COUNT 6 @class UMLMethod; @class UMLAttribute; @class UMLParameter; typedef enum { PUBLIC, PRIVATE, PROTECTED, PACKAGE, DERIVED, STATIC } visibility; @protocol UMLLanguageProtocol /* * Language Specifiers */ +(NSArray *)nativeDataTypes; // Return a 6 item array with YES if the language supports that visibility // specifier at the given index, and no if it doesn't. +(NSArray*)visibilitySpecifiersForVariables; +(NSArray*)visibilitySpecifiersForMethods; /* * Parsing Methods */ // Returns a regex string that defines a validly formatted method +(NSString *)methodFormat; +(NSArray *)methodFormatComponents; @optional +(NSString*)documentationCommentFromText:(NSString*)comment; +(NSString*)scaffoldTextFromMethod:(UMLMethod*)method; +(NSString*)scaffoldTextFromParameter:(UMLParameter *)parameter; +(NSString*)scaffoldTextFromAttribute:(UMLAttribute*)attribute; +(NSArray *)additionalCommonDataTypes; +(NSString *)defaultRootObject; @end </code></pre> <p>Seriously, I'm losing hair as I write this... please help!</p> <hr> <p>UPDATE: Actually, it seems the error is in two parts in the issue navigator. The first part is "Automatic Reference Counting Issue" and the second line is "No known class method for selector". That's odd, what could this possibly have to do with ARC?!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload