Questions tagged [ivars]

21 questions
0
votes
1 answer

Why use ivars for IBOutlets instead of properties?

I just started to work on a new project. It has a lot of legacy code and I found the following code @interface WLLeftSideViewController : UIViewController { @private __weak IBOutlet UIButton *_signInButton; __weak IBOutlet UIButton…
drasick
  • 280
  • 4
  • 14
0
votes
0 answers

Subclass does not have ivar of parents' public property

I'm learning objective-c and there is something I couldn't find an answer to. I have declared a property in the public interface of a class. In that class I can access the ivar directly by using underscore, without synthesizing the property. …
AMI289
  • 1,098
  • 9
  • 10
0
votes
2 answers

Using ivars to define property values inside a class

Is accessing the private ivar linked to a property inside of a class method more efficient than using its synthesized getter/setter methods, or is the efficiency just the same? ...As in: @implementation MyApp @synthesize name; - (void)loadView…
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
0
votes
1 answer

Further clarification of _property after readonly attribute?

When setting the readonly attribute in the interface section this 'disables' the setter method for the property. I need some clarification with: What is the point of the readonly property if we can just set it using _propertyName? When to use…
Cescy
  • 1,921
  • 3
  • 18
  • 21
0
votes
2 answers

Should I make my ivars properties in iOS?

Just when you think you understand something, you don't! :) I understand that if I make a variable a property, I can access it anywhere in the Class and even set it from outside that class. I thought if I didnt need it I could just make it an ivar. …
marciokoko
  • 4,988
  • 8
  • 51
  • 91
-1
votes
1 answer

How to send values to Ivar in method

new to Objective-C and keeping it very very simple I'm looking to understand one thing at a time... I set up a very simple class called student all it does is add two numbers trying to see how things pass into and back from methods) **I rewrote the…
1
2