This code worked in X-Code 4.6 but fails in X-Code 5:
NSMutableArray *a = [[NSMutableArray alloc] initWithCapacity:4];
for (int k=0; k<4; k++) {
int e = arc4random_uniform(3)+1;
if (arc4random_uniform(2)>0) {
e *= -1;
}
[a addObject:[NSNumber numberWithInt:e]];
}
if (i>0) {
int l = [arrayPieces count]-pieceNumber;
int e = [[[[arrayPieces objectAtIndex:l] edges] objectAtIndex:1] intValue]; //CAUSES ERROR
[a replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:-e]];
}
if (j>0) {
int e = [[[[arrayPieces lastObject] edges] objectAtIndex:2] intValue];//CAUSES ERROR
[a replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:-e]];
}
I also get the following error associated to the same code:
Bad receiver type 'UIRectEdge' (aka 'enum UIRectEdge')
...but I have no reference to 'UIRectEdge' in my project.
I've searched for similar cases of these errors but nothing seemed close enough to fix the issue that I was able to try.
Any help would be much appreciated.
Thank you.
Seems like the same problem as in this Bad receiver type UIRectEdge and Multiple methods named
I guess your project is also originally from https://github.com/AndreaBarbon/Puzzle-iOS
What I did to get it running in Xcode 5.0.2 was to search the whole project for "edges" and replace every instance with "my_edges" (without quotes) and then it worked.
The problem is that "edges" has been added to the uikit in Xcode5/iOS7, that is why you get the error.