Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock). [POST SAD REALISATION]

2009-02-21 Thread Luke Evans
Well, for now we're moving to a main-thread only model for Core Data access (I've created a little 'inter-thread thunk' toolkit for invoking the previously offending MOC-mutating methods on the main thread). I'm still curious about how the "MOC-per-thread, shared coordinator" approach wor

How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
Hi, Just take a look at any toolbar text in Leopard. It has a subtle, white shadow. How can I get this very same effect in my own app when using NSString's drawInRect method? What attributes to use? Do you have any sample code? Thanks, U.

Re: Window Animation with setFrame:display:animate: Flickers

2009-02-21 Thread Mike Abdullah
Did you need to target anything pre-Leopard? If not, I'd recommend using Core Animation instead of this method. It'll have the advantage of being GPU-powered and more importantly won't block the main thread during the animation (I frequently try to move the System Prefs somewhere more conv

Re: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Brandon Walkin
Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter NSBackgroundStyleRaised. That'll apply the exact same shadow that's used on toolbar item labels. Keep in mind that this method is Leopard-only. On 21-Feb-09, at 6:10 AM, Ulai Beekam wrote: Hi, Just take

Re: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Simone Tellini
Il giorno 21/feb/09, alle ore 12:22, Brandon Walkin ha scritto: Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter NSBackgroundStyleRaised. That'll apply the exact same shadow that's used on toolbar item labels. Keep in mind that this method is Leopard-only

infoForBinding not working as expected

2009-02-21 Thread David Niemeijer
Hi, I have an NSImageView and in IB have set it up so that it binds on "Value Path". Everything works fine, but when I subclass NSImageView and in my subclass want to get info about the binding and use [self infoForBinding:@"Value Path"] (or when I instead have bound to "Valueurl" use [

Programmatically opening an NSComboBox list

2009-02-21 Thread Peter Hudson
Have trawled the archives and can find only a suggestion to do a performClick on the combo ( which fails ) or an undocumented method. I notice from the docs that the button and text field are encapsulated in an NSComboBoxCell. Have checked the cell docs - can't see any means to get to the

Re: infoForBinding not working as expected

2009-02-21 Thread Ken Thomases
On Feb 21, 2009, at 5:57 AM, David Niemeijer wrote: I have an NSImageView and in IB have set it up so that it binds on "Value Path". Everything works fine, but when I subclass NSImageView and in my subclass want to get info about the binding and use [self infoForBinding:@"Value Path"] (or

RE: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
Is there no way to do it without a cell? I ask because I'm writing my own custom view and need to be able to do this with NSString's drawInRect, using a correct font attribute. The other poster's suggestion of just using a white text and shifting by 1.0 does not give me the desired effect since

Re: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Graham Cox
On 22/02/2009, at 1:22 AM, Ulai Beekam wrote: Is there no way to do it without a cell? I ask because I'm writing my own custom view and need to be able to do this with NSString's drawInRect, using a correct font attribute. The other poster's suggestion of just using a white text and shifti

Source code for Chess?

2009-02-21 Thread Christopher Nagel
Anyone have a copy of the old Chess example? I forgot its source was discontinued. Thanks, Chris ___ 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 c

How to get an "absolute" key path in code

2009-02-21 Thread Jerry Krinock
In Interface Builder, Inspector > Bindings, you can handily reach outside your object and bind to, for example, Application or User Defaults. But in code the 'keyPath' is always relative to the current object. In the following example, I have a view bound to a document's 'foo'. Although

Re: Source code for Chess?

2009-02-21 Thread Jean-Daniel Dupas
Le 21 févr. 09 à 16:00, Christopher Nagel a écrit : Anyone have a copy of the old Chess example? I forgot its source was discontinued. Thanks, Chris Really ? http://www.opensource.apple.com/darwinsource/10.5.6/Chess-109.0.3/ ___ Cocoa-dev mai

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Jeff Johnson
Ben, With all due respect, it's not your job to organize your users' virtual desktop, any more than it is to organize their real desktop, both of which may be cluttered. Some people put everything in its place, others leave stuff lying around, that's just a fact of life. In time, novice u

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Alex Kac
That may be true - but many people would be overjoyed if an app would offer to install itself into an appropriate place. Sometimes people are cluttered because they don't have someone to help. If an app offered to help - just once - I don't see that as an intrusion, but a more Mac-like feat

RegisterEventHotKey still the best way for global hotkeys

2009-02-21 Thread Jason Bobier
Hey there, before I use RegisterEventHotKey, I just wanted to make sure that it was still the only way to add a global hotkey to a machine? All that I really want to do is to cause my application to open when a hotkey is pressed if there happens to be a better way to do that. Thanks, Jas

Name to PSN

2009-02-21 Thread Pierce Freeman
Hi everyone. I am having a little trouble finding a way to go from the name of a process to its PSN. Maybe it's just something I have overlooked, but all the documentation seems to be going from the PSN to its name. My goal is to use the name of a particular process and "kill it" using Apple Eve

Re: Name to PSN

2009-02-21 Thread Ken Thomases
On Feb 21, 2009, at 10:57 AM, Pierce Freeman wrote: I am having a little trouble finding a way to go from the name of a process to its PSN. Maybe it's just something I have overlooked, but all the documentation seems to be going from the PSN to its name. My goal is to use the name of a pa

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Andreas Mayer
Am 21.02.2009 um 17:33 Uhr schrieb Alex Kac: If an app offered to help - just once - I don't see that as an intrusion, but a more Mac-like feature. Its not intrusive. I disagree. It's not an applications job to tell me where to put it. If, for some reason, it *must* be put in /Applications,

Re: Question on threads running in my Foundation tool

2009-02-21 Thread Shawn Erickson
On Fri, Feb 20, 2009 at 6:50 PM, Michael Vannorsdel wrote: > It should be more like: > >//create timer >//add timer to runloop > >CFRunLoopRun(); //code blocks here (not really since the loop is > running) until runloop exits due to no longer having observers or timers > >

Re: Name to PSN

2009-02-21 Thread Pierce Freeman
Hi Ken: Thanks for your reply. I see where you're coming from regarding NSWorkspace, and it seems like a great idea! How would you recommend scanning it? A loop or something else more creative? ;) Is there some reason it is better/easier to use the bundle identifiers instead of the name? And

Re: Name to PSN

2009-02-21 Thread Ken Thomases
On Feb 21, 2009, at 11:38 AM, Pierce Freeman wrote: Thanks for your reply. You're welcome. I see where you're coming from regarding NSWorkspace, and it seems like a great idea! How would you recommend scanning it? A loop or something else more creative? A loop, sure. The same way you

how to listen event 'did change my data'

2009-02-21 Thread Carlo Gulliani
I'm trying to modify apple's examples: Picture Sharing and Picture Sharing Browser I creating iphone's app, which is my server side (Picture Sharing), also i creating standalone's app, which is client side (Picture Sharing Browser), which i launched on my mac. It works great, but when i

Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see how the perhaps once canonical approach of having a setter release-then-retain (if the new value is not equal t

Re: Memory Management and @synthesized accessors

2009-02-21 Thread mmalc Crawford
On Feb 21, 2009, at 10:39 AM, Stuart Malin wrote: So, I am curious as to why the default (retain) behavior of @synthesize does just this? This is specified by atomicity, not 'retain'. "the goal of the atomic implementation is to provide robust accessors" (

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Ken Thomases
On Feb 21, 2009, at 12:39 PM, Stuart Malin wrote: I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see how the perhaps once canonical approach of having a setter re

Re: RegisterEventHotKey still the best way for global hotkeys

2009-02-21 Thread Eric Schlegel
On Feb 21, 2009, at 8:33 AM, Jason Bobier wrote: Hey there, before I use RegisterEventHotKey, I just wanted to make sure that it was still the only way to add a global hotkey to a machine? All that I really want to do is to cause my application to open when a hotkey is pressed if there hap

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Jean-Daniel Dupas
Le 21 févr. 09 à 19:39, Stuart Malin a écrit : I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see how the perhaps once canonical approach of having a setter rele

Re: Window Animation with setFrame:display:animate: Flickers

2009-02-21 Thread K. Darcy Otto
I had considered doing this with Core Animation, but it just seems simpler to get this working. Here is the code that I'm using (adapted from Hillegass, Chapter 29): -(void)displayViewController:(NSViewController *)vc { NSWindow *w = [self window]; NSView *v = [vc view];

Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).

2009-02-21 Thread Chris Hanson
On Feb 20, 2009, at 11:57 AM, Luke Evans wrote: My app has a table whose content shows files. The files that get shown here are stored in Core Data, the table is bound to the Core Data model to show the appropriate stuff. A background thread is started to spider through the file system loo

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
On Feb 21, 2009, at 9:22 AM, Ken Thomases wrote: On Feb 21, 2009, at 12:39 PM, Stuart Malin wrote: I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see how the per

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
On Feb 21, 2009, at 9:41 AM, Stuart Malin wrote: So, I am curious as to why the default (retain) behavior of @synthesize does just this? What makes you think it does? There is no concrete promise about how synthesized accessors are implemented, except that they conform to the declared

Re: Window Animation with setFrame:display:animate: Flickers

2009-02-21 Thread Markus Spoettl
On Feb 21, 2009, at 8:03 PM, K. Darcy Otto wrote: I had considered doing this with Core Animation, but it just seems simpler to get this working. Here is the code that I'm using (adapted from Hillegass, Chapter 29): -(void)displayViewController:(NSViewController *)vc { NSWindow *w =

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Gregory Weston
Alex Kac wrote: That may be true - but many people would be overjoyed if an app would offer to install itself into an appropriate place. Sometimes people are cluttered because they don't have someone to help. If an app offered to help - just once - I don't see that as an intrusion, but a more Ma

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Kevin Walzer
Gregory Weston wrote: To which I reiterate my prior comment: For more than a year now, Apple has been recommending the use of installer packages for all deployments. Apple is recommending installer packages instead of drag-and-drop installation of app bundles? Since when? Can you point to

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Nick Zitzmann
On Feb 21, 2009, at 1:15 PM, Kevin Walzer wrote: Apple is recommending installer packages instead of drag-and-drop installation of app bundles? Since when? Can you point to any docs about this? Looks like the documentation writers changed their minds about this:

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Alex Kac
Of course if you go with the OP's idea - then its almost like an installer pkg, but in a D&D install method. On Feb 21, 2009, at 2:46 PM, Nick Zitzmann wrote: It's a double-edged sword anyway. DnD installs are popular with Mac and NeXT veterans who are used to them, but they tend to confuse

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Gregory Weston
On Feb 21, 2009, at 3:15 PM, Kevin Walzer wrote: Gregory Weston wrote: To which I reiterate my prior comment: For more than a year now, Apple has been recommending the use of installer packages for all deployments. Apple is recommending installer packages instead of drag-and-drop insta

Re: Can't create windows with framework window nib

2009-02-21 Thread Tron Thomas
I found that if I derive a class from NSWindowController and use that in the frame work object then things work. It seems kind of silly to derive a class just for the purpose the inherited class doesn't implement anything above what NSWindowController offers, and is just simple a wrapper t

NSNotificationCenter : multiple messages sent to the same observer?

2009-02-21 Thread Iceberg-Dev
I just discovered something recently. If you register an observer with the same name/object/selector twice, you get the notification twice when you post it. Isn't the NSNotificationCenter supposed to prevent this? ___ Cocoa-dev mailing list (Cocoa-

NSOutlineView : Incorrect Drag and Drop drawing?

2009-02-21 Thread Iceberg-Dev
I have a NSOutlineView and its highlight mode is "SourceList". When I drag a selected item (the cell is a subclass of NSTextField from the DargAndDropOutlineView sample code) from the list, its text is drawn in white. This means you can't see it since most the of the windows background are

NSTreeController Content Array as index accessor object -- what is the ?

2009-02-21 Thread Stuart Malin
I'm confused using an NSTreeController. I have a node object that implements indexed accessors. This works. For I have an OutlineView that is bound to a nib instantiated instance of TreeController. My problem is this: First, I bound the TreeController's Content Array to an instance of MSM

Help with recursive includes

2009-02-21 Thread Aaron Wallis
Hi all, I'm working on a project which is much larger than what i'm used to, and i've come up to a bit of a brick wall. When I compile my application, I start getting build errors caused by recursive imports. I'm sure there's an easy way to get around it, but it currently alludes me. Here

Re: Help with recursive includes

2009-02-21 Thread Luke the Hiesterman
That error isn't caused by recursive includes (which are solved with #import anyway). That error means you defined an objective-c method and it's not in between an @implementation and @end - more than likely this definition occurs in TMPSTManagedFile.h. Luke On Feb 21, 2009, at 3:27 PM, Aa

Re: Help with recursive includes

2009-02-21 Thread Aaron Wallis
Yeah, I had a look at that already, it's definitely in the right spot: http://www.quicksnapper.com/d2kagw/image/untitled-0012 Interestingly enough, if I comment out the entry from the header file, I don't get the error? http://www.quicksnapper.com/d2kagw/image/untitled-0012 Aaron On 22/02/20

Re: Question on threads running in my Foundation tool

2009-02-21 Thread Michael Ash
On Sat, Feb 21, 2009 at 12:27 PM, Shawn Erickson wrote: > On Fri, Feb 20, 2009 at 6:50 PM, Michael Vannorsdel > wrote: >> It should be more like: >> >>//create timer >>//add timer to runloop >> >>CFRunLoopRun(); //code blocks here (not really since the loop is >> running)

Re: Help with recursive includes

2009-02-21 Thread Kiel Gillard
On 22/02/2009, at 10:27 AM, Aaron Wallis wrote: if I remove the #import "TMPSTManagedFile.h" from the header of the class and change it to @class TMPSTManagedFile the error goes away, and the application *would* run fine, if I didn't start getting errors caused from the ObjC 2.0 style prop

Re: Help with recursive includes

2009-02-21 Thread Aaron Wallis
Yeah, the header file is being imported in the .m file I tried moving the static out of the implementation, but I still get the errors... strange one 'eh On 22/02/2009, at 11:11 AM, Kiel Gillard wrote: On 22/02/2009, at 10:27 AM, Aaron Wallis wrote: if I remove the #import "TMPSTManagedFi

Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).

2009-02-21 Thread Michael Ash
On Fri, Feb 20, 2009 at 6:25 PM, Luke Evans wrote: > The more I'm getting to know Cocoa (we're still not intimate), the more it > seems that regular apps with UI making use of features like Core Data etc. > need to be architected very centrally around the main thread - it's only > easy/safe to use

Re: Can't create windows with framework window nib

2009-02-21 Thread Michael Ash
On Sat, Feb 21, 2009 at 5:12 PM, Tron Thomas wrote: > I found that if I derive a class from NSWindowController and use that in the > frame work object then things work. It seems kind of silly to derive a > class just for the purpose the inherited class doesn't implement anything > above what NSWi

Re: NSNotificationCenter : multiple messages sent to the same observer?

2009-02-21 Thread Michael Ash
On Sat, Feb 21, 2009 at 6:06 PM, Iceberg-Dev wrote: > I just discovered something recently. If you register an observer with the > same name/object/selector twice, you get the notification twice when you > post it. > > Isn't the NSNotificationCenter supposed to prevent this? Why, is there some pl

Re: Help with recursive includes

2009-02-21 Thread Michael Ash
On Sat, Feb 21, 2009 at 7:11 PM, Kiel Gillard wrote: > Towards the start of TMPSTLocalStore.m, you're declaring a static pointer > within the @implementation. I didn't think you could do this, I thought you > could only declare a static variable outside of the @implementation in the > .m file. Su

Re: Help with recursive includes

2009-02-21 Thread Aaron Wallis
I think i've found a work around, I altered the method to accept 'id' instead of 'TMPSTManagedFile' like so: -(NSString *)saveFileToStore:(id)tFile forDate:(NSDate *)tDate; I no longer get the error, but it's not an ideal compromise in the long run... If anyone has any other suggestions, I'd

Re: Help with recursive includes

2009-02-21 Thread Aaron Wallis
While that's always an option, it's not exactly the answer I was hoping to hear :D The good news is I was able to recreate the file in a considerably smaller scale and have uploaded the source here: http://junk.isnot.tv/test.zip As you can see, i've got two classes which include each others

Re: Source code for Chess?

2009-02-21 Thread Christopher Nagel
Yeah, Chess used to be shipped in /Developer/Examples and that's what was discontinued. Thanks for the reminder about opensource.apple.com. Chris On Feb 21, 2009, at 11:14 AM, Jean-Daniel Dupas wrote: Le 21 févr. 09 à 16:00, Christopher Nagel a écrit : Anyone have a copy of the old Chess

Re: NSTreeController Content Array as index accessor object -- what is the ?

2009-02-21 Thread Quincey Morris
On Feb 21, 2009, at 15:24, Stuart Malin wrote: I'm confused using an NSTreeController. I have a node object that implements indexed accessors. This works. For I have an OutlineView that is bound to a nib instantiated instance of TreeController. My problem is this: First, I bound the TreeC

Re: Help with recursive includes

2009-02-21 Thread Quincey Morris
On Feb 21, 2009, at 17:12, Aaron Wallis wrote: While that's always an option, it's not exactly the answer I was hoping to hear :D The good news is I was able to recreate the file in a considerably smaller scale and have uploaded the source here: http://junk.isnot.tv/test.zip As you can se

Re: Help with recursive includes

2009-02-21 Thread Quincey Morris
On Feb 21, 2009, at 17:36, Quincey Morris wrote: Nothing wrong, just failing to use @class for its intended purpose. :) #import @class ControllerB; @interface ControllerA : NSObject { ControllerB *myController; NSArray *fruit; } @property (readonly, getter=fruit) NSArray *fr

protocol vs. subclassing NSView

2009-02-21 Thread Development Staff
So I've got this app that uses various NSView subclasses (NSTextView, NSImageView, QTMovieView, etc.) to display different kinds of data in a window. The problem is that, when I need to select which kind of view to use for the current data, I have very different code for each kind of view (

Re: Help with recursive includes

2009-02-21 Thread Aaron Wallis
Awesome! Thanks Aaron! For everyone else, the .h file should contain @class ControllerB and the .m file imports ControllerB for the record On 22/02/2009, at 12:21 PM, Aaron Tuller wrote: check it...no warnings. -aaron At 12:12 PM +1100 2/22/09, Aaron Wallis wrote: While that's always an o

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-21 Thread Andreas Mayer
Am 21.02.2009 um 22:23 Uhr schrieb Alex Kac: Of course if you go with the OP's idea - then its almost like an installer pkg, but in a D&D install method. I still don't like it. And if every application did that, each one would do it slightly differently which is *not* a Mac like experience

Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).

2009-02-21 Thread Ken Ferry
On Sat, Feb 21, 2009 at 4:25 PM, Michael Ash wrote: > On Fri, Feb 20, 2009 at 6:25 PM, Luke Evans wrote: > > The more I'm getting to know Cocoa (we're still not intimate), the more > it > > seems that regular apps with UI making use of features like Core Data > etc. > > need to be architected ve

Define keyboard shortcut in System Preferences programmatically

2009-02-21 Thread Tverdokhleb Andrey
Hello all! I'm developing a plugin for some application which is accessible through it's menu bar, but unfortunately it's SDK doesn't allow to define keyboard shortcuts for menu items. If I define such shortcut in System Preferences for this application only it works just fine, but I'd re

Re: Surprising entanglement of UI lock during fetch request in background thread (NSViewHierarchyLock/MOC locking deadlock).

2009-02-21 Thread mmalc Crawford
On Feb 20, 2009, at 3:25 PM, Luke Evans wrote: OK, that's too bad. I was suckered into thinking that following a locking regime (one of the suggested "how to use Core Data in a multithreaded environment" approaches) would allow things to work satisfactorily and provide the freedom to muta

Re: Name to PSN

2009-02-21 Thread Pierce Freeman
Just got a chance to look into your replies... So here are my questions/comments. > A loop, sure. The same way you enumerate any array. Fast enumeration > if you're targeting Leopard, or using an index or NSEnumerator. Okay, sounds good. > A bundle ID is guaranteed to be unique and stable. W

Re: Name to PSN

2009-02-21 Thread Jerry Krinock
On 2009 Feb 21, at 20:21, Pierce Freeman wrote: On another topic: Is there someway to have NSWorkspace show all the processes open? Right now it is showing me the applications, but the process that I'm targeting isn't really an application and doesn't have an interface. If I recall correc