Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description: the date got a time zone, so it's stored in there but how on earth can I get to it? I only need the

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Markus Spoettl
On Sep 15, 2008, at 12:56 AM, Jason Coco wrote: All NSDate objects are stored as seconds since the reference date (Jan 1 1970 00:00 GMT) and so are always GMT. The description is using the default time zone to adjust the date. You can get the default time zone with [NSTimeZone

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jean-Daniel Dupas
Le 15 sept. 08 à 09:56, Jason Coco a écrit : On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description: the date got a time zone, so it's stored in there but

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 05:35 , Jean-Daniel Dupas wrote: Le 15 sept. 08 à 09:56, Jason Coco a écrit : On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description:

Getting NSTimeZone for a given NSDate

2008-09-15 Thread Markus Spoettl
Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description: the date got a time zone, so it's stored in there but how on earth can I get to it? I only need the GMT offset (numerically, not as string), in case

Setting the attributeModDate

2008-09-15 Thread Gerriet M. Denkmann
I am trying to copy a file using NSFilemanagers copyPath:toPath:handler: method. The (Tiger) documentation says: File or directory attributes—that is, metadata such as owner and group numbers, file permissions, and modification date—are also copied. Well, the attributeModDate is not. So

Re: Do I Need Multiple NSArrayControllers For This?

2008-09-15 Thread Jamie Phelps
On Thu, Sep 11, 2008 at 3:11 PM, Benjamin Stiglitz [EMAIL PROTECTED] wrote: By the way, another way to implement this is to set a property in a subclass of NSArrayController inside its -arrangeObjects: method. I found this

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread John Love
Ken Thomases wrote: [quote] Note that if you don't make your operation concurrent in this sense, but you queue it in an NSOperationQueue, that queue will still run it asynchronously, in its own thread, concurrently with other operations. It's just that, for non-concurrent operations,

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Benjamin Stiglitz
Excerpts from John Love's message of Mon Sep 15 11:02:21 -0400 2008: I must be doing something terribly wrong, because when I start up the NSOperationQueue that does some time consuming calculations, I do not get back control of my application until after the lengthy calculation is

Re: Do I Need Multiple NSArrayControllers For This?

2008-09-15 Thread Benjamin Stiglitz
I found this informationhttp://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindi ngs/Tasks/filtering.html#//apple_ref/doc/uid/20002302-128168-CJBCJCAIabout overriding -arrangeObjects: Since I need to return several different arrays of objects (active, new, and prior) how is this

Can't get to work setDoubleAction on NSMatrix with NSButtonCell

2008-09-15 Thread Oleg Krupnov
I've read all the docs and the archives of this list, but I can't seem to find what's wrong with my code: (in MyWindowController) @interface MyWindowController : NSWindowController { IBOutlet NSMatrix* matrix; } @end @implementation MyWindowController - (void)windowDidLoad { //

[SOLVED] Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-15 Thread Brad Gibbs
I had a panel controlled by a window controller that needed access to code in the main window's window controller. Panels are key windows, but not main windows. The responder chain rolls up through the panel's window controller (the key window chain) and then up through the main window's

Re: NSUInteger in for-loop?

2008-09-15 Thread Sean McBride
On 9/15/08 2:45 PM, Brett Powley said: Second problem (which you'll see if you change the NSLog): counter is unsigned, so it *never* turns negative. And gcc can catch these kinds of things! $ gcc-4.2 -framework Cocoa -std=c99 -Wall -Wextra ~/Desktop/test.m /Users/sean/Desktop/test.m: In

Re: Strange property behavior

2008-09-15 Thread atebits
Yes, at this line: NSString *n = [o someMethod].someProperty; the -someMethod method body is literally executed twice (control isn't handed back to the calling function until after the second return self;. - (MyTestClass *)someMethod { NSLog(@someMethod called); return self; }

Strange property behavior

2008-09-15 Thread Loren Brichter
I'm no fan of these newfangled Objective-C 2.0 features that you whippersnappers seem so excited about (call me old fashioned), but I'm giving properties a shot, especially now that I'm working on some stuff for [REDACTED]. I've notice something strange with properties that I hope someone can

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 11:02 , John Love wrote: I must be doing something terribly wrong, because when I start up the NSOperationQueue that does some time consuming calculations, I do not get back control of my application until after the lengthy calculation is complete. Here are the

Re: NSUInteger in for-loop?

2008-09-15 Thread Charles Srstka
On Sep 15, 2008, at 11:34 AM, Sean McBride wrote: And gcc can catch these kinds of things! $ gcc-4.2 -framework Cocoa -std=c99 -Wall -Wextra ~/Desktop/test.m /Users/sean/Desktop/test.m: In function 'main': /Users/sean/Desktop/test.m:7: warning: comparison of unsigned expression = 0 is

Re: NSUInteger in for-loop?

2008-09-15 Thread Sean McBride
On 9/15/08 12:48 PM, Charles Srstka said: -Wall yes, but -Wextra can get pretty obnoxious. In my experience, that one tends to flood you with unused parameter warnings every time you have an IBAction that doesn't use the sender parameter, or you have a notification handler that doesn't use the

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Quincey Morris
On Sep 15, 2008, at 10:31, Jason Coco wrote: You /should/, however, autorelease your NSOperation since your queue will retain it when you add it and release it when it completes. This sounds plausible, but I can't find anything in the documentation promising that NSOperationQueue will

Re: NSUInteger in for-loop?

2008-09-15 Thread Nathan Kinsinger
On Sep 15, 2008, at 11:54 AM, Sean McBride wrote: On 9/15/08 12:48 PM, Charles Srstka said: -Wall yes, but -Wextra can get pretty obnoxious. In my experience, that one tends to flood you with unused parameter warnings every time you have an IBAction that doesn't use the sender parameter, or

Cocoa Developer Position in San Jose, Ca

2008-09-15 Thread Darren Tessitore
Software Developer - COCOA Company:Confidential Job ID#:08082102 # of Positions: 1 Job Type: Full Time Permanent or Contract on-site Location: San Jose, Ca Contact:Darren Tessitore ([EMAIL PROTECTED]) Position

Re: referencing XML Data

2008-09-15 Thread Hal Mueller
Working from the simple NSXMLParser example from http://weblog.bignerdranch.com/?p=48 I suggest you use parser:didStartElement:... to look for customer and begin accumulating fields, and use parser:didEndElement:... to note completion of first_name, last_name, etc and react accordingly. In

Re: NSUInteger in for-loop?

2008-09-15 Thread Charles Srstka
On Sep 15, 2008, at 12:57 PM, Michael Ash wrote: gcc allows you to disable individual warnings. So using -Wall -Wextra -Wno-unused-parameter will give you all of the good warnings with none of the annoying unused parameter ones. In practice, this single warning is the only one I've found in the

Re: NSUInteger in for-loop?

2008-09-15 Thread Sean McBride
On 9/15/08 12:17 PM, Nathan Kinsinger said: Well, to each his own. I find it is a worthwhile tradeoff. For action methods, just do: - (IBAction)handleButton:(id)sender { (void)sender; ... } There is also #pragma unused, it's kind of ugly but is specific about the parameter

Re: Strange property behavior

2008-09-15 Thread dreamcat7
Hmm, Here is the assembly i think we can take a guess why NSString *n = [[o someMethod] someProperty]; 0x5d42 +0550 mov-0x28(%ebp),%edx 0x5d45 +0553 lea0x56a8(%ebx),%eax 0x5d4b +0559 mov(%eax),%eax 0x5d4d +0561 mov%eax,0x4(%esp) 0x5d51

Re: NSUInteger in for-loop?

2008-09-15 Thread Quincey Morris
On Sep 15, 2008, at 11:24, Sean McBride wrote: '#pragma unused' will cause some compilers to warn unknown pragma. Though, since this is the Cocoa list, and Cocoa is not really portable, I guess it doesn't matter. There's also the convenient macro __unused, which seems to work fine for

Re: NSXMLParser and character entities?

2008-09-15 Thread Kai
On 14.9.2008, at 10:45, Nathan Kinsinger wrote: On Sep 12, 2008, at 3:56 PM, Kai wrote: When NSXMLParser hits a character entity like auml; (- German umlaut 'ä'), it sends parser:resolveExternalEntityName:systemID: to its delegate and if this is not implemented or returns nil,

Re: Strange property behavior

2008-09-15 Thread Clark Cox
On Mon, Sep 15, 2008 at 9:37 AM, Loren Brichter [EMAIL PROTECTED] wrote: I'm no fan of these newfangled Objective-C 2.0 features that you whippersnappers seem so excited about (call me old fashioned), but I'm giving properties a shot, especially now that I'm working on some stuff for

Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
Hello, Is it safe to use -[NSApplication targetForAction:] with non-action selectors? For example, selectors that have more than one argument, non-id first argument, or return values? The documentation for targetForAction:to:from: seems to imply it just does a respondsToSelector: on

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 14:04 , Quincey Morris wrote: On Sep 15, 2008, at 10:31, Jason Coco wrote: You /should/, however, autorelease your NSOperation since your queue will retain it when you add it and release it when it completes. This sounds plausible, but I can't find anything in the

Re: NSXMLParser and character entities?

2008-09-15 Thread Nathan Kinsinger
On Sep 15, 2008, at 1:45 PM, Kai wrote: Of course if the content really is XHTML you should really be using an HTML parser and not an XML one. No, it isn’t. Just needs some way to encode all German characters. I’ll have to investigate whether simply using utf8 encoding is an option,

NSXMLParser

2008-09-15 Thread Mark Thomas
Hi All, Was wondering if somebody could answer how thread safe NSXMLParser is, as I need to use it with NSURL set to remote server and the response could take a while, so this why I want to put off into another thread. While I can see it can be used with a NSURL, is there a way I can do a

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Ken Thomases
On Sep 15, 2008, at 1:04 PM, Quincey Morris wrote: On Sep 15, 2008, at 10:31, Jason Coco wrote: You /should/, however, autorelease your NSOperation since your queue will retain it when you add it and release it when it completes. This sounds plausible, but I can't find anything in the

Re: BOOL array

2008-09-15 Thread Alex Reynolds
Of course there's always std::vector bool ;-) usually at 1 bit per bit... -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice Thanks for the tip. So I ended up going the route of making my .m files into .mm files, and using std::vector vectorBOOL to store

Re: BOOL array

2008-09-15 Thread Clark Cox
On Mon, Sep 15, 2008 at 2:43 PM, Alex Reynolds [EMAIL PROTECTED] wrote: Of course there's always std::vector bool ;-) usually at 1 bit per bit... -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice Thanks for the tip. So I ended up going the route of

Re: BOOL array

2008-09-15 Thread Ken Thomases
On Sep 15, 2008, at 4:43 PM, Alex Reynolds wrote: Is there a difference in the underlying storage between vectorBOOL and vectorbool? Yes! std::vector is a class template. There's a generic implementation provided that works with any type (within certain constraints), but there's a

Core Data and ordered relationships

2008-09-15 Thread Sean McBride
Hi all, There have been discussions in the past about the fact that relationships in Core Data are unordered (sets) instead of ordered (arrays). I have a vague question about this... In my model: entity 'Department' has a to-many relationship to entity 'Employee' named 'employees'. There are a

Re: BOOL array

2008-09-15 Thread Kyle Sluder
On Mon, Sep 15, 2008 at 5:43 PM, Alex Reynolds [EMAIL PROTECTED] wrote: Are there any downsides to creating Cocoa-based applications in Objective C++? If you're switching to Objective-C++ just to get std::vector, I would strongly suggest you reconsider. There are plenty of issues regarding

Re: Core Data and ordered relationships

2008-09-15 Thread Jamie Hardt
Hi- On Sep 15, 2008, at 2:55 PM, Sean McBride wrote: b) add an attribute named 'index' (value 1 to 6) and code methods named employee1, etc. in my NSManagedObject subclass? Certainly do the second one, unless there's some factor in your business logic that demands exactly six employees,

Re: BOOL array

2008-09-15 Thread Alex Reynolds
BOOL vs. bool aside (as well as a couple methods that return NSString* and throw NSException) I wanted to take a stab at making this particular class more portable. If I wrote it closer to the C++ STL spec, I could more easily use it in other contexts while writing my larger application in

Re: NameAndPassword Sample Code

2008-09-15 Thread Patrick Neave
Jason, I haven't read this yet, so I'm not sure if it will be useful or not, but it may... assuming you have two computers that you can use, anyway. HTH, J http://developer.apple.com/technotes/tn2008/tn2108.html I hadn't seen that, thanks. Regards, Patrick

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Quincey Morris
On Sep 15, 2008, at 14:35, Ken Thomases wrote: It's possible that it's not safe to release a NSOperation until after it returns YES to [NSOperation isFinished]. I don't think there needs to be anything specific in the documentation. In the absence of a documented exception, we should

Re: BOOL array

2008-09-15 Thread Ken Thomases
On Sep 15, 2008, at 5:16 PM, Alex Reynolds wrote: I also wanted to learn a bit about Objective-C++. What are the issues that involve exceptions? I find that NSExceptions I have in my larger application still work when I poke those. In the 32-bit runtime, Objective-C exceptions and C++

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Ken Thomases
On Sep 15, 2008, at 5:18 PM, Quincey Morris wrote: On Sep 15, 2008, at 14:35, Ken Thomases wrote: It's possible that it's not safe to release a NSOperation until after it returns YES to [NSOperation isFinished]. I don't think there needs to be anything specific in the documentation. In

MySQL?

2008-09-15 Thread J. Todd Slack
Hi All, Does anyone know what I need to connect from OS X to a MySQL DB and run a few queries? This would be from Objective-C or C++. Any examples? What should I be downloading? Thanks, -Jason ___ Cocoa-dev mailing list

Re: MySQL?

2008-09-15 Thread Chris Williams
I've been using MySQL-Cocoa and it works fine... Light, fast, easy: http://mysql-cocoa.sourceforge.net/ Documentation is sparse (non-existent), but it's a simple API that you can easily see by looking at the code. Had to recompile for intel, but that wasn't a big deal. From: J. Todd Slack

Re: MySQL?

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 18:59 , J. Todd Slack wrote: Hi All, Does anyone know what I need to connect from OS X to a MySQL DB and run a few queries? This would be from Objective-C or C++. Any examples? What should I be downloading? The MySQL C API is distributed with MySQL, so if you have

Re: Can't get to work setDoubleAction on NSMatrix with NSButtonCell

2008-09-15 Thread Graham Cox
On 16 Sep 2008, at 6:01 am, Robert Martin wrote: I wonder whether Button Cells are built to provide double-click actions (seems kind of weird if they do). Well, it works for me. In my case I have a palette of tool buttons. The single-click selects the tool, but the double-click provides

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Julien Jalon
It's not safe... once the target is found (using respondsToSelector:, you're right), the action is performed with:[target performSelector:actionSelector withObject:sender]; which means that anything but an object as a sender will potentially crash. The only safe thing you can image is to have an

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Graham Cox
On 16 Sep 2008, at 6:13 am, Dave Dribin wrote: Is it safe to use -[NSApplication targetForAction:] with non-action selectors? For example, selectors that have more than one argument, non-id first argument, or return values? The documentation for targetForAction:to:from: seems to imply it

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:30 PM, Julien Jalon wrote: It's not safe... once the target is found (using respondsToSelector:, you're right), the action is performed with: [target performSelector:actionSelector withObject:sender]; which means that anything but an object as a sender will potentially

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Charles Srstka
On Sep 15, 2008, at 3:13 PM, Dave Dribin wrote: Hello, Is it safe to use -[NSApplication targetForAction:] with non-action selectors? For example, selectors that have more than one argument, non-id first argument, or return values? The documentation for targetForAction:to:from: seems to

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:35 PM, Graham Cox wrote: What exactly are you trying to do? I'd say it's not safe, since that usage isn't anticipated, or necessary. If you could perhaps outline why you think you need it a better solution can be suggested. I've got, say, an info panel that needs to

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:56 PM, Graham Cox wrote: I think you have this a bit backwards, possibly. You still have to get notified when the first responder changes in order to tell your info panel to reorganise itself, so why not use that notification to directly obtain the correct target?

Re: Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-15 Thread Graham Cox
Anyone? I notice that this question has been asked numerous times in various forums across the 'net, with not one answer. So clearly it's an issue that several people have run into, but met with stony silence. Apparently the Font Panel UI is quite broken yet very few have ever noticed!

NSWindowController

2008-09-15 Thread Chris Idou
Sorry if this is a bit basic, but I can't figure out why my preference panel only comes up the first time. Second and subsequent times, nothing happens. I have this code linked to Preferences menu item: - (IBAction)preferences:(id)sender { if (nil == preferencesController) {

RE: MySQL?

2008-09-15 Thread Matthew Youney
Jason, Check out the CocoaMYSQL bundled framework, aka MCPKit. It is quite easy to use, and there is an example app (cocoamysql). My personal feelings are that we should all be using ODBC to connect to these DBs, however there is ODBC support under cocoa is presently pretty dicey, so we are

Re: NSPopupButton Bindings Content Objects is disabled

2008-09-15 Thread Rick Mann
On Sep 15, 2008, at 19:16:04, Rick Mann wrote: According to the docs: http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/Articles/ManagingPopUpItems.html You typically bind the contentObjects value of the button to the arrangedObjects of an array controller, and the

Re: NSWindowController

2008-09-15 Thread Chris Idou
Well, I'm using garbage collection. Anyway, I turned that option off in IB, but nothing changed. --- On Mon, 9/15/08, Chris Hanson [EMAIL PROTECTED] wrote: From: Chris Hanson [EMAIL PROTECTED] Subject: Re: NSWindowController To: [EMAIL PROTECTED] [EMAIL PROTECTED] Cc:

Re: NSWindowController

2008-09-15 Thread Graham Cox
On 16 Sep 2008, at 11:55 am, Chris Idou wrote: - (IBAction)preferences:(id)sender { if (nil == preferencesController) { preferencesController = [[NSWindowController alloc] initWithWindowNibName:@Preferences owner:self]; } [preferencesController showWindow:self]; } In the NIB, the

Re: NSWindowController

2008-09-15 Thread Chris Idou
That fixes it, but I thought the owner in this case was the owner of the NSWindowController, not the File's owner of the NIB. NSWindowController has an owner property. But if you're saying the owner is the File's owner, which is the NSWindowController itself, then what is the owner property

Re: NSWindowController

2008-09-15 Thread Graham Cox
On 16 Sep 2008, at 1:44 pm, Chris Idou wrote: That fixes it, but I thought the owner in this case was the owner of the NSWindowController, not the File's owner of the NIB. -initWithWindowNibName:owner: expects you to pass the object that is represented by File's Owner in the NIB.