---
title: "Objective C allow to allocate object through alloc and init"  
description: "Objective C allow to allocate object through alloc and init"  
author: "Anonymous User"  
published: 2015-08-18  
updated: 2015-08-18  
canonical: https://www.mindstick.com/forum/33420/objective-c-allow-to-allocate-object-through-alloc-and-init  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Objective C allow to allocate object through alloc and init

What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between the following 2 ways to allocate and [init](https://www.mindstick.com/interview/204/what-is-asp-dot-net-page-life-cycle) an object?

```
AController *tempAController = [[AController alloc] init];self.aController = tempAController;[tempAController release];
```

and

```
self.aController= [[AController alloc] init];
```

Most of the [apple](https://www.mindstick.com/articles/12629/apple-cracks-down-on-os-level-ad-blockers) example use the first method. Why would you allocate, init and object and then [release](https://www.mindstick.com/news/2247/apple-plans-to-release-new-macs-in-early-2023) immediately?


---

Original Source: https://www.mindstick.com/forum/33420/objective-c-allow-to-allocate-object-through-alloc-and-init

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
