I have a function which converts my array into string when i run this function for an array of 50000 length, my app crashes and message says terminate due to memory error. Here is my function given below.
-(NSString*)getStringFromArray:(NSMutableArray*)array
{
NSString* resultantString = [array objectAtIndex:0];
for (int i = 1; i < [array count]; i ++)
{
resultantString = [NSString stringWithFormat:@"%@ %@", resultantString, [array objectAtIndex:i]];
}
return resultantString;
}