Hi,
I'm a newcomer to Objective C and Cocoa (C++ background mainly). I found the following code (simplified) in a method of an objective C class:
-(void) methodName
{
}
.... so it looks like you can dynamically allocate an array of length size like this (which you can't do in C++). Is this the case or am I missing something? If it is the case, what is the appropriate way to deallocate the memory? Something like:
delete [] arrayOfInts;
?
Thanks.
I'm a newcomer to Objective C and Cocoa (C++ background mainly). I found the following code (simplified) in a method of an objective C class:
-(void) methodName
{
int i;
int size = 4;
int arrayOfInts[size];
for (i = 0; i< size; i++)
{
}
int size = 4;
int arrayOfInts[size];
for (i = 0; i< size; i++)
{
arrayOfInts = i;
}
}
.... so it looks like you can dynamically allocate an array of length size like this (which you can't do in C++). Is this the case or am I missing something? If it is the case, what is the appropriate way to deallocate the memory? Something like:
delete [] arrayOfInts;
?
Thanks.