How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
I am trying to build my own version of NSKeyed(Un)Archiver. But I do not know how to recognise mutability. 1. use isKindOfClass: [NSMutableString class] disadvantage: all strings turn out to be mutable 2. use respondsToSelector: @selector(appendString:) disadvantage: all strings

Re: How to recognize mutability?

2013-02-20 Thread Ronald Oussoren
On 20 Feb, 2013, at 9:10, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I am trying to build my own version of NSKeyed(Un)Archiver. But I do not know how to recognise mutability. Use classForKeyedArchiver (or one of the other variants) to detect as which class an object wants to be

Re: How to recognize mutability?

2013-02-20 Thread Markus Spoettl
On 2/20/13 9:10 AM, Gerriet M. Denkmann wrote: P.S. I want my own archiver for 2 reasons: 1. NSKeyedArchiver can store only certain strings I find that very hard to believe. Markus -- __ Markus Spoettl ___

Issue with Custom View Drag and Drop

2013-02-20 Thread Omkar Ramtekkar
Hello, I'm implementing the Drag and Drop functionality over the same Custom View. My6 Custom is acting as source and Destination. I've implemented it according to Apple's Guideline for Drag and Drop wit Custom Views. I've started the Drag and Drop from mouseDown: event. Normally it works

Re: No mouseExited when switching windows

2013-02-20 Thread Steve Mills
On Feb 19, 2013, at 17:37:26, Shane Stanley sstan...@myriad-com.com.au wrote: Don't you mean: [center addObserver:self selector:@selector(windowDidResignKey:) Doh! Thanks. First time I've used @selector since the early days of Cocoa. So now I have that working, and am handling

Re: No mouseExited when switching windows

2013-02-20 Thread Kyle Sluder
On Feb 20, 2013, at 7:55 AM, Steve Mills smi...@makemusic.com wrote: At this point, I should hilite that same area with the hover image. Yet I can't because the only thing I can think of doing the right way would be to receive a NSWindowDidBecomeKeyNotification notification. But this doesn't

Re: No mouseExited when switching windows

2013-02-20 Thread Steve Mills
On Feb 20, 2013, at 10:02:37, Kyle Sluder k...@ksluder.com wrote: On Feb 20, 2013, at 7:55 AM, Steve Mills smi...@makemusic.com wrote: At this point, I should hilite that same area with the hover image. Yet I can't because the only thing I can think of doing the right way would be to

LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Andy Lee
If you upgraded to Xcode 4.6 and suddenly you've been seeing crashes when deploying to Snow Leopard, you might want to go back to Xcode 4.5.2. In a nutshell, the following crashes on 10.6.8 when compiled with Apple LLVM 4.2 with a deployment target of 10.6. NSArray *array = [[NSArray

Re: LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Gary L. Wade
Is it the empty array that's causing the crash? Does it still crash if the array has at least one object? -- Gary L. Wade http://www.garywade.com/ On 2/20/2013 8:33 AM, Andy Lee ag...@mac.com wrote: If you upgraded to Xcode 4.6 and suddenly you've been seeing crashes when deploying to Snow

Re: LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Sean McBride
On Wed, 20 Feb 2013 11:33:46 -0500, Andy Lee said: If you upgraded to Xcode 4.6 and suddenly you've been seeing crashes when deploying to Snow Leopard, you might want to go back to Xcode 4.5.2. In a nutshell, the following crashes on 10.6.8 when compiled with Apple LLVM 4.2 with a deployment

Re: No mouseExited when switching windows

2013-02-20 Thread Kyle Sluder
On Wed, Feb 20, 2013, at 08:21 AM, Steve Mills wrote: Because with proper Cocoa event, you're given everything you need rather than having to get it via brute force (get global point, convert to window coords, and convert to view coords). I was hoping someone might point out something that

Re: LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Greg Parker
On Feb 20, 2013, at 8:33 AM, Andy Lee ag...@mac.com wrote: If you upgraded to Xcode 4.6 and suddenly you've been seeing crashes when deploying to Snow Leopard, you might want to go back to Xcode 4.5.2. In a nutshell, the following crashes on 10.6.8 when compiled with Apple LLVM 4.2 with a

Re: LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Greg Parker
On Feb 20, 2013, at 9:23 AM, Sean McBride s...@rogue-research.com wrote: Does Xcode 4.6 even claim to support deploying to 10.6? IIRC, all recent releases' release notes say its for developing for 10.7 and 10.8. Xcode 4.6 itself only runs on 10.7 and 10.8, but it should be able to build for

Re: LLVM 4.2 bug: crash on 10.6.8 in loop iteration

2013-02-20 Thread Andy Lee
On Feb 20, 2013, at 12:43 PM, Greg Parker gpar...@apple.com wrote: On Feb 20, 2013, at 8:33 AM, Andy Lee ag...@mac.com wrote: If you upgraded to Xcode 4.6 and suddenly you've been seeing crashes when deploying to Snow Leopard, you might want to go back to Xcode 4.5.2. In a nutshell, the

Re: No mouseExited when switching windows

2013-02-20 Thread Steve Mills
On Feb 20, 2013, at 11:42:24, Kyle Sluder k...@ksluder.com wrote: This isn't true. Events come in different flavors. You can't ask for the mouse position for a flags-changed event, for example. Since the mouse is decoupled from any individual application, it makes sense to sometimes ask for

NSPipe eating up all available pipes on system.

2013-02-20 Thread Mr. Gecko
I have written a daemon that listens for an incoming connection, runs a process using NSTask, and sends the output to the connection. After a couple of hours of receiving connections at varying lengths of time… The system has all of it's pipes taken, and the process stops sending responses to

Re: CALayer's backgrounds filters having effect only on immediate parent?

2013-02-20 Thread Oleg Krupnov
Not exactly. Here is what the documentation says: backgroundFilters An array of Core Image filters to apply to the content immediately behind the layer. Animatable. @property(copy) NSArray *backgroundFilters Discussion Background filters affect the content behind the layer that shows through

Re: NSPipe eating up all available pipes on system.

2013-02-20 Thread Ken Thomases
On Feb 20, 2013, at 4:10 PM, Mr. Gecko wrote: I have written a daemon that listens for an incoming connection, runs a process using NSTask, and sends the output to the connection. After a couple of hours of receiving connections at varying lengths of time… The system has all of it's pipes

Re: CALayer's backgrounds filters having effect only on immediate parent?

2013-02-20 Thread David Duncan
On Feb 20, 2013, at 2:12 PM, Oleg Krupnov oleg.krup...@gmail.com wrote: Not exactly. Here is what the documentation says: backgroundFilters An array of Core Image filters to apply to the content immediately behind the layer. Animatable. @property(copy) NSArray *backgroundFilters

Re: NSPipe eating up all available pipes on system.

2013-02-20 Thread Mr. Gecko
Looks like every pipe is leaking. I cannot see a way to prevent the leak myself as I know the NSPipes are being released. It doesn't seem to crash with Auto Reference Counting… But boy, it eats memory and still leaks. So I would think this is an Apple bug. On Feb 20, 2013, at 4:31 PM, Ken

Re: NSPipe eating up all available pipes on system.

2013-02-20 Thread Mr. Gecko
I take that back, it still crashes with ARC… It crashes at run 4720. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

NSTask arguments

2013-02-20 Thread dangerwillrobinsondanger
Hi all Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a file to use as the argument, but rather send data that would be in said file. Can this be done via NSFileHandle or NSPipe from

Re: NSTask arguments

2013-02-20 Thread Greg Parker
On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a file to use as the argument, but rather send data that would be in

Re: NSTask arguments

2013-02-20 Thread John Joyce
On Feb 21, 2013, at 9:46 AM, Greg Parker gpar...@apple.com wrote: On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 00:42, Markus Spoettl ms_li...@shiftoption.com wrote: On 2/20/13 9:10 AM, Gerriet M. Denkmann wrote: P.S. I want my own archiver for 2 reasons: 1. NSKeyedArchiver can store only certain strings I find that very hard to believe. I find that very easy to proof:

Re: NSTask arguments

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a file to use as the argument, but rather send data that would be

Re: How to recognize mutability?

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 12:10 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But I do not know how to recognise mutability. 1. use isKindOfClass: [NSMutableString class] disadvantage: all strings turn out to be mutable This is somewhat of an FAQ. There is no way to do this (without

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Wed, Feb 20, 2013, at 08:11 PM, Jens Alfke wrote: You could conceivably create a fake volume in the filesystem that didn’t correspond to any real file but just returned your data when read (something like what the disk images driver does) … but the moment you did this, your data would exist

Re: NSTask arguments

2013-02-20 Thread dangerwillrobinsondanger
On 2013/02/21, at 13:11, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a

Re: How to recognize mutability?

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 8:05 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I find that very easy to proof: Looks like you’re right — it’s the string @“$null” that’s to blame, for some reason. I would guess that somewhere in the archiver is some fscked-up unquoting code. I hope you’ve filed

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Wed, Feb 20, 2013, at 08:22 PM, Kyle Sluder wrote: You can accomplish this without writing to the file system, but it involves foregoing NSTask. Fork, close stdin in the child process, open a pipe (so that the child gets the read end in fd 0), then exec the tool with /dev/stdin as the

Re: NSTask arguments

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 8:22 PM, Kyle Sluder k...@ksluder.com wrote: You can accomplish this without writing to the file system, but it involves foregoing NSTask. Fork, close stdin in the child process, open a pipe (so that the child gets the read end in fd 0), then exec the tool with /dev/stdin

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Feb 20, 2013, at 8:30 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 8:22 PM, Kyle Sluder k...@ksluder.com wrote: You can accomplish this without writing to the file system, but it involves foregoing NSTask. Fork, close stdin in the child process, open a pipe (so that the

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
Oh crap, NOW I get it. :P You don't have to do the fork dance at all. Just call -setStandardInput: and pass /dev/stdin as the filename argument. Let NSTask take care of the rest. --Kyle Sluder On Wed, Feb 20, 2013, at 08:30 PM, Jens Alfke wrote: On Feb 20, 2013, at 8:22 PM, Kyle Sluder

Re: NSTask arguments

2013-02-20 Thread Ken Thomases
On Feb 20, 2013, at 10:28 PM, Kyle Sluder wrote: On Wed, Feb 20, 2013, at 08:22 PM, Kyle Sluder wrote: You can accomplish this without writing to the file system, but it involves foregoing NSTask. Fork, close stdin in the child process, open a pipe (so that the child gets the read end in fd

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 11:27, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 8:05 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I find that very easy to proof: Looks like you’re right — it’s the string @“$null” that’s to blame, for some reason. I would guess that

Re: NSTask arguments

2013-02-20 Thread Ken Thomases
On Feb 20, 2013, at 10:31 PM, Kyle Sluder wrote: On Feb 20, 2013, at 8:30 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 8:22 PM, Kyle Sluder k...@ksluder.com wrote: You can accomplish this without writing to the file system, but it involves foregoing NSTask. Fork, close

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 11:15, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 12:10 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But I do not know how to recognise mutability. 1. use isKindOfClass: [NSMutableString class] disadvantage: all strings turn out to be

Re: How to recognize mutability?

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 8:39 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: They are using $null to stand for nil. Which does not play nice with NSArrays (and other containers), which cannot contain nil. Plus, the object @“$null” is not the same as a nil pointer, so this is bad whether or

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 12:09, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 8:39 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: They are using $null to stand for nil. Which does not play nice with NSArrays (and other containers), which cannot contain nil. Plus, the object

Re: How to recognize mutability?

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 9:31 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But another bug looks rather promising: feed strings with illegal Unicode to NSArchiver and see what happens. It’s harder to get such a string into an app, though, since you can’t really type it. Did this (by

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 12:58, Jens Alfke j...@mooseyard.com wrote: On Feb 20, 2013, at 9:31 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: But another bug looks rather promising: feed strings with illegal Unicode to NSArchiver and see what happens. It’s harder to get such a string