Good morning,
I was just wondering if i have an array in header file declared as:
NSArray *myArray;
NSMutableArray *myMuArray;
and in my implementation file i have:
myArray = [NSArray arrayWithObjects
bj1, obj2, nil];
myMuArray = [[NSMutableArray alloc] init];
[myMuArray addObject
bj1];
[myMuArray addObject
bj2];
Question 1:
what is the proper way to dispose these allocated memory?
[myArray release] for the array and...
[myMuArray removeAllObjects] ???
Question 2:
It seems like i can only remove and add items in array but is there anyway i can reassign the value of an item in an array?
something like myArray = 20 or myMuArray = 30??
Thanks in advance,
I was just wondering if i have an array in header file declared as:
NSArray *myArray;
NSMutableArray *myMuArray;
and in my implementation file i have:
myArray = [NSArray arrayWithObjects
myMuArray = [[NSMutableArray alloc] init];
[myMuArray addObject
[myMuArray addObject
Question 1:
what is the proper way to dispose these allocated memory?
[myArray release] for the array and...
[myMuArray removeAllObjects] ???
Question 2:
It seems like i can only remove and add items in array but is there anyway i can reassign the value of an item in an array?
something like myArray = 20 or myMuArray = 30??
Thanks in advance,