Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6575153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:21:08+00:00 2026-05-25T15:21:08+00:00

I have this classA that has a method in it, that is being called

  • 0

I have this classA that has a method in it, that is being called from another classB to get the coordinates of a sprite.

when i call that method in the classA, it returns NSMutablearray, but then i want to release that array.
so if i release classA, is that ok? all the allocated array in it are being releaseD ? NO..
or should i release the array in the dealloc of the called classA ?

gameHandler.m
-(NSMutableArray*)stand2_Co
{
...
return myArray
}

and then call it from another class :

theLevel=[[gameHandler alloc] init];
..
..
int theNumber = [   [ [theLevel stand2_Co] objectAtIndex:0] integerValue];

[theLevel release];

if i release the gameHandler , i need to also release that array ?
if so, when should i do that ?

thanks a lot .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:21:08+00:00Added an answer on May 25, 2026 at 3:21 pm
    • You own any object you create

    You create an object using a method whose name begins with “alloc”,
    “new”, “copy”, or “mutableCopy” (for example, alloc, newObject, or
    mutableCopy).

    • When you no longer need it, you must relinquish ownership of an
      object you own

    You relinquish ownership of an object by sending it a release message
    or an autorelease message. In Cocoa terminology, relinquishing
    ownership of an object is therefore typically referred to as
    “releasing” an object.

    • You must not relinquish ownership of an object you do not own

    This is just corollary of the previous policy rules, stated
    explicitly.

    Memory Management Programming Guide

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that contains data from some model. This class has metadata
I have a class Application that my global.asax inherits from. The class has this
I have this class called PollFrame that extends JFrame in a file called PollFrame.java
I have this small class called City that simply holds some information about a
I have an ASCX that inherits from a WebControl that has a 'CustomConfiguration' property
In my iPhone app I have a UIViewController that has a UITableView and another
Hello I am trying to call a method (fileReader) that is using openFileInput(filename) from
I have a class that has a new method and uses that object to
I have three models that look something like this: class Bucket < ActiveRecord::Base has_many
I have this class that have a function to load other classes and create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.