-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have this code in one of my classes:
- (void) processArray
{
NSMutableArray* array = [self getArray];
. . .
[array release];
array = nil;
}
- (NSMutableArray*) getArray
{
//NO 1:
NSMutableArray* array = [[NSMutableArray alloc]init];
//NO 2:
NSMutableArray* array = [NSMutableArray…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi
I am working on an application for android and we since we have lots of graphics, we use a lot of memory.
I monitor the memory heap size and its about 3-4 Mb , and peeks of 5Mb when I do something that requires more memory (and then goes back to 3). This is not a big deal, but some other stuff…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Coming from C++ it is hard grained into my mind that everytime I call new I call delete. In javascript I find myself calling new occasionally in my code but (hoping) the garbage collection functionality in the browser will take care of the mess for me.
I don't like this - is there a 'delete' method…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I have question in memory management (objective C). There are two ideal scenario.
============================= scenario 1 ========================================
(void) funcA
{
MyObj *c = [otherObj getMyObject];
[c release];
}
-(MyObj *) getMyObject //(this method is available in…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Do I have this right ...
// Reactor.h
@property(nonatomic, retain) NSMutableArray *reactorCore;
// Reactor.m
[self setReactorCore:[NSKeyedUnarchiver unarchiveObjectWithFile:[self dataFilePath]]];
...
-(void)dealloc {
[reactorCore release];
[super dealloc];
}
I am pretty sure I am doing…
>>> More