Users Pricing

forum

Home Forums Objective C allow to allocate object through alloc and init – MindStick

Objective C allow to allocate object through alloc and init

Anonymous User 2165 18 Aug 2015

What is the difference between the following 2 ways to allocate and init an object?

AController *tempAController = [[AController alloc] init];

self.aController = tempAController;

[tempAController release];

and

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

Most of the apple example use the first method. Why would you allocate, init and object and then release immediately?


0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md