Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective-C getValue
    text
    copied!<p>I have defined a class, POI.h: </p> <pre><code>@interface POI : NSObject </code></pre> <p>which is just a simple class that that has certain properties and a method defined as follows:</p> <pre><code>- (NSString *) getValue:(NSString *)key; </code></pre> <p>In my controller, when I try to log invocation of that method:</p> <pre><code> NSLog(@"Name: %@", [poi getValue:@"name"]); </code></pre> <p>I get</p> <blockquote> <p>Apple LLVM compiler 4.2 error Command<br> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang<br> failed with exit code <strong>254</strong></p> </blockquote> <p>Based on some previous SO answers, I figured out that error 254 when trying to log a return value from a void method. So I came to conclusion that the method my compiler is trying to invoke is actually</p> <pre><code>- (void)getValue:(void *)value; </code></pre> <p>defined in <code>NSValue.h</code>, which is of void type.</p> <p>Now, I would really like to understand WHY this happens. Is my improper and foolish naming of the getValue method the only reason? How can I avoid it?</p> <p>Actual error message:</p> <blockquote> <p>LBSViewController.mm</p> <ol> <li> parser at end of file</li> <li>Code generation</li> <li>Running pass 'Function Pass Manager' on module '/Users/myuser/Documents/workspace/project1/Classes/LBSViewController.mm'.</li> <li>Running pass 'ARM Instruction Selection' on function '<code>@"\01-[LBSViewController initializeLBS]"</code>'</li> </ol> <p>clang: error: unable to execute command: Segmentation fault: 11<br> clang: error: clang frontend command failed due to signal (use -v to see invocation)<br> Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)<br> Target: arm-apple-darwin12.5.0<br> Thread model: posix<br> clang: note: diagnostic msg: PLEASE submit a bug report to <a href="http://developer.apple.com/bugreporter/" rel="nofollow">http://developer.apple.com/bugreporter/</a> and include the crash backtrace, preprocessed source, and associated run script.<br> clang: note: diagnostic msg: </p> <hr> <p>PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br> Preprocessed source(s) and associated run script(s) are located at:<br> clang: note: diagnostic msg: /var/folders/y_/h89vdcjj7zs8s5zjh77x4h0h0000gn/T/LBSViewController-A4zhXy.mm<br> clang: note: diagnostic msg: /var/folders/y_/h89vdcjj7zs8s5zjh77x4h0h0000gn/T/LBSViewController-A4zhXy.sh<br> clang: note: diagnostic msg:</p> </blockquote>
 

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