Question: Can Anyone explain me the following image, that how can I do releasing within this block of code

![enter image description here](https://i.stack.imgur.com/nvRpU.jpg)

why there is issue when some having another object and you are releasing, like 

```
NSURL *url = [NSURL URLWithString:@"some_url_having_image_on_server"];
NSData *data = [[NSData alloc] initWithContentsOfURL:url];      
UIImage *image = [UIImage imageWithData:data];

```

How would I do release and explain the cases, and don't pass me links, just explain in your own programming skill, I really want to clear some concepts of memory management, they ever make me crazy :-(

Thanks In Advance

Answer: 
All Methods without an alloc are autoreleased. So the [UIImage imagedWithData:] will be automatically released at the end of the runloop.
There are only 4 basic rules when it comes to memory management in Objective-C:

1.If you own it, release it.

2.If you don’t own it, don’t release it.

3.Override dealloc in your classes to release the fields that you own.

4.Never call dealloc directly (except for the call to `[super dealloc]` in your `-dealloc` method)

As above you have a code 
UIImage \*image = [UIImage imageWithData:data];
here you did not allocated anything, so you dont have the right to release it.

The above 2 points are most crucial .