Re: (void *)contextInfo

2010-01-12 Thread Roland King
ah I see you mean the disableColectorForPointer: and enableCollectorForPointer: methods, sorry I read enable/disable and went to look at those methods Nick Zitzmann wrote: On Jan 12, 2010, at 5:47 PM, Roland King wrote: I didn't understand that bit. "disable/enable methods of NSGarbageColle

Re: (void *)contextInfo

2010-01-12 Thread Nick Zitzmann
On Jan 12, 2010, at 5:47 PM, Roland King wrote: > I didn't understand that bit. "disable/enable methods of NSGarbageCollector", > that seems like a very heavy-handed way to stop a pointer from being > collected, just shutting GC off. I didn't mean shutting GC off entirely. I meant disabling co

Re: (void *)contextInfo

2010-01-12 Thread Roland King
Nick Zitzmann wrote: If you're using GC, and the pointer's address is being re-assigned, then it probably got finalized behind your app's back, and so you can emulate retain/release in this case by using the disable/enable methods of NSGarbageCollector. I didn't understand that bit. "dis

Re: (void *)contextInfo

2010-01-12 Thread Rainer Standke
Thanks, everyone, for your help. Rainer On Jan 12, 2010, at 12:19 , Markus Spoettl wrote: On Jan 12, 2010, at 8:51 PM, Rainer Standke wrote: Here is the code that displays the sheet: NSArray *theContextInfo = [[NSArray alloc] init]; theContextInfo = [NSArray arrayWithObject:objTBD];

Re: (void *)contextInfo

2010-01-12 Thread Sean McBride
On 1/12/10 3:04 PM, Sherm Pendley said: >Additionally, I'd recommend making theContextInfo into an instance >variable, rather than passing it through the contextInfo. You can then >write (or @synthesize) an accessor method that encapsulates all of the >relevant memory management into one place, wh

Re: (void *)contextInfo

2010-01-12 Thread Markus Spoettl
On Jan 12, 2010, at 8:51 PM, Rainer Standke wrote: > Here is the code that displays the sheet: > > NSArray *theContextInfo = [[NSArray alloc] init]; > theContextInfo = [NSArray arrayWithObject:objTBD]; > > > [NSApp beginSheet: alertWindow > modalForWindow: [selfw

Re: (void *)contextInfo

2010-01-12 Thread Hank Heijink (Mailinglists)
On Jan 12, 2010, at 2:51 PM, Rainer Standke wrote: > I am trying to get some contextinfo across while a sheet is displayed. > > Here is the code that displays the sheet: > > NSArray *theContextInfo = [[NSArray alloc] init]; > theContextInfo = [NSArray arrayWithObject:objTBD]; You're leak

Re: (void *)contextInfo

2010-01-12 Thread Nick Zitzmann
On Jan 12, 2010, at 12:51 PM, Rainer Standke wrote: > The contextinfo's class is logged as NSConcreteMutableData. How can I get > back to the array? Why is contextinfo considered to be of class void in the > signature? > > What am I missing? (Another newbie thing I suspect...) If you're using

Re: (void *)contextInfo

2010-01-12 Thread Sherm Pendley
On Tue, Jan 12, 2010 at 2:51 PM, Rainer Standke wrote: > > Here is the code that displays the sheet: > > NSArray *theContextInfo = [[NSArray alloc] init]; This creates a new array that you are responsible for releasing when you're finished with it. >        theContextInfo = [NSArray arrayWithObj

Re: (void *)contextInfo

2010-01-12 Thread Seth Willits
On Jan 12, 2010, at 11:51 AM, Rainer Standke wrote: > NSArray *theContextInfo = [[NSArray alloc] init]; > theContextInfo = [NSArray arrayWithObject:objTBD]; Well that's a leak already... The alloc/init is a waste. > [NSApp beginSheet: alertWindow > modalForWindow: [self wi