Sujeev's Tech Blog

Tuesday, February 22, 2011

Private retained variables.

Normally if you want to retain a variable, we have to specify that in the .h file.

ex:

@interface ....
{
NSMutableArray *listItems;
.
.
.
}

@property (nonatomic, retain) NSMutableArray *listItems;
.
.
.
@end

instead, we can specify this on the .m

Ex:

on the .h file

@interface viewMain: ...
{
NSMutableArray *listItems;
.
.
.
}

.
.
.
@end

on the .m file

@interface viewMain ()

@property (nonatomic, retain) NSMutableArray *listItems;
@end

@implementation
.
.
.

0 Comments:

Post a Comment

<< Home