Questions tagged [ivar]

In object-oriented programming, an instance variable is a variable defined in a class (i.e. a member variable), for which each object of the class has a separate copy, or instance.

In object-oriented programming, an instance variable is a variable defined in a class (i.e. a member variable), for which each object of the class has a separate copy, or instance.

140 questions
0
votes
1 answer

Objective C: Getter Methods vs Class.ivarName

I am quite confused on how to access variables across files. For example: I have 3 files: Apple, Fruit, and Eat Fruit.h @interface Fruit { NSString *name; } @property (nonatomic, retain) NSString *name; @end Fruit.m @implementation Fruit …
-1
votes
1 answer

Objective-C categories doesn't allow to add instance variables

I would like to know why Objective-C design pattern of categories has designed in a way that we cannot able to add instance variables. And also I came to know that using Objective-C associated objects we can able to do. But I am more interested what…
sanjayzed
  • 57
  • 9
-1
votes
1 answer

How can I call a method on and Ivar

I have some code which gives me an Ivar. // written some code so now I have the following Ivar Ivar ivar = i_have_an_ivar; I can get the type of this Ivar by calling ivar_getTypeEncoding method so I know what type is this Ivar. Now I want to call a…
g.revolution
  • 11,962
  • 23
  • 81
  • 107
-2
votes
2 answers

how to pass a variable value to another view properly

i have two views MainView and MainInvoicing from MainView i am sending a int type variable value to MainInvoicing this is my code in MainInvoicing.h file i declared int type var @property (nonatomic, assign) int myChoice; in MainView.m file on a…
M Zubair Shamshad
  • 2,741
  • 3
  • 23
  • 45
-2
votes
1 answer

How to set an ivar in a block without creating a retain cycle

I'm trying to initiate an NSObject subclass called FormObject in a JavascriptCore block. The FormObject is supposed to be nil until I set it in the JavascriptCore block. I need to set it in this block because After I show a UIActionSheet I save this…
Maximilian Litteral
  • 3,059
  • 2
  • 31
  • 41
1 2 3
9
10