Two arrays sharing the same adress space.
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