On Apr 22, 2016, at 6:19 PM, Quincey Morris
wrote:
>
> On Apr 22, 2016, at 16:12 , Carl Hoefs wrote:
>>
>> Yes, CFRunLoopPerformBlock: works well!
>
> But it sounded like you *didn’t* want to prevent the block from running.
On Apr 22, 2016, at 16:12 , Carl Hoefs wrote:
>
> Yes, CFRunLoopPerformBlock: works well!
But it sounded like you *didn’t* want to prevent the block from running. In
that case, dispatch_async would be all you’d need. (AFAIK, it doesn’t interact
with run loops,
Yes, CFRunLoopPerformBlock: works well!
Thanks,
-Carl
> On Apr 22, 2016, at 4:09 PM, Clark Cox wrote:
>
> If you really need the block to run in specific runloop modes, you can use
> CFRunLoopPerformBlock:
>
>
>
> CFRunLoopPerformBlock(CFRunLoopGetMain(),
If you really need the block to run in specific runloop modes, you can use
CFRunLoopPerformBlock:
CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, ^{
//Code to be performed on main thread
});
> On Apr 22, 2016, at 16:00, Carl Hoefs
On Apr 22, 2016, at 2:57 PM, Quincey Morris
wrote:
>
> If you must use performSelector, then you can write your own glue method that
> takes an object parameter and invokes the API that takes the scalar parameter.
> On Apr 22, 2016, at 2:57 PM, Quincey Morris
> wrote:
>
> The recommended way to have them performed on the main thread is to use a
> block and GCD dispatch_async (dispatch_get_main_queue (), …).
Ahh, that's clean. Implemented and working! That saves me
On Apr 22, 2016, at 14:48 , Carl Hoefs wrote:
>
> does this mean that there is no inherent way to handle the 1000s of
> Foundation and AppKit method signatures which don't specify an object but a
> value parameter? There is no recommended way to have them
> On Apr 19, 2016, at 1:50 PM, John McCall wrote:
>
> We strongly encourage you not to worry about any of this and just always call
> methods using the right method signature.
Sorry to beat a dead horse, but does this mean that there is no inherent way to
handle the 1000s
On Apr 19, 2016, at 1:50 PM, John McCall wrote:
> We strongly encourage you not to worry about any of this and just always call
> methods using the right method signature.
Roger, wilco! (It had a 'smell' to it, but I wasn't quite certain why. Now I
know! ;-)
-Carl
On Apr 19, 2016, at 2:20 PM, Alex Zavatone wrote:
>
> Considering its use at the language level, would values of nil and 0 result
> as NO and every other value of 1 or > == YES?
No, when it's a char, there are 254 values which are not == to either NO or
YES. This can be a pretty
> On Apr 19, 2016, at 1:20 PM, Alex Zavatone wrote:
> On Apr 19, 2016, at 3:23 PM, Greg Parker wrote:
>
>>
>>> On Apr 19, 2016, at 12:07 PM, Jens Alfke wrote:
>>>
On Apr 19, 2016, at 10:22 AM, Alex Zavatone wrote:
I believe that
> On Apr 19, 2016, at 2:07 PM, Jens Alfke wrote:
>
> Anyway, I can’t remember if anyone gave a solution to the question. The right
> way to do this is to create a new method that takes an NSNumber, and invoke
> _that_ method using the delayed-perform, after boxing the BOOL.
On Apr 19, 2016, at 3:23 PM, Greg Parker wrote:
>
>> On Apr 19, 2016, at 12:07 PM, Jens Alfke wrote:
>>
>>> On Apr 19, 2016, at 10:22 AM, Alex Zavatone wrote:
>>>
>>> I believe that a BOOL can only be YES or NO. A nil value on a BOOL would
>>> be NO if I
> On Apr 19, 2016, at 12:07 PM, Jens Alfke wrote:
>
>> On Apr 19, 2016, at 10:22 AM, Alex Zavatone wrote:
>>
>> I believe that a BOOL can only be YES or NO. A nil value on a BOOL would be
>> NO if I am correct.
>
> At the language level, yes.
Not even
> On Apr 19, 2016, at 10:22 AM, Alex Zavatone wrote:
>
> I believe that a BOOL can only be YES or NO. A nil value on a BOOL would be
> NO if I am correct.
At the language level, yes. The problem is, this behavior is occurring at
runtime, at the machine-code level. The
> On Apr 18, 2016, at 6:56 PM, Carl Hoefs
> wrote:
>
> Suppose I have an object with a declared method signature:
> -(void)myMethod:(BOOL)a_bool;
>
> Q1: If I invoke it like this:
> [self performSelector:@selector(myMethod:) withObject:nil]; // nil obj
>
I believe that a BOOL can only be YES or NO. A nil value on a BOOL would be NO
if I am correct.
Am I correct here?
On Apr 18, 2016, at 9:56 PM, Carl Hoefs wrote:
> Suppose I have an object with a declared method signature:
> -(void)myMethod:(BOOL)a_bool;
>
> Q1: If I invoke it like this:
On Mon, 18 Apr 2016 18:56:43 -0700, Carl Hoefs said:
>Suppose I have an object with a declared method signature:
> -(void)myMethod:(BOOL)a_bool;
>
>Q1: If I invoke it like this:
> [self performSelector:@selector(myMethod:) withObject:nil]; // nil obj
Stop right there, you are violating the
What does the compiler say?
Not tried this, but as BOOL is neither a pointer nor subclass of
NSObject, I would not expect reliable results, but a type mismatch.
Of course, I could be wrong, YMMV.
Gary
On Apr 18, 2016, at 6:56 PM, Carl Hoefs wrote:
Suppose I have an object with a
On Apr 18, 2016, at 8:56 PM, Carl Hoefs wrote:
>
> Suppose I have an object with a declared method signature:
> -(void)myMethod:(BOOL)a_bool;
>
> Q1: If I invoke it like this:
> [self performSelector:@selector(myMethod:) withObject:nil]; // nil obj
> Will
To answer your second question consider BOOL b = (BOOL)someObj; if someObj
happens to equal something like 0x12345600 the value of b will be NO
because casting from a pointer to a char will return the least significant
byte.
For your first question I don't know exactly but it doesn't look safe;
Suppose I have an object with a declared method signature:
-(void)myMethod:(BOOL)a_bool;
Q1: If I invoke it like this:
[self performSelector:@selector(myMethod:) withObject:nil]; // nil obj
Will argument a_bool end up with a 0 value assigned to it?
Q2: But if I invoke it like this:
[self
22 matches
Mail list logo