1
votes

I just suddenly began getting the following error with the LLVM 3.1 compiler.. Pls help as to how to debug this. Pls let me know if I should post more information for this.

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254

3
cannot be sure about this as the same code was working till yesterday and started giving me errors only just a few mins ago.. I did not make any changes to it. In general what could be the reasons that cause this error - inforeqd
Is that the full error description. Check your frameworks are linked properly. - railwayparade
was able to solve it. I was calling a method on an object where the method did not exist. But don't know why the build gave an error of 254 and not that the method does not exist.. I changed it to the correct name and it worked :-) The error was pretty misleading. - inforeqd

3 Answers

2
votes

I ended up with the same error after I messed up some string handling: Broken:

// 7.30.12 Unspaced/Original - remove windows \r, replace with " " (space) - let textbox wrap
// [mutTempString setstring: [mutTempString stringByReplacingOccurrencesOfString:@"\r" withString:" "]];
// 7.30.12 - Need some 'padding' at the top of the textbox (I copied and pasted above and generated the !code 254 error)
[mutTempString setString:[NSString stringWithFormat:@"\n\n%@", [mutTempString setString:[mutTempString stringByReplacingOccurrencesOfString:@"\r" withString:" "]]]];

I got rid of the 'nested' or 'deep-inline' [mutable setstring...] and everything works again: Fixed:

// 7.30.12 - Need some 'padding' at the top of the textbox (remove the 'inside' setstring)
[mutTempString setString:[NSString stringWithFormat:@"\n\n%@", [mutTempString stringByReplacingOccurrencesOfString:@"\r" withString:" "]]];
1
votes

I also got this error by calling a method that is not in Objective-C

I was using:

NSString *redirectUrl = [NSString stringWithFormat:@"%@%@", @"http", **components[2]**];

and realized that it is a PHP way of accessing values of array.

So I changed it to this:

NSString *redirectUrl = [NSString stringWithFormat:@"%@%@", @"http", [components objectAtIndex:2]];

Now it's working fine :D

0
votes

OK so I just debugged this problem myself and since this is an unanswered post I thought I'd explain how I fixed it.

In my case the error was caused by trying to get the tag of a UIImageView without an assigned tag.

First I tried the obvious solutions: - quit xcode and simulator, reopen, try to build again - restart computer, reopen, try to build again - perform clean (cmd + shift + K). None of these worked so I looked back at the seemingly innocent changes I made in the code.

This caused a crash:

if (!([[buttonsArray objectAtIndex:i] tag] > 299 )) {
   //NSLog(@"removed [buttonsArray removeObjectAtIndex:i]:%@",[buttonsArray removeObjectAtIndex:i]);
   [buttonsArray removeObjectAtIndex:i];
}

This Didnt:

if ([[buttonsArray objectAtIndex:i] class] != [UIButton class] ) {
   //NSLog(@"removed [buttonsArray removeObjectAtIndex:i]:%@",[buttonsArray removeObjectAtIndex:i]);
   [buttonsArray removeObjectAtIndex:i];
}

My array contained 3 UIButtons, each with tag greater than 299 and one UIImageView. An NSLog of the Array shows:

2012-05-10 01:46:14.555 My Application[542:fe03] buttonsArray:(
    "<UIImageView: 0x6b7f940; frame = (0 0; 252 272); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x6b71dc0>>",
    "<UIButton: 0x6b7ae70; frame = (8 8; 53 53); opaque = NO; tag = 300; layer = <CALayer: 0x6b6fb70>>",
    "<UIButton: 0x6b8be00; frame = (69 8; 53 53); opaque = NO; tag = 301; layer = <CALayer: 0x6b8bd70>>",
    "<UIButton: 0x6b8c1b0; frame = (130 8; 53 53); opaque = NO; tag = 302; layer = <CALayer: 0x6b8c140>>"
)

So the problem was that the UIImageView didn't have a tag assigned to it. When I tried to compare its sign to 299, the compiler threw this error. I thought that this would be ok (I read somewhere that unassigned tags default to 0) but I guess not!