Re: Block Behavior

2012-02-16 Thread koko
Ok. I need to read up on blocks … I was pushed to this because of using beginSheetModalForWindow:completionHandler: the __block prefix solved the problem. Thanks. -koko On Feb 15, 2012, at 11:00 PM, Jens Alfke wrote: > > On Feb 15, 2012, at 4:41 PM, koko wrote: > >> Candidate function not

Re: Block Behavior

2012-02-15 Thread Jens Alfke
On Feb 15, 2012, at 4:41 PM, koko wrote: > Candidate function not viable: 'this' argument has type 'const BPreferences', > but method is not marked const Blocks can’t modify variables in the enclosing scope unless the variables are marked ‘__block’. In C++ code, I suppose that extends to inter

Re: Block Behavior

2012-02-15 Thread Dave Zarzycki
Koko, Are you using C++? (Probably.) If you are, then do you have a "const" version of Set? (Probably not.) If the above is not true, then what is the exact compiler error, and can you reduce this down to a test case? Thanks! davez On Feb 15, 2012, at 3:14 PM, koko wrote: > I need to know

Re: Block Behavior

2012-02-15 Thread koko
Apple llvm 3.0 No matching member function for call to 'Set' Candidate function not viable: 'this' argument has type 'const BPreferences', but method is not marked const As you can see from what I included this error is not generated if the function being called is outside the block On Feb

Re: Block Behavior

2012-02-15 Thread Greg Parker
On Feb 15, 2012, at 12:14 PM, koko wrote: > I need to know why a line of code that is OK outside a Block is invalid > inside. > > = >[sp beginSheetModalForWindow:[self window] completionHandler:^(NSInteger > result) >{ >if (result == NSFileHandlingPanelOKButton

Re: Block Behavior

2012-02-15 Thread David Duncan
Which compiler are you using? On Feb 15, 2012, at 12:14 PM, koko wrote: > I need to know why a line of code that is OK outside a Block is invalid > inside. > > > > = >[sp beginSheetModalForWindow:[self window] completionHandler:^(NSInteger > result) >{ >if (

Re: Block Behavior

2012-02-15 Thread Mike Abdullah
Give us the full details. What specific error are you seeing? On 15 Feb 2012, at 20:14, koko wrote: > I need to know why a line of code that is OK outside a Block is invalid > inside. > > > > = >[sp beginSheetModalForWindow:[self window] completionHandler:^(NSInteger > r