I have started a very simple project to learn iOS programming, but I get EXC_BAD_ACCESS after touchesBegan.
You can download the project from DropBox here .
I basically have a UIView subclass that should draw circles wherever the user is touching.
Very simple but I cannot make it work.
Any help is highly appreciated.
Thanks!
EDIT
Turns out the problem is this line of code in touchesBegan:
ts = [NSMutableSet setWithSet: [event touchesForView:self]];
That I changed into:
ts = [[NSMutableSet setWithSet: [event touchesForView:self]] retain];
Why don’t you use ARC??? 🙂 Its good! You do not retain your
tsset. Note, thatsetWithSet:returns you autoreleased instance. (The red circle looks promising :))