I'm having a problem with adding objects to an NSArray in iPhone SDK. The problem is that it only adds the last object of my NSDictionary. This is the code:
NSArray * processes = [[UIDevice currentDevice] runningProcesses];
for (NSDictionary * dict in processes){
runningprocesses = [[NSMutableArray alloc] init];
NSString *process = [dict objectForKey:@"ProcessName"];
[runningprocesses addObject:process];
}
When I NSLog [dict objectForKey:@"ProcessName"] it shows me all the processes but if I try to add them it only adds the last one. What could be happening?