Exc_bad_access


#1

i have followed the instructions in the book very closely but still cant figure out why i am getting this error when i run the program

NSString *randomName = [NSString stringWithFormat:@"%@ %@",
[randomAdjectiveList objectAtIndex:adjectiveIndex],
[randomNounList objectAtIndex:nounIndex]]; <<<<< i receive Thread 1: Program received signal: “EXC_BAD_ACCESS”.
for this line of code. i cant figure out what i did wrong or where my error is at. im using Xcode 4.2 on Lion 10.7.2


#2

Hi,

Can’t see anything wrong with that line.

Could you post the rest of + (id)randomPossession

Gareth


#3

i updated the code to unsigned long int and it fixed it and compiled