Can't get timer to fire on separate thread

2014-10-21 Thread Rick Mann
I'm using CocoaHTTPServer and RoutingHTTPServer, and when a request comes in, my handler block is called on some arbitrary thread. The run loop associated with it has kCFRunLoopDefaultMode. I have code that creates an NSTimer and invokes a block passed to it. This works fine when called from

Re: Can't get timer to fire on separate thread

2014-10-21 Thread Ken Thomases
On Oct 21, 2014, at 3:15 AM, Rick Mann rm...@latencyzero.com wrote: I'm using CocoaHTTPServer and RoutingHTTPServer, and when a request comes in, my handler block is called on some arbitrary thread. The run loop associated with it has kCFRunLoopDefaultMode. I have code that creates an

Re: Can't get timer to fire on separate thread

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 01:46 , Ken Thomases k...@codeweavers.com wrote: On Oct 21, 2014, at 3:15 AM, Rick Mann rm...@latencyzero.com wrote: I'm using CocoaHTTPServer and RoutingHTTPServer, and when a request comes in, my handler block is called on some arbitrary thread. The run loop

Re: Can't get timer to fire on separate thread

2014-10-21 Thread Roland King
On 21 Oct 2014, at 4:58 pm, Rick Mann rm...@latencyzero.com wrote: I'm simulating a device that takes a substantial amount of time to respond to a series of REST HTTP request (to support automated testing). I'm writing an OS X app to do this. I was trying to avoid running the timer on the

NSInvocation crashes in AutoreleasePool

2014-10-21 Thread Gerriet M. Denkmann
10.10, Xcode 6.1, using Arc. The following code works fine, with USE_INVOCATION defined or not: #define USE_INVOCATION (or commented out) - (NSSet *)doSomethingWith: (NSArray *)listOfActions onSet: (NSSet *)originSet { NSSet *inputSet = originSet; for( NSString

Re: Trouble with imported enums in Swift

2014-10-21 Thread Raglan T. Tiger
On Oct 20, 2014, at 10:53 PM, Rick Mann rm...@latencyzero.com wrote: Sigh, I figured it out. Not only do you have to use NS_ENUM, the enumeration members MUST begin with the name of the enumeration. Example please ... I feel unfulfilled. -rags

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 09:18 , Raglan T. Tiger r...@crusaderrabbit.net wrote: On Oct 20, 2014, at 10:53 PM, Rick Mann rm...@latencyzero.com wrote: Sigh, I figured it out. Not only do you have to use NS_ENUM, the enumeration members MUST begin with the name of the enumeration.

Re: Trouble with imported enums in Swift

2014-10-21 Thread Greg Parker
On Oct 21, 2014, at 11:38 AM, Rick Mann rm...@latencyzero.com wrote: On Oct 21, 2014, at 09:18 , Raglan T. Tiger r...@crusaderrabbit.net wrote: On Oct 20, 2014, at 10:53 PM, Rick Mann rm...@latencyzero.com wrote: Sigh, I figured it out. Not only do you have to use NS_ENUM, the

Re: NSInvocation crashes in AutoreleasePool

2014-10-21 Thread Greg Parker
On Oct 21, 2014, at 2:44 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: 10.10, Xcode 6.1, using Arc. The following code works fine, with USE_INVOCATION defined or not: [...] Without USE_INVOCATION defined, I get some compiler warning about potential leaks, because selector is

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 13:13 , Greg Parker gpar...@apple.com wrote: NS_ENUM or NS_OPTIONS is required for Swift to import it. The name prefix is not required. If I recall correctly, the Swift importer has some heuristics to omit any shared prefix from the Swift names, but if there is no

Re: Trouble with imported enums in Swift

2014-10-21 Thread Quincey Morris
On Oct 21, 2014, at 13:33 , Rick Mann rm...@latencyzero.com wrote: Honestly, though, I don't see why Swift can't just deal with plain enums. Because it’s not an Obj-C compiler? I suspect that the reason you saw the “incomplete” behavior is that you declared the enum in two parts: enum

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 14:26 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Oct 21, 2014, at 13:33 , Rick Mann rm...@latencyzero.com wrote: Honestly, though, I don't see why Swift can't just deal with plain enums. Because it’s not an Obj-C compiler? I suspect that the

Re: Trouble with imported enums in Swift

2014-10-21 Thread Quincey Morris
On Oct 21, 2014, at 14:35 , Rick Mann rm...@latencyzero.com wrote: On Oct 21, 2014, at 14:26 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: Honestly, though, I don’t see why you can’t just deal with writing enums the “compatible” way. Because the file whence it comes is

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 14:54 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Oct 21, 2014, at 14:35 , Rick Mann rm...@latencyzero.com wrote: On Oct 21, 2014, at 14:26 , Quincey Morris quinceymor...@rivergatesoftware.com wrote: Honestly, though, I don’t see why you can’t

Re: Trouble with imported enums in Swift

2014-10-21 Thread Quincey Morris
On Oct 21, 2014, at 16:25 , Rick Mann rm...@latencyzero.com wrote: But the names of the elements all have to start with the type name, and that means not only changing the entire code base that uses the header, but also changing the naming convention used by that code base. Sure, we can do

Re: Trouble with imported enums in Swift

2014-10-21 Thread Greg Parker
On Oct 21, 2014, at 4:25 PM, Rick Mann rm...@latencyzero.com wrote: But the names of the elements all have to start with the type name This should not be the case. Please provide an example of the ObjC and Swift code you're using. Here's mine: // ObjC header: no type name prefix on

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
I've created a sample project showing the behavior and submitted it with radar #18730653. On Oct 21, 2014, at 17:09 , Greg Parker gpar...@apple.com wrote: On Oct 21, 2014, at 4:25 PM, Rick Mann rm...@latencyzero.com wrote: But the names of the elements all have to start with the type

Re: Trouble with imported enums in Swift

2014-10-21 Thread Greg Parker
On Oct 21, 2014, at 5:45 PM, Rick Mann rm...@latencyzero.com wrote: I've created a sample project showing the behavior and submitted it with radar #18730653. Thanks for the bug report. There is a Swift importer bug here. Your enumerators all have a common name prefix, but that name prefix

Re: Trouble with imported enums in Swift

2014-10-21 Thread Rick Mann
On Oct 21, 2014, at 18:13 , Greg Parker gpar...@apple.com wrote: On Oct 21, 2014, at 5:45 PM, Rick Mann rm...@latencyzero.com wrote: I've created a sample project showing the behavior and submitted it with radar #18730653. Thanks for the bug report. There is a Swift importer bug

Return values of NSAlert

2014-10-21 Thread Gerriet M. Denkmann
NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler NSModalResponse has three values: Stop, Abort, Continue - none of which bear any resemblance with the buttons: Default, Alternate, Other in my

Re: Return values of NSAlert

2014-10-21 Thread Marco S Hyman
The suggested alternative is NSAlertFirstButtonReturn, etc., which have values, which very much unlike the actual returned values. Those values worked for me found by trial an error because the documentation and headers made no sense at all. I was working in swift and found this code to

Re: Return values of NSAlert

2014-10-21 Thread Ken Thomases
On Oct 21, 2014, at 10:59 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler NSModalResponse has three values: Stop, Abort, Continue - none of