Objective-C app programming problem

In summary, the conversation discusses a problem with missing square brackets in an iOS application written in Objective-C. The code includes a missing closing square bracket and a missing opening brace, which are causing errors. The person suggests learning the basics of Objective-C before continuing with the project.
  • #1
ignaciocabero
10
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
  • #2
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.
 
  • #3
Thanks for the help but nothing worked :(
 
  • #4
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.
 
  • #5


Hello,

It sounds like you are encountering some syntax errors in your Objective-C code. The first problem, "Expected identifier or '( )'", typically means that there is a missing or misplaced parenthesis or curly brace in your code. It could also mean that you are missing a variable or method name.

The second problem, "Missing '@END'", could be caused by a few different things. It could be that you have forgotten to close a method or class with the "@END" keyword, or there could be a typo in the keyword itself.

To troubleshoot these issues, I suggest carefully reviewing your code and checking for any missing or misplaced characters. You may also want to double-check that all of your keywords, such as "@interface" and "@implementation", are spelled correctly and in the correct order.

If you are still having trouble, it may be helpful to ask a colleague or seek assistance from online resources or forums specifically for Objective-C programming. Good luck with your app development!
 

1. What is Objective-C?

Objective-C is a programming language used for developing applications for Apple's iOS and macOS operating systems. It is a high-level, object-oriented language that is based on the C programming language.

2. What are the benefits of using Objective-C for app programming?

Objective-C allows developers to create powerful, efficient, and highly functional apps for Apple devices. It is a well-established language with a large community of developers, making it easy to find resources and support. It also integrates well with other Apple technologies, such as Cocoa and Swift.

3. What kind of apps can be developed using Objective-C?

Objective-C can be used to develop a wide range of apps, from simple mobile games to complex business applications. It is particularly well-suited for developing native iOS and macOS apps, but can also be used for cross-platform development with the help of tools like Xamarin.

4. What are some common challenges faced when programming in Objective-C?

One common challenge when programming in Objective-C is the steep learning curve, especially for those with no previous experience in C or object-oriented programming. Another challenge is the complexity of memory management, which can lead to bugs and crashes if not handled properly. Additionally, Objective-C can be less efficient than other languages, which can affect the performance of apps.

5. How can I get started with Objective-C app programming?

To get started with Objective-C app programming, you will need to have a Mac computer running macOS and Xcode, Apple's integrated development environment. You can then learn the basics of the language through online tutorials and courses, and practice by creating small projects. It is also helpful to join online communities and forums where you can ask for help and learn from other developers.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
16
Views
3K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
3
Replies
75
Views
4K
  • Programming and Computer Science
Replies
1
Views
734
  • Programming and Computer Science
Replies
9
Views
1K
Replies
9
Views
1K
Replies
4
Views
2K
Replies
10
Views
960
Back
Top