using OpenPanel to select volumes?

2008-08-24 Thread Angelo Chen
Hi, I use following code to select a volume, it works, but it also give the user chance to select directory as well, how to disable selection of directories, only allow volumes? thanks, NSOpenPanel *oPanel = [OpenPanel openPanel]; [oPanel setCanChooseFiles:NO]; [oPanel

Re: textfield not updating with bindings - Whats wrong?

2008-08-24 Thread Kieren Eaton
On 24/08/2008, at 2:30 PM, Scott Anguish wrote: On 23-Aug-08, at 11:53 PM, Kieren Eaton wrote: I have one minor question now that I am understanding bindings more. Is is good policy to add an object controller instead of just binding directly to the class? Yes. Especially when using

Re: How to read pixel values of monochrome images

2008-08-24 Thread Jean-Daniel Dupas
Le 24 août 08 à 05:55, John C. Randolph a écrit : On Aug 23, 2008, at 2:51 PM, Shawn Erickson wrote: On Fri, Aug 22, 2008 at 2:54 AM, Eduardo Areitio [EMAIL PROTECTED] wrote: I'm trying to read individual pixel values in a monochrome image using NSReadPixel, but I haven't been able to.

Re: specify a NSPredicate for jpeg file names?

2008-08-24 Thread Mike Abdullah
Trying to base entirely upon filename extensions is a bad idea. Instead, iterate through the directory and check each file's UTI to see if it conforms to kUTTypeJPEG. Mike. On 24 Aug 2008, at 01:39, Angelo Chen wrote: Hi, I'd like to filter an array to return only jpeg file names like

Core data entity creation design

2008-08-24 Thread Steven Hamilton
Hi folks, I have a Core Data model which contains two entities. I have a tableview with the standard bindings arrangement and Add/Remove buttons handling one of the entities. What I need to achieve is that when the Add button is pressed both entity types are created, not just the one

Re: ObjC 2.0, properties, KVC, special _ hacks etc.

2008-08-24 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 04:59 schrieb Thomas Engelmeier: Am 22.08.2008 um 00:59 schrieb Dave MacLachlan: Also, are the _ in front of member variables for Apple only (so we don't stomp on each other with member var names) or are they using them for the readability reason mentioned above?

Nil Object Crashing KVO

2008-08-24 Thread Gordon Apple
I¹m having a problem that only shows up in Release mode. I have an object that should have ³editLayer² ivar automatically initialized to nil. A second object has a KVO on this ivar property. When the first object calls setEditLayer (as a result of it¹s own KVO notification observation from

Re: Reading from Streams - Convenience methods

2008-08-24 Thread Jean-Daniel Dupas
Le 24 août 08 à 09:29, Ananda Bollu a écrit : Hi, What is the best way to read and write data to a Stream. In Java, DataInputStream and DataOutputStream classes provide various serialization methods such as, readInt(), readLong(), readBoolean() etc. Is there anything equivalent for

Re: Core data entity creation design

2008-08-24 Thread Quincey Morris
On Aug 24, 2008, at 03:17, Steven Hamilton wrote: I have a Core Data model which contains two entities. I have a tableview with the standard bindings arrangement and Add/Remove buttons handling one of the entities. What I need to achieve is that when the Add button is pressed both entity

Re: ObjC 2.0, properties, KVC, special _ hacks etc.

2008-08-24 Thread Negm-Awad Amin
Am So,24.08.2008 um 16:09 schrieb Thomas Engelmeier: Am 24.08.2008 um 05:59 schrieb John C. Randolph: On Aug 21, 2008, at 7:59 PM, Thomas Engelmeier wrote: Am 22.08.2008 um 00:59 schrieb Dave MacLachlan: Also, are the _ in front of member variables for Apple only (so we don't stomp

Re: Nil Object Crashing KVO

2008-08-24 Thread Ken Thomases
On Aug 24, 2008, at 9:00 AM, Gordon Apple wrote: I’m having a problem that only shows up in Release mode. I have an object that should have “editLayer” ivar automatically initialized to nil. A second object has a KVO on this ivar property. When the first object calls setEditLayer (as a

Re: Core data entity creation design

2008-08-24 Thread Dave Fernandes
If the second entity is instantiated whenever the first is, then you can just add code to create the second entity (NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:) inside the awakeFromInsert method of the first object. Thus, you only have to explicitly create

Semi-transparent, blurred NSWindow background?

2008-08-24 Thread Tim Andersson
Hi there, Is there any way of creating a NSWindow that has a semi-transparent, blurred background? With blurred background I mean that whatever you see through the window/background is distorted (blurred). Any help is appreciated, Tim Andersson

Semi-transparent, blurred NSWindow background?

2008-08-24 Thread Tim Andersson
Hi there, Is there any way of creating a NSWindow that has a semi-transparent, blurred background? With blurred background I mean that whatever you see through the window/background is distorted (blurred). Any help is appreciated, Tim Andersson

DO disconnect when main thread blocked

2008-08-24 Thread Ben Einstein
Hi, I have multiple DO connections to a client system over the LAN (technically, each of 4 systems is a server, but it doesn't much matter). The 4 systems check to ensure my system is alive by pinging it every few seconds with a simple - (BOOL)clientIsThere method. This ping routine runs

Re: Nil Object Crashing KVO

2008-08-24 Thread Gordon Apple
10.5.4, MacBookPro 2.4 GHz Intel Core 2 Duo. Only console message is Program received signal: ³EXC_BAD_ACCESS². #00x9595c6e8 in objc_msgSend #10x924415d3 in _NSValueOfClassWithSpecialSpecificErrorMessage #20x924410b4 in -[NSArrayDetailBinder _refreshDetailContentInBackground:] #3

Re: Nil Object Crashing KVO

2008-08-24 Thread Ken Thomases
On Aug 24, 2008, at 11:58 AM, Gordon Apple wrote: 10.5.4, MacBookPro 2.4 GHz Intel Core 2 Duo. Only console message is Program received signal: “EXC_BAD_ACCESS”. #00x9595c6e8 in objc_msgSend #10x924415d3 in _NSValueOfClassWithSpecialSpecificErrorMessage #20x924410b4 in

Re: DO disconnect when main thread blocked

2008-08-24 Thread Ken Thomases
On Aug 24, 2008, at 11:54 AM, Ben Einstein wrote: I have multiple DO connections to a client system over the LAN (technically, each of 4 systems is a server, but it doesn't much matter). The 4 systems check to ensure my system is alive by pinging it every few seconds with a simple -

Re: Nil Object Crashing KVO

2008-08-24 Thread Gordon Apple
Thank you, thank you, Thank you! You gave me the key without even realizing it. I had just wanted to give a running version to someone who was visiting and had quickly tried to compile a release version. I stupidly assumed the release version would keep the same project settings except for

StatusItem to foreground app

2008-08-24 Thread Steve Cronin
Folks; I'm building a tool that I want to allow the user switch 'modes' either running as a menubar statusItem or as regular dock-based application. NOTE: The info.plist has LSUIElement=1. If the user designates the application to run as regular dock-based application then, early in

Re: StatusItem to foreground app

2008-08-24 Thread Ken Thomases
On Aug 24, 2008, at 4:02 PM, Steve Cronin wrote: NOTE: The info.plist has LSUIElement=1. If the user designates the application to run as regular dock-based application then, early in startup, I do: ProcessSerialNumber psn = { 0, kCurrentProcess }; OSStatus returnCode =

*** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50

2008-08-24 Thread Cate Tony
This was a surprise. Here's the relevant code: - (void)saveDocumentAs:(id)sender { NSSavePanel *panel = [NSSavePanel savePanel]; [panel setRequiredFileType:@abcd]; [panel beginSheetForDirectory: [documentPath stringByDeletingLastPathComponent]

Re: Core Data Question 1

2008-08-24 Thread R T
On Aug 19, 2008, at 21:39, R T wrote: I have a Core Data Document-based Application.a document window with a tableview, a text view and a button. When the button is selected, a number is read from the text field and that many objects are programatically added to the tableview. Then

How to control the order of enumerating on a NSDictionary

2008-08-24 Thread JArod Wen
Hi Jedis, I wrote codes to add column information into a NSDictionary and then added each of them into a NSTableView as column. I got the key-value pairs in NSDictionary as following: ang (A) = 2; dis (D) = 1; pos (P) = 0; shp (S) = 3; Then I used an

Re: How to control the order of enumerating on a NSDictionary

2008-08-24 Thread Graham Cox
On 25 Aug 2008, at 9:36 am, JArod Wen wrote: It should be the problem when enumerating the dictionary, right? How can I control the order of enumerating? You can't if you enumerate the keys directly - there is no concept of order for the items of a dictionary. But you can copy them

Re: *** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50

2008-08-24 Thread Kyle Sluder
On Sun, Aug 24, 2008 at 6:03 PM, Cate Tony [EMAIL PROTECTED] wrote: If I put a retain on the panel, the error stops, but isn't it now leaking? No. You took ownership of the NSSavePanel when you created it by using a convenience constructor. You must retain it, and release it when you're done

Re: Core Data Question 1

2008-08-24 Thread Kyle Sluder
On Sun, Aug 24, 2008 at 6:05 PM, R T [EMAIL PROTECTED] wrote: So I think that the NSManagedObjectContext *moc is the property of the document that the sheet needs. How can amtSheetWindowController be initialized with this property? How can I bind amtSheetTableController in the XIB file ?

CFBoolean

2008-08-24 Thread Chris Idou
How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness of having to fall back to Carbon for such a fundamental thing, the

Re: CFBoolean

2008-08-24 Thread Jason Coco
On Aug 24, 2008, at 21:33 , Chris Idou wrote: How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness of having to fall back

Re: CFBoolean

2008-08-24 Thread Kyle Sluder
On Sun, Aug 24, 2008 at 9:33 PM, Chris Idou [EMAIL PROTECTED] wrote: How do I create a property in the user defaults of type boolean? +[NSNumber numberWithBool:] --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: CFBoolean

2008-08-24 Thread Sherm Pendley
On Sun, Aug 24, 2008 at 9:33 PM, Chris Idou [EMAIL PROTECTED] wrote: How do I create a property in the user defaults of type boolean? [[NSUserDefaults standardUserDefaults] setBool:TRUE forKey:@SomeBoolKey]; sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: CFBoolean

2008-08-24 Thread Nathan Kinsinger
On Aug 24, 2008, at 7:33 PM, Chris Idou wrote: How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness of having to fall

Re: CFBoolean

2008-08-24 Thread Phil
On Mon, Aug 25, 2008 at 1:33 PM, Chris Idou [EMAIL PROTECTED] wrote: How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness

Re: CFBoolean

2008-08-24 Thread Chris Idou
--- On Sun, 8/24/08, Phil [EMAIL PROTECTED] wrote: http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/XMLPListsConcept.html I'm curious as to why you need a boolean, rather than just what -setBool:forKey: gives you? Because I have an array containing

Text Fields not Updating when Overridden setNilValueForKey: Called

2008-08-24 Thread Marc Blatt
Hello All, While determining if the 10.4+ formatter has a bug re failing to call the overridden setNilValueForKey: (which I have determined that it does), I wrote the following code: - (void)setNilValueForKey:(NSString *)key { if ([key isEqual:@unformattedNumber]) {

Re: How to control the order of enumerating on a NSDictionary

2008-08-24 Thread JArod Wen
Thanks man, I got your idea. On Aug 24, 2008, at 7:43 PM, Graham Cox wrote: On 25 Aug 2008, at 9:36 am, JArod Wen wrote: It should be the problem when enumerating the dictionary, right? How can I control the order of enumerating? You can't if you enumerate the keys directly - there is

Re: How to control the order of enumerating on a NSDictionary

2008-08-24 Thread JArod Wen
Hi Mike, I just want to make sure that the following is sent by you directly or someone else. On Aug 24, 2008, at 11:01 PM, Mike wrote: You stupid moron. Did you even read Apple's documentation? Apparently not. If you had, you would have learned that dictionaries on OS X do not support

Re: Semi-transparent, blurred NSWindow background?

2008-08-24 Thread Rob Keniger
On 25/08/2008, at 2:45 AM, Tim Andersson wrote: Is there any way of creating a NSWindow that has a semi-transparent, blurred background? With blurred background I mean that whatever you see through the window/background is distorted (blurred). In 10.5 you can add any core image filter to

Re: Semi-transparent, blurred NSWindow background?

2008-08-24 Thread Kyle Sluder
On Mon, Aug 25, 2008 at 12:13 AM, Rob Keniger [EMAIL PROTECTED] wrote: Insert standard disclaimer about using private Apple APIs here. And, additionally, please file an enhancement request at http://bugreport.apple.com because this functionality seems quite handy. --Kyle Sluder

Re: File Extensions Problem

2008-08-24 Thread Andrew Merenbach
On Aug 21, 2008, at 11:29 PM, Adil Saleem wrote: Hi, I want to display in a tableview, list of all media files (audio, video files) present in a certain directory. Currently what i am doing is that i am getting the file names in an NSMutableArray using NSFileManager function

Re: *** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50

2008-08-24 Thread Graham Cox
On 25 Aug 2008, at 11:09 am, Kyle Sluder wrote: On Sun, Aug 24, 2008 at 6:03 PM, Cate Tony [EMAIL PROTECTED] wrote: If I put a retain on the panel, the error stops, but isn't it now leaking? No. You took ownership of the NSSavePanel when you created it by using a convenience constructor.