Re: Two arrays sharing the same adress space.
Re: Two arrays sharing the same adress space.
- Subject: Re: Two arrays sharing the same adress space.
- From: Sandro Noel <email@hidden>
- Date: Sun, 16 Nov 2008 23:31:16 -0500
I just declared a third NSMutableArray to see if that one would have a
different pointer, and well it had the same pointer somehow...
what is this ?
is it some type of setting ?
Sandro Noel.
On 16-Nov-08, at 11:22 PM, Sandro Noel wrote:
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
_______________________________________________
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