Invitation to connect on LinkedIn

2010-02-03 Thread Yong Li
LinkedIn cocoa-dev, I'd like to add you to my professional network on LinkedIn. - Yong Confirm that you know Yong Li https://www.linkedin.com/e/isd/1047213400/v9UH383H/ -- (c) 2010, LinkedIn Corporation ___ Cocoa-dev mailing

objc_msgSend() tour

2010-02-03 Thread Bill Bumgarner
Folks- I finally banged out part IV -- the 'slow path' & odds/ends -- of my tour of objc_msgSend() on x86_64. If you want to know how method invocations works in instruction by instruction detail on x86_64, you might find it interesting: http://www.friday.com/bbum/2009/12/18/o

Re: EnumeratorAtPath and duplicate files during drag to open

2010-02-03 Thread Jerry Krinock
On 2010 Feb 03, at 21:06, Trygve Inda wrote: > Do I just need to keep a temporary array of paths that I have processed and > search it for each file. That's one way that would work. Another way would be to, before processing each item, iterate through its lineage, somethling like this: pa

Re: EnumeratorAtPath and duplicate files during drag to open

2010-02-03 Thread Jens Alfke
On Feb 3, 2010, at 9:06 PM, Trygve Inda wrote: > This becomes a real issue if someone drops DirectoryA and DirectoryB if > DirectoryB is in the tree below DirectoryA... Since a bunch of files could > be re-processed. Convert each input path into canonical form (to resolve symlinks), sort them a

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Graham Cox
On 04/02/2010, at 4:21 PM, Michael Ash wrote: > Why is everybody so worried about loading an excessive amount of data > if it's a directory, but not if it's a file? HFS+ is capable of > holding files over a billion gigabytes long, which you're going to > have a certain amount of trouble squeezing

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Michael Ash
On Wed, Feb 3, 2010 at 1:46 PM, Charles Srstka wrote: > On Feb 3, 2010, at 8:26 AM, cocoa-dev wrote: > >> Thanks Graham, here's what I'm thinking.  The documents for my app are >> fileWrappers.  Before the document is saved for the first time I can copy >> the files to a temp folder and during a

EnumeratorAtPath and duplicate files during drag to open

2010-02-03 Thread Trygve Inda
If a user drags 3 Finder objects to my "file processor" app... DirectoryA FileA FileB And FileA is in the directory tree below DirectoryA, what is the best way to avoid processing the file twice? When I get the array of paths in my drop handler, when I see the directory, I use EnumeratorAtPath t

IKImageBrowserView & IKImageView subclasses not getting called

2010-02-03 Thread Charles Burnstagger
I subclass IKImageBrowserView & IKImageView overriding initWithFrame: & drawRect: and sending the same messages to super in both cases. I've set them as the classes for the UI objects in my IB file, and as IBOutlets in my window's window controller subclass. But when I run the code, neither of

Re: Breaking on 'autoreleased with no pool in place - just leaking'

2010-02-03 Thread Keith Duncan
On 2 Feb 2010, at 09:40, Matt Gough wrote: > What symbol should I put a break point on […] > > I tried NSLog and printf but it wasn't them. You can also set a breakpoint on 'asl_send' to catch logging. Keith___ Cocoa-dev mailing list (Cocoa-dev@list

Re: cross-process file open notifications

2010-02-03 Thread Alexander Cohen
Unfortunately, the files i need to watch could be anywhere on the system. So i would need something more like a filename only watch and not a complete path. AC On Feb 3, 2010, at 6:15 PM, Jerry Krinock wrote: > > On 2010 Feb 03, at 14:28, Jens Alfke wrote: > >> FSEvents notifies you when a pa

Re: cross-process file open notifications

2010-02-03 Thread Alexander Cohen
I can't put any code into the dylib. It's library that's not being developed anymore but many users have it and use it. We have a new approach but the dylib has a sort of lock on some things we need. Because of this, we've decided to watch for usage of this dylib and when there is no usage, we c

Re: Synthesize NSMutableString retain count question

2010-02-03 Thread Philip Vallone
Thanks.. perfect explanation. On Feb 3, 2010, at 12:37 PM, Jens Alfke wrote: > > On Feb 3, 2010, at 3:55 AM, Philip Vallone wrote: > >> currentSection = @"Some value"; >> The retain count goes to 1 > > This assigns a new value to the pointer variable 'currentSection'. It now > points to the

Re: cross-process file open notifications

2010-02-03 Thread Jerry Krinock
On 2010 Feb 03, at 14:28, Jens Alfke wrote: > FSEvents notifies you when a particular directory (or anything inside it) > changes. Or, preferably, if your process does not need to be running to do other stuff, you could set up a launchd task to watch a particular directory and launch your pro

Re: Drawing Attention to a Control to aid user in Error Recovery

2010-02-03 Thread jonat...@mugginsoft.com
On 3 Feb 2010, at 21:04, Jerry Krinock wrote: > An app I'm developing has a multi-tabbed window. Sometimes one of the Error > Recovery Options is to click into some tab and adjust control Foo. And in > many cases, either due to the complexity of it, or to help the user learn > where the cont

Re: cross-process file open notifications

2010-02-03 Thread Jens Alfke
On Feb 3, 2010, at 1:50 PM, Alexander Cohen wrote: Is there any way in cocoa to get some sort of notifications when any process opens or closes any file? I'm pretty sure there isn't. The rate at which those notifications were sent would be pretty horrific (ever run fs_usage on all proces

Re: cross-process file open notifications

2010-02-03 Thread Dave Carrigan
On Feb 3, 2010, at 1:54 PM, Dave Carrigan wrote: > > On Feb 3, 2010, at 1:50 PM, Alexander Cohen wrote: > >> Is there any way in cocoa to get some sort of notifications when any process >> opens or closes any file? The reason i need this is because i need to watch >> the system and do a certa

Re: cross-process file open notifications

2010-02-03 Thread Dave Carrigan
On Feb 3, 2010, at 1:50 PM, Alexander Cohen wrote: > Is there any way in cocoa to get some sort of notifications when any process > opens or closes any file? The reason i need this is because i need to watch > the system and do a certain task every time a particular dylib is loaded by > an app

cross-process file open notifications

2010-02-03 Thread Alexander Cohen
Is there any way in cocoa to get some sort of notifications when any process opens or closes any file? The reason i need this is because i need to watch the system and do a certain task every time a particular dylib is loaded by an application. thx AC___

Drawing Attention to a Control to aid user in Error Recovery

2010-02-03 Thread Jerry Krinock
An app I'm developing has a multi-tabbed window. Sometimes one of the Error Recovery Options is to click into some tab and adjust control Foo. And in many cases, either due to the complexity of it, or to help the user learn where the control is, I want them to actually do it themselves, using

Re: another responder chain docs bug (validateUserInterfaceItem:)

2010-02-03 Thread Kyle Sluder
Ack, I need to correct myself. On Wed, Feb 3, 2010 at 8:42 AM, Kyle Sluder wrote: > selector. If it can't find one, the control is enabled. If it does I meant to say that if AppKit can't find a control in the responder chain that responds to the action selector, the control is *disabled.* --Kyl

Re: Multithread communication

2010-02-03 Thread Matt Neuburg
On Wed, 3 Feb 2010 11:30:15 -0500, "McLaughlin, Michael P." said: >In a multithreaded app using NSOperationQueue and targeting Leopard, I am >having an inordinate amount of trouble communicating the results of the >thread computations to the main thread which acts as an overall coordinator. > >thr

Re: another responder chain docs bug (validateUserInterfaceItem:)

2010-02-03 Thread Andy Lee
On Feb 3, 2010, at 11:42 AM, Kyle Sluder wrote: > On Wed, Feb 3, 2010 at 1:02 AM, Jens Miltner wrote: >> Well, in my experience the truth is somewhere between the two: >> >> AppKit seems to go up the responder chain and call >> validateUserInterfaceItem: on each potential target (i.e. each respon

Re: Multithread communication

2010-02-03 Thread Bill Bumgarner
What Kyle and Jens said, but there is one particular cardiac action impaired horse that I wanted to flog... On Feb 3, 2010, at 8:30 AM, McLaughlin, Michael P. wrote: > I thought that this should all be correct but somehow it crashes, at times > immediately, at other times only when everything is

Re: NSFont to CGFontRef

2010-02-03 Thread Andy O'Meara
> No, it'll just crash unless you set the minimum system requirement key in the > info plist. Sure, but in terms of supporting our 10.4 customers (which is a significant number for us), it seems like we're out of luck wrt to turning a NSFont* into a CGFontRef (or namely, creating a CGFontRef f

Re: what is the struct of SecKeychainItemRef?

2010-02-03 Thread Jens Alfke
On Feb 3, 2010, at 10:29 AM, John Yeh wrote: After a ponter to SecKeychainItemRef is returned, How do I extract (or explore) the data from SecKeychainItemRef? It's not a struct, it's an opaque CoreFoundation object. Take a look at the accessor functions named SecKeychainItemGetXXX or Sec

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Charles Srstka
On Feb 3, 2010, at 8:26 AM, cocoa-dev wrote: > Thanks Graham, here's what I'm thinking. The documents for my app are > fileWrappers. Before the document is saved for the first time I can copy the > files to a temp folder and during a save move them into the fileWrapper. I > guess I need to j

Re: what is the struct of SecKeychainItemRef?

2010-02-03 Thread Nick Zitzmann
On Feb 3, 2010, at 11:29 AM, John Yeh wrote: > After a ponter to SecKeychainItemRef is returned, How do I extract (or > explore) the data from SecKeychainItemRef? SecKeychainItemCopyContent()? Nick Zitzmann ___ Cocoa-de

what is the struct of SecKeychainItemRef?

2010-02-03 Thread John Yeh
After a ponter to SecKeychainItemRef is returned, How do I extract (or explore) the data from SecKeychainItemRef? -John___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

Re: NSFont to CGFontRef

2010-02-03 Thread Nick Zitzmann
On Feb 3, 2010, at 11:08 AM, Andy O'Meara wrote: > My concern with CoreText is that it rules out 10.4 as I understand it, so > anyone loading the app under 10.4 will see a message saying that the app > can't be run, no? No, it'll just crash unless you set the minimum system requirement key in

Re: NSFont to CGFontRef

2010-02-03 Thread Andy O'Meara
On Feb 2, 2010, at 9:00 PM, Nick Zitzmann wrote: > > On Feb 2, 2010, at 10:26 AM, Andy O'Meara wrote: > >> Given an NSFont object how can I extract or create a CGFontRef from it to >> use directly with CoreGraphics? > > You're close. Starting in (I think) Leopard, NSFont and CTFontRef (not

NSFont to CGFontRef

2010-02-03 Thread Andy O'Meara
Hi everyone, Given an NSFont object how can I extract or create a CGFontRef from it to use directly with CoreGraphics? I've already searched around in the lists and ADC with no luck. So far, I've tried the following: NSFontManager* fm = [NSFontManager sharedFontManager]; NSFo

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Fritz Anderson
On 3 Feb 2010, at 8:08 AM, cocoa-dev wrote: > I have an app that attaches a file to a document like when you attach a file > to mail. I use the following to store the file as data in an iVar: > > fileData = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached > error:(NSError **)err

Re: Multithread communication

2010-02-03 Thread Jens Alfke
On Feb 3, 2010, at 8:30 AM, McLaughlin, Michael P. wrote: but their own. I have to pass these filled structures back to the main thread upon completion. The last thing each thread does is postNotificationName to the main thread saying that it is ready to return lots of data which it does

Re: Synthesize NSMutableString retain count question

2010-02-03 Thread Jens Alfke
On Feb 3, 2010, at 3:55 AM, Philip Vallone wrote: currentSection = @"Some value"; The retain count goes to 1 This assigns a new value to the pointer variable 'currentSection'. It now points to the immutable string literal @"Some value". However if I assign a value with [currentSection s

Re: Multithread communication

2010-02-03 Thread Alexander Spohr
Am 03.02.2010 um 17:30 schrieb McLaughlin, Michael P.: > Could someone recommend the "best" (most robust) way to pass back data from > threads to the main thread? Is there a good way to probe crashes such as > these? Right now, I cannot even tell where the error is really occurring. Try - (vo

Re: Select NSTextField mouse event

2010-02-03 Thread Jerry Krinock
On 2010 Feb 03, at 00:34, padmakumar wrote: > In my Cocoa based application, I am having a user editable NSTextField. > I need to know when the user selects the NSTextField using mouse. > I tried the delegate method controlTextDidChange, but the problem is user > need to enter an character to ge

Re: Multithread communication

2010-02-03 Thread Kyle Sluder
On Wed, Feb 3, 2010 at 8:30 AM, McLaughlin, Michael P. wrote: > In a multithreaded app using NSOperationQueue and targeting Leopard, I am > having an inordinate amount of trouble communicating the results of the > thread computations to the main thread which acts as an overall coordinator. Welcom

Re: another responder chain docs bug (validateUserInterfaceItem:)

2010-02-03 Thread Kyle Sluder
On Wed, Feb 3, 2010 at 1:02 AM, Jens Miltner wrote: > Well, in my experience the truth is somewhere between the two: > > AppKit seems to go up the responder chain and call > validateUserInterfaceItem: on each potential target (i.e. each responder > that responds to the action message and responds

Multithread communication

2010-02-03 Thread McLaughlin, Michael P.
In a multithreaded app using NSOperationQueue and targeting Leopard, I am having an inordinate amount of trouble communicating the results of the thread computations to the main thread which acts as an overall coordinator. Specifically, I am getting obscure and sporadic crashes (about 10 percent o

Re: Binding to an accessor that is only valid for subclass (was: Node hierarchy with subclasses)

2010-02-03 Thread Mike Abdullah
On 2 Feb 2010, at 06:39, BareFeet wrote: >> On Jan 29, 2010, at 9:38 AM, Jerry Krinock wrote: >> >>> >>> The problem is that when a subclass A is selected, the UI elements bound to >>> subclass B no longer have valid bindings so generate an error. How can I >>> solve this? >> >> You can also

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread cocoa-dev
Thanks Graham, here's what I'm thinking. The documents for my app are fileWrappers. Before the document is saved for the first time I can copy the files to a temp folder and during a save move them into the fileWrapper. I guess I need to just abandon the whole NSData idea altogether. Too bad

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Graham Cox
On 04/02/2010, at 1:08 AM, cocoa-dev wrote: > Is there an alternative to capture the data of a wrapper and a folder? Not really, because of what these things are. At best a folder could be reduced to a tree of data objects, which is what a wrapper is. But to reduce an arbitrary folder to a sin

Help with NSData dataWithContentsOfURL

2010-02-03 Thread cocoa-dev
I have an app that attaches a file to a document like when you attach a file to mail. I use the following to store the file as data in an iVar: fileData = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:(NSError **)errorPtr]; This works fine for regular files but not for

Re: Synthesize NSMutableString retain count question

2010-02-03 Thread Alexander Spohr
> currentSection = @"Some value"; has nothing to do with > [currentSection setString:@"Some value"]; The first sets currentSection to a string, the second sets the content of currentSection. a) In the second line you just set the content but you never assigned an NSMutableString to currentSec

Synthesize NSMutableString retain count question

2010-02-03 Thread Philip Vallone
Hi List, This is probably a very elementary question. I have a NSMutableString that I Synthesize. When I assigned a value to it: currentSection = @"Some value"; The retain count goes to 1 However if I assign a value with [currentSection setString:@"Some value"]; The retain count is still ze

Re: Cloning an NSXMLElement and its children?

2010-02-03 Thread Jeremy Pereira
On 3 Feb 2010, at 00:28, Robert Monaghan wrote: > Its a fairly deep copy. There are several nodes deep. > I am trying to copy parts of the tree, so that I don't have to write code to > regenerate them. No. The question was not "is your tree deep?" but is the "copy" method implemented by NSXML

Re: tab view look

2010-02-03 Thread Jens Miltner
Am 26.01.2010 um 23:24 schrieb Dave DeLong: http://www.positivespinmedia.com/dev/PSMTabBarControl.html FWIW, the code seems to have moved to google-code, packed as part of . IIRC, the PSMTabBarControl implementation there has additional features like tear

Re: another responder chain docs bug (validateUserInterfaceItem:)

2010-02-03 Thread Jens Miltner
Am 26.01.2010 um 00:31 schrieb Andy Lee: Semi-related to my previous post, I just filed rdar://7577360 (text below). As far as I can tell, it's a bug in the docs. --Andy The "Overview" at

Select NSTextField mouse event

2010-02-03 Thread padmakumar
In my Cocoa based application, I am having a user editable NSTextField. I need to know when the user selects the NSTextField using mouse. I tried the delegate method controlTextDidChange, but the problem is user need to enter an character to get this delegate invoked. My requirement was when ever