Questions tagged [declared-property]

In Objective-C, declared properties are a convenient way to replace the declaration and manual implementation of accessor methods for objects.

A property declaration begins with the keyword @property. You can decorate a property with attributes by using the form @property(attribute [, attribute2, ...]).

You use the @synthesize directive to tell the compiler that it should synthesize the setter and/or getter methods for a property if you do not supply them within the @implementation block. The @synthesize directive also synthesizes an appropriate instance variable if it is not otherwise declared.

Declared properties provide a useful simplification of the usual requirement to explicitly declare all accessor methods, in the following ways (excerpt from Apple documentation on Declared Properties):

  • The property declaration provides a clear, explicit specification of how the accessor methods behave.
  • The compiler can synthesize accessor methods for you, according to the specification you provide in the declaration.
  • Properties are represented syntactically as identifiers and are scoped, so the compiler can detect use of undeclared properties.

Questions relating to the proper use of @property declarations, @synthesize, and the use of dot notation to assign values to these properties (object.propertyName = propertyValue;) should use this tag.

Further reading:

  1. The Objective-C Programming Language: Declared Properties
78 questions
0
votes
3 answers

Xcode iPhone SDK (5.x) - Accessing a NSString inside AppDelegate

I want to access a NSString from AppDelegate.m that is located inside ViewController.m. I have a Single View Application, and i want to save my NSString using applicationDidEnterBackground: inside AppDelegate.m. The NSString is located inside…
Aleksander Azizi
  • 9,829
  • 9
  • 59
  • 87
-1
votes
3 answers

Variable was not declared in this scope C++

i'm trying to call a function in another .h file named display that receives a pointer for a std::vector > but when i try to call it i get the error that variable was not declared in this scope. Here's a sample of the code, i hope you…
ViriatoPT
  • 3
  • 2
-2
votes
1 answer

how to declare a variable with csv content with semicolon and double quotes in javascript

You are provided with the following CSV file content as a variable: "Buchungstag";"Wertstellung (Valuta)";"Vorgang";"Buchungstext";"Umsatz in EUR"; "22.10.2020";"22.10.2020";"Übertrag / Überweisung";"Auftraggeber: XY Buchungstext: KD 1 RE 3000 Ref.…
1 2 3 4 5
6