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
2 answers

receive ivar in other class

I have two view controllers: BSViewController which contains the source ivars number and array, and BSotherViewController which as the target needs to receive the ivars . (BSViewController has a button on it that is segues to…
zerowords
  • 2,915
  • 4
  • 29
  • 44
0
votes
1 answer

The ivar layout string format

A class' ivar layout is defined as a class_ro_t's struct uint8_t array field (Take a look at http://opensource.apple.com/source/objc4/objc4-532.2/runtime/objc-runtime-new.h). So, how can it be interpreted? What is the format of the data stored in…
LuisABOL
  • 2,951
  • 4
  • 25
  • 57
0
votes
3 answers

How to pass ivar into a function and set it without losing the reference to the original object

I am passing an ivar (NSMutableArray) into some method. I was expecting that if I modify the object inside the function, it would be reflected outside the function, but in this case I need to set the object; something like the following: - (void)…
clopez
  • 4,372
  • 3
  • 28
  • 42
0
votes
0 answers

Why does my ivar become null when reloading fragment through action bar button

I have an app with 3 tabs. The fragments for each tab are created with a SectionsViewPager. I've created a Reloadable interface with 1 method void reload(Context ctx);. On the actionBar I've added a reload button. When the button is pressed I'm…
Wolfgang Schreurs
  • 11,779
  • 7
  • 51
  • 92
0
votes
1 answer

properties synthesize and iVars

Disclaimer: I'm pretty new to Objective-C I have a couple of questions related to @property and @synthesize. Let's say I have property @property (strong, nonatomic) NSString *name; 1- I know that on Xcode 4.4+ you can skip doing @synthesize for the…
NarbehM
  • 345
  • 2
  • 13
0
votes
1 answer

access an UIImage instance variable and display it in UIImageView

I'm trying to access an UIImage instance variable and display it in UIImageView. When I try to NSLog the path I get null. I can manually display a pic through the IB, but I want to do this strictly through code #import "Deck.h" #import…
blitzeus
  • 485
  • 2
  • 10
  • 28
0
votes
1 answer

setting pics as UIImages as instance variables

I have a folder of png's called "cards" in Supporting Files. I'm trying to set a pic as a UIImage instance variable for a object. When i try to NSLog the UIImage i get null. I don't think I'm accessing the path to the pics correctly, but not sure…
blitzeus
  • 485
  • 2
  • 10
  • 28
0
votes
1 answer

Instance Variables and Bitfield

I was trying to do an instance field of 1 bit in Objective-C, however when I try this @property BYTE Z : 1; I get an error saying Property name cannot be a bitfield. What Can't I do so? Is there a workaround this error? Thanks
hakuna matata
  • 3,243
  • 13
  • 56
  • 93
0
votes
1 answer

How to speed up a UITableView by storing the images in an ivar

I have a table view that is scrolling slowly. The data is from a server and is save to a NSArray. I've read that the slow scrolling is most likely because the images are loaded within the tableView:cellForRowAtIndexPath: code. A solution might be…
hanumanDev
  • 6,592
  • 11
  • 82
  • 146
0
votes
1 answer

Will this leak under ARC?

I have a question regarding how ARC works. I have started working on IOS recently, I have created my project with ARC, As per documentation, ARC would take care of freeing memory by keep tracking reference count. Consider I have picker view ivar,…
Newbee
  • 3,231
  • 7
  • 42
  • 74
0
votes
2 answers

In iOS OpenGL app, will using ivar instead of property significantly improve performance?

I'm developing an iPhone OpenGL app. My question is: will using ivar instead of properties significantly improve performance? I know there're many discussions around ivar vs properties; but my question is specific to OpenGL ES. Using property getter…
lichen19853
  • 1,410
  • 2
  • 14
  • 21
0
votes
0 answers

Properties in iOS not being set

I have the following code. self.settingsObject is always nil? What is the issue? .h file @interface RoomConfigurationViewController : ATBaseViewController { } @property (nonatomic, strong) AttendanceSettings *settingsObject; @end .m…
jdog
  • 10,351
  • 29
  • 90
  • 165
0
votes
2 answers

Does @synthesize something = _something; autocreate the variable _something too?

I understand that @synthesize autocreates the getters and setters for an instance variable. When I specify the = _something part, I understand that this informs the compiler/runtime that I want it to use a particular backing variable for the…
Brett
  • 4,066
  • 8
  • 36
  • 50
0
votes
2 answers

I want to set ivar using -> operator

I want to set ivar using -> operator. I got an error: Interface type cannot be statically allocated. I don't want dot operator. @interface Dream : NSObject @property (nonatomic, assign) BOOL isBeer; @end Class ViewController -…
Voloda2
  • 12,359
  • 18
  • 80
  • 130
0
votes
3 answers

Objective C: Which is changed, property or ivar?

Worrying about duplicates but can not seem to find and answer I can understand in any of the other posts, I just have to ask: When I have in my .h: @interface SecondViewController : UIViewController{ NSString *changeName; } @property…
chwi
  • 2,752
  • 2
  • 41
  • 66
1 2 3
9
10