Objective-C – Expected identifier error driving me crazy
-
I'm getting an expected identifier error when I try to compile my code. careerURL is setup like this in .h file: @property (nonatomic, copy) NSString *careerURL; And synthesized like this in .m file: @synthesize careerURL; I really do not understand what is the issue here. The exact code works in another viewcontroller.
-
Answer:
You should either use dot(.) syntax, NSString *wtf = self.careerURL; Or Objective-C message syntax, NSString *wtf = [self careerURL]; Not both at the same time.
Peter Warbo at Stack Overflow Visit the source
Other answers
You should write: NSString *wtf = self.careerURL; When you are writing [object method] it is expected that you want to call method method from object object. If you want just access some value (that is defined as @property) you can type: [self nameOfValue]; or self.nameOfValue;
Nekto
Related Q & A:
- How to create a unique identifier for tracking?Best solution by Stack Overflow
- How to solve Identifier Undefined error?Best solution by e2e.ti.com
- Why doesn't my PHP function work as expected?Best solution by Stack Overflow
- How do I call an objective-c method?Best solution by Stack Overflow
- How to learn C# (moving from C++ to C#?Best solution by stackoverflow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.