• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
retain variables between classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

retain variables between classes


  • Subject: retain variables between classes
  • From: "Jay Rimalrick" <email@hidden>
  • Date: Tue, 16 Dec 2003 12:54:01 -0500

I have two classes MainClass and AClass

AClass has a method (with data item array)
-(void)setInfo: (NSMutableArray *)inArray
{
[array release];
[inArray retain];
array = inArray; // also tried array = [inArray mutableCopy]
}

MainClass has an AClass defined and calls this method passing in a mutable
array and when i debug everything is copied fine. However when later
methods and delegates are called of AClass the array it the old one that was
defined in the initial init call. I checked init and it is only being called once so
I am assuming that in the setInfo function I am only copying it for the duration
of the method .... how can I get it to last more than the duration of the setInfo
method?

any ideas are greatly appreciated

-j





________________________________________________________________
Sent via the WebMail system at 1st.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: retain variables between classes
      • From: "Louis C. Sacha" <email@hidden>
    • Re: retain variables between classes
      • From: John Randolph <email@hidden>
    • RE: retain variables between classes
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: retain variables between classes
      • From: Lawrence Meeran <email@hidden>
    • Re: retain variables between classes
      • From: Matt Gillette <email@hidden>
  • Prev by Date: Re: Using custom NSValueTransformer objects in single-window applications
  • Next by Date: Changing the Locale for a single App?
  • Previous by thread: Re: Using invocation forwarding
  • Next by thread: Re: retain variables between classes
  • Index(es):
    • Date
    • Thread