• 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
Two arrays sharing the same adress space.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two arrays sharing the same adress space.


  • Subject: Two arrays sharing the same adress space.
  • From: Sandro Noel <email@hidden>
  • Date: Sun, 16 Nov 2008 23:22:17 -0500

Greetings.

I'm having a weird behaviour, i have 2 arrays declared in the same controller, and for some reason they both share the same memory space.
well actually in debug they share the same pointer, witch is not something I asked for.


the bonjourservices and the mounts array's are the ones geting the same pointer.

here is my code.

		NSMutableArray *bonjourServices;
		NSMutableArray *mounts;


transportTypes = [NSArray arrayWithObjects:@"afp",@"smb",@"cifs",@"nfs",nil];

mounts = [[NSMutableArray alloc] init];
[mounts initWithContentsOfFile:[[self applicationSupportFolder] stringByAppendingPathComponent:@"Bonjour Mounter.plist"]];

// the bonjourScanner sends a notification when the content of the passed array is modified, we will pick it up here.
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(bonjourServiceNotigficationUpdate)
name:SERVICE_ADD_REMOVE_NOTIFICATION
object:nil];

bonjourServices = [[NSMutableArray alloc]init];

AFPScanner = [[BonjourScanner alloc]init];
SMBScanner = [[BonjourScanner alloc]init];
NFSScanner = [[BonjourScanner alloc]init];
AFPScanner.bonjourServices = bonjourServices;
SMBScanner.bonjourServices = bonjourServices;
NFSScanner.bonjourServices = bonjourServices;

[AFPScanner searchForService:@"_afpovertcp._tcp."; domain:nil];
[SMBScanner searchForService:@"_smb._tcp."; domain:nil];
[NFSScanner searchForService:@"_nfs._tcp."; domain:nil];


did anyone ever have that kind of problem ? i'm a little puzzled,
thank you ...

Sandro Noel.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Two arrays sharing the same adress space.
      • From: Scott Ribe <email@hidden>
    • Re: Two arrays sharing the same adress space.
      • From: Markus Spoettl <email@hidden>
    • Re: Two arrays sharing the same adress space.
      • From: Sandro Noel <email@hidden>
  • Prev by Date: Fetch value from field editor during editing?
  • Next by Date: Re: Two arrays sharing the same adress space.
  • Previous by thread: Re: Fetch value from field editor during editing?
  • Next by thread: Re: Two arrays sharing the same adress space.
  • Index(es):
    • Date
    • Thread