• 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
Problems with 2 classes HELP
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with 2 classes HELP


  • Subject: Problems with 2 classes HELP
  • From: Roberto Sobachi <email@hidden>
  • Date: Fri, 13 Feb 2004 14:44:20 +0100

I've got a problem with 2 classes.

I'm trying to pass the value from a class to another, but the
controller class, doesn't mantain objects.

This is the example.

Controller class: I call a function of another class to load an NSArray
with property datas.


CollectionList *collection = [[CollectionLists alloc] init];

[collection loadXML];
NSArray *demo = [[NSArray alloc] init];
demo = [collection retrieveArray]; It returns a 0 count NSArray


The other class has:

- (CollectionList *) init
{
[super init];
collection = [[NSMutableArray alloc] init];
return self;
}


- (void)loadXML
{

NSString *path = [@"~/Library/Demo/Demo.xml"
stringByExpandingTildeInPath];

collection = [[NSMutableArray arrayWithContentsOfFile: path] retain];
NSLog(@"%i", [collection count]); it Returns count Array > 0

}

- (NSMutableArray *) retrieveArray
{
return(collection);

}


Thanks
Roberto
_______________________________________________
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: Problems with 2 classes HELP
      • From: Pete Yandell <email@hidden>
    • Re: Problems with 2 classes HELP
      • From: Robert Cerny <email@hidden>
  • Prev by Date: What init declaration class needs?
  • Next by Date: Disabling non-editable NSTextFields
  • Previous by thread: Re: What init declaration class needs?
  • Next by thread: Re: Problems with 2 classes HELP
  • Index(es):
    • Date
    • Thread