Re: Two arrays sharing the same adress space.

2008-11-17 Thread Andy Lee
On Nov 17, 2008, at 10:01 AM, Scott Ribe wrote: Mounts is being used, but just not in the init function. You have declared it as a local variable. It *cannot* be used elsewhere. I suspect that you have also declared it as a member (attribute, property, whatever) and expect that you're ass

Re: Two arrays sharing the same adress space.

2008-11-17 Thread Sandro Noel
Thank you all, for taking the time to explain the workings this was very instructive and very apreciated!!! Thank you Sandro Noel. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Two arrays sharing the same adress space.

2008-11-17 Thread Scott Ribe
> Mounts is being used, but just not in the init function. You have declared it as a local variable. It *cannot* be used elsewhere. I suspect that you have also declared it as a member (attribute, property, whatever) and expect that you're assigning to that, but the local variable will shadow tha

Re: Two arrays sharing the same adress space.

2008-11-17 Thread Andy Lee
On Nov 17, 2008, at 1:18 AM, Kyle Sluder wrote: On Mon, Nov 17, 2008 at 1:03 AM, Stephen J. Butler <[EMAIL PROTECTED]> wrote: 2) always use the value returned from an init* method. This isn't strictly necessary. If you need a singleton object that lives for the duration of your app, for examp

Re: Two arrays sharing the same adress space.

2008-11-17 Thread Andy Lee
On Nov 17, 2008, at 1:03 AM, Stephen J. Butler wrote: On Sun, Nov 16, 2008 at 11:52 PM, Sandro Noel <[EMAIL PROTECTED]> wrote: as it turns out. with the bug fixed the mounts array is left null because the file does not exist yet. so further in the program is i try to add to the array, nothing

Re: Two arrays sharing the same adress space.

2008-11-17 Thread Stephen J. Butler
On Mon, Nov 17, 2008 at 12:02 AM, Sandro Noel <[EMAIL PROTECTED]> wrote: > NSFileManager *fileManager; >fileManager = [NSFileManager defaultManager]; >if ( [fileManager fileExistsAtPath:[[self > applicationSupportFolder] stringByAppendingPathComponent:@"Bonjour > Mou

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Kyle Sluder
On Mon, Nov 17, 2008 at 1:03 AM, Stephen J. Butler <[EMAIL PROTECTED]> wrote: > 2) always use the value returned from an init* method. This isn't strictly necessary. If you need a singleton object that lives for the duration of your app, for example, there's no reason you can't just alloc/init on

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Stephen J. Butler
On Sun, Nov 16, 2008 at 11:52 PM, Sandro Noel <[EMAIL PROTECTED]> wrote: > as it turns out. with the bug fixed the mounts array is left null because > the file does not exist yet. > so further in the program is i try to add to the array, nothing happens. > > and if i try "mounts = [[NSMutableArray

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
you fixed the [mounts initWithContentsOfFile:...] bug and it still happens? Cheers, Chuck - Original Message From: Sandro Noel <[EMAIL PROTECTED]> To: Scott Ribe <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Sent: Sunday, November 16, 2008 9:16:15 PM Subject:

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
File:...] bug and it still happens? Cheers, Chuck - Original Message From: Sandro Noel <[EMAIL PROTECTED]> To: Scott Ribe <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Sent: Sunday, November 16, 2008 9:16:15 PM Subject: Re: Two arrays sharing the same adress space. I&

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Charles Steinman
9:16:15 PM > Subject: Re: Two arrays sharing the same adress space. > > I'm actually checking here in this function. > > - (IBAction)mountSomeServers:(id)sender > { > > NSDictionary *mountDictionary; > > mountDictionary = [NSDictionary dictionaryWithO

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
I'm actually checking here in this function. - (IBAction)mountSomeServers:(id)sender { NSDictionary *mountDictionary; mountDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [server stringValue], ServerNameKey,

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Scott Ribe
> This is a debug built, and I'm checking in the code where mounts is > being assigned objects Which, if I recall correctly, is before bonjourServices is allocated. What do you think the problem is? -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice __

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
Forgot to answer the first question. This is a debug built, and I'm checking in the code where mounts is being assigned objects I have not enabled any optimization that I know of ... Sandro Noel. On 16-Nov-08, at 11:37 PM, Scott Ribe wrote: At what point in the code are you checking? Is th

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
Scott. thank you for your explanation. Mounts is being used, but just not in the init function. it is being used later in the code. that is why i was geting confused because the 2 arrays, are not meant to hold the same type of data. and right now, they contain mixed data type. witch makes m

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Scott Ribe
At what point in the code are you checking? Is this a release build, or a debug build in which you've gone & enabled some optimizations? In the code you posted mounts is init'd (twice actually, which is unecessary), then never used. It's perfectly possible that the two variables mounts & bonjourSe

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Markus Spoettl
On Nov 16, 2008, at 8:22 PM, Sandro Noel wrote: mounts = [[NSMutableArray alloc] init]; [mounts initWithContentsOfFile:[[self applicationSupportFolder] stringByAppendingPathComponent:@"Bonjour Mounter.plist"]]; You are initializing "mounts" twice, and you're also throwing

Re: Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
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 arr

Two arrays sharing the same adress space.

2008-11-16 Thread Sandro Noel
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 one