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

  • Thread starter ignaciocabero
  • Start date
In summary, the conversation discusses a problem with a function in an iOS game written in Objective-C. The error message "Use of undeclared identifier 'touchesBegan'" is encountered and the individual seeks help in finding a solution. It is suggested that the issue may be with the function name and the individual confirms that changing it to touchesBegin resolves the problem. They express gratitude to the others for their help.
  • #1
ignaciocabero
10
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 alot.
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
 
Technology news on Phys.org
  • #2
I think the function above it is missing a closing brace }
 
  • #3
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.
 
  • #4
I already tried touchesBegin :( I get it to work.
 
  • #5
Thank you guys so much. As a beginner developer, thank you so much
 

What is Objective-C and why is it used in scientific research?

Objective-C is a programming language commonly used in scientific research for its object-oriented approach and ability to work with large datasets. It is used to develop applications and software for data analysis, simulations, and other scientific tasks.

What are some common problems encountered while using Objective-C in scientific research?

Some common problems with Objective-C in scientific research include difficulties with memory management, compatibility issues with other programming languages and libraries, and a steep learning curve for those new to the language.

How can memory management be improved when using Objective-C for scientific research?

Memory management can be improved by using techniques such as Automatic Reference Counting (ARC) and using lightweight data structures. It is also important to regularly test and optimize code to prevent memory leaks.

Can Objective-C be used for parallel programming in scientific research?

Yes, Objective-C can be used for parallel programming in scientific research through the use of libraries such as Grand Central Dispatch and OpenMP. These allow for tasks to be split among multiple CPU cores, improving performance for large datasets and complex calculations.

Are there any alternatives to Objective-C for scientific research?

Yes, there are several alternatives to Objective-C for scientific research, including languages such as Python, R, and Julia. These languages are popular for their ease of use, extensive libraries for data analysis, and strong support for parallel programming.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • Special and General Relativity
5
Replies
144
Views
6K
  • Programming and Computer Science
Replies
8
Views
3K
  • Quantum Interpretations and Foundations
2
Replies
54
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
  • Special and General Relativity
Replies
4
Views
14K
  • Programming and Computer Science
Replies
2
Views
2K
  • Special and General Relativity
Replies
10
Views
3K
  • Special and General Relativity
Replies
3
Views
2K
Back
Top