Objective-C app programming problem

  • Thread starter Thread starter ignaciocabero
  • Start date Start date
  • Tags Tags
    App Programming
Click For Summary

Discussion Overview

The discussion revolves around programming issues encountered while developing an iOS application in Objective-C. Participants address specific error messages related to code syntax and structure, seeking assistance in troubleshooting these problems.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports encountering errors: "Expected identifier or '('" and "Missing '@end'" despite having '@end' in their code.
  • Another participant suggests that there may be missing closing square brackets in the code, which could be causing the errors.
  • A third participant expresses frustration that previous suggestions did not resolve the issues.
  • One participant requests that the original poster share their code as text instead of a screenshot to provide better context for troubleshooting.
  • This participant also notes that there are missing square brackets in the reported lines and questions whether certain lines of code are correctly placed within function definitions.
  • They advise the original poster to take time to learn the basics of Objective-C, particularly regarding function definitions and the use of square brackets.

Areas of Agreement / Disagreement

Participants express differing views on the root causes of the errors, with some focusing on syntax issues while others suggest a lack of understanding of fundamental concepts in Objective-C. No consensus is reached on a specific solution to the problems presented.

Contextual Notes

There are indications of missing context due to the format of the code shared (screenshot vs. text), which may limit the ability to diagnose the issues accurately. Additionally, there are unresolved questions about the structure of the code and the placement of certain lines within function definitions.

ignaciocabero
Messages
10
Reaction score
0
So I'm currently developing a simple iOS Application, written in Objective-C, and I recently came across this problem.
ImageUploadedByPhysics Forums1408389074.010883.jpg
the first problem says "Expected identifier or '( '"
The second problem says "Missing '@end'" even though '@end' is clearly there. Any help would be great.
 
Technology news on Phys.org
Are you missing a closing square bracket after the string and before the semicolon?

The next line is also missing a closing square bracket too.
 
Thanks for the help but nothing worked :(
 
Please do us a favor and post your code as text rather than as a screen shot. With a screen shot we can't see anything beyond what you have copied, so we don't get what might be important context. For example, the line that says [hero.addChild : rightEye;] has a right brace just below it, but we can't see the opening brace.

As jedishrfu already noted, there are missing square brackets in the first line that shows an error as well as the line following it. Several of your other posts have exhibited the same problem.

The line of code that starts with ICHeroClass.name = [@"hero"; looks to me like it should be part of the definition of some function, but is not part of any function that I can see. That is a problem. Another clue is the line that says return hero.

My advice to you would be to put your project on hold for a while and invest some time in the basics of Objective-C. Until you get comfortable with the basic ideas such as how to write the header and definition of a function (and the purpose for the square brackets), you will be beating your head against a brick wall trying to get your code to work.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
998
  • · Replies 16 ·
Replies
16
Views
2K
Replies
4
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
6K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
81
Views
7K
  • · Replies 14 ·
Replies
14
Views
35K