Why Does Use of Undeclared Identifier 'touchesBegan' Error Occur in Objective-C?

  • Thread starter Thread starter ignaciocabero
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 2K views
ignaciocabero
Messages
10
Reaction score
0
Hello, I am making an iOS game, written in Objective-C, but I have recently encountered a problem. If you can help me, I would appreciate it a lot.
ImageUploadedByPhysics Forums1408081969.744984.jpg
If it's hard to read, it say
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {The problem says
"Use of undeclared identifier 'touchesBegan'"

Thank you,
Ignacio Cabero
 
Physics news on Phys.org
I think the function above it is missing a closing brace }
 
willem2 said:
I think the function above it is missing a closing brace }

I don't think that's it. I see the closing brace in the thumbnail.

Could it be that you have the wrong function name? Should it be touchesBegin instead? Check the iOS or other appropriate documentation to make sure you're using the correct function names.
 
I already tried touchesBegin :( I get it to work.
 
Thank you guys so much. As a beginner developer, thank you so much