Re: Getting warning when saving merged MOC

2010-01-05 Thread Rob Keniger
On 05/01/2010, at 5:35 PM, Rick Mann wrote: Am I doing something wrong, or failing to take some step to avoid this confusion? There may be legitimate changes in MOC A that need to be saved, but the merged changes should already be in the store. When doing things like this that you don't

Re: Getting warning when saving merged MOC

2010-01-05 Thread Rick Mann
On Jan 5, 2010, at 00:07:55, Rob Keniger wrote: On 05/01/2010, at 5:35 PM, Rick Mann wrote: Am I doing something wrong, or failing to take some step to avoid this confusion? There may be legitimate changes in MOC A that need to be saved, but the merged changes should already be in the

Re: iPhone: NSXMLParser problems

2010-01-05 Thread Jeremy Pereira
On 5 Jan 2010, at 05:09, Eric E. Dolecki wrote: - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { NSLog(@didStartElement); //not sure how to

Re: iPhone: NSXMLParser problems

2010-01-05 Thread Eric E. Dolecki
Immediately after the [parser parse] I check it: if( [parser parseError]){ NSLog(@parse error); } This always fires - but I think that the XML is valid. My delegate methods aren't firing at all - so I don't think it's a namespace issue. Does the code seem okay? If I dump the stringReply

Using AppleEvents to copy and past text from any application

2010-01-05 Thread Jesse Grosjean
I'm developing a small open source app called QuickCursor. - http://www.hogbaysoftware.com/products/quickcursor/ - http://github.com/jessegrosjean/quickcursor The idea is to replace the input manage based edit in features with a generic program that provides the same feature, but using public

Re: Turn off font hinting?

2010-01-05 Thread Jean-Daniel Dupas
Le 5 janv. 2010 à 16:44, Sander Stoks a écrit : I don't think Quartz's text renderer uses hinting in the normal sense; this is part of why text looks different on Mac than on Windows. (Subpixel anti-aliasing largely removes the need for hinting, and makes the hints actually mess up the shape

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread Jean-Daniel Dupas
Le 5 janv. 2010 à 16:46, Jesse Grosjean a écrit : I'm developing a small open source app called QuickCursor. - http://www.hogbaysoftware.com/products/quickcursor/ - http://github.com/jessegrosjean/quickcursor The idea is to replace the input manage based edit in features with a generic

How to enforce a single NSDocument ... or should I do something else?

2010-01-05 Thread Martin Stanley
I have a Core-Date application that uses the Cocoa Document architecture (NSPersistentDocument) and would like to ensure that the user only can have 1 document open at a time. Think of this application as similar to Mail.app or Addressbook.app, etc. except that I would like the user to be able

Re: How to enforce a single NSDocument ... or should I do something else?

2010-01-05 Thread Mike Abdullah
Override -openDocumentWithContentsOfURL: 1. If you've already got a document open, send -canCloseDocument… to the open document, supplying the callback info 2. Either: A) Return nil and an NSUserCancelled error. B) Return the existing document. 3. When you get the callback from

Re: Turn off font hinting?

2010-01-05 Thread Alastair Houghton
On 4 Jan 2010, at 21:47, Sander Stoks wrote: I wrote some code to draw an NSString rotated by an arbitrary angle, which can be manipulated interactively. The results are surprisingly bad (compared to how good font rendering is in general on the Mac). Most notably, the character positions

Re: How to enforce a single NSDocument ... or should I do something else?

2010-01-05 Thread Martin Stanley
Thanks for the very quick response! I don't quite understand step 2: how do I decide what to return from -openDocumentWithContentsOfURL: if the callback hasn't been called yet and therefore I don't know if the user cancelled the close of the first document? I think the basic problem for me

Re: New Tablet

2010-01-05 Thread Shawn Erickson
On Tue, Jan 5, 2010 at 9:33 AM, Gordon Apple g...@ed4u.com wrote: I realize that we are not going to get any answers here at this time.  My question is whether developer info will be forthcoming simultaneously with the announcement expected later this month (according to today's WSJ article).  

Re: Getting warning when saving merged MOC

2010-01-05 Thread Rick Mann
On Jan 5, 2010, at 05:30:59, Quincey Morris wrote: On Jan 4, 2010, at 23:35, Rick Mann wrote: I'm slowly but surely getting the hang of using multiple MOCs. I'm successfully creating objects in MOC B and merging those changes into the existing MOC A, and seeing the UI bound to MOC A

problem binding search field predicate to derived core data property

2010-01-05 Thread Martin Hewitson
Dear list, I have a core-data entity which has a derived read only property declared as below. I then have a search field on the UI with a predicate bound to the array controller for the entity with the predicate format being: contentString contains $value When I run this the app crashes and

iPhone: @protocol and @optional

2010-01-05 Thread John Michael Zorko
Hello, all ... After [re-]reading the Apple documentation, i'm still not clear as to what @optional really does in a @protocol. I thought that declaring certain messages as @optional would make the app not crash if a certain message didn't have an implementation in a class that adopts the

Re: iPhone: @protocol and @optional

2010-01-05 Thread Dave DeLong
@optional is a compile-time directive. It means that objects that conform to your protocol don't *have* to implement the method when the code is compiled. However, it has nothing to do with runtime-verification. That is up to you (so yes, you should be using respondsToSelector:). If you

Re: How to enforce a single NSDocument ... or should I do something else?

2010-01-05 Thread Mike Abdullah
On 5 Jan 2010, at 17:34, Martin Stanley wrote: Thanks for the very quick response! I don't quite understand step 2: how do I decide what to return from -openDocumentWithContentsOfURL: if the callback hasn't been called yet and therefore I don't know if the user cancelled the close of

Re: iPhone: @protocol and @optional

2010-01-05 Thread Christian Ziegler
Bah Dave was faster :). John, you can see it this way: With the @optional directive you tell the compiler not to complain if those methods are missing in your class implementing the protocol, still the class which invokes those optional methods has to ensure that those are implemented.

Re: iPhone: @protocol and @optional

2010-01-05 Thread Mike Abdullah
Protocols cannot decide or change behaviour of an object. Instead, it is up to the object in question to adopt the protocol appropriately. Declaring methods as @optional just means that you have a choice whether to implement or not. Anyone wanting to call the method should first check if its

Re: iPhone: @protocol and @optional

2010-01-05 Thread John Michael Zorko
Mike et al, OK, I get it -- @optional in a @protocol is kind of like #pragma warning: in (MS) C++ in that it just tells the compiler to not generate specific warnings, in this case warnings about a class that doesn't fully implement the protocol. I thought it would automatically call

Re: NSDate without time portion

2010-01-05 Thread Chris Ridd
On 4 Jan 2010, at 13:50, Quincey Morris wrote: On Jan 4, 2010, at 02:26, Brian Bruinewoud wrote: What's the best way to get an NSDate object for 'today' such that the time is 00:00:00 (or any other constant). I not interested in the time, I only care about the year-month-day, but I do

Re: NSDate without time portion

2010-01-05 Thread David Duncan
On Jan 5, 2010, at 11:23 AM, Chris Ridd wrote: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what would you do? The typical approach is to normalize your dates to a specific time before storing

Re: NSDate without time portion

2010-01-05 Thread Robert Claeson
On 5 Jan 2010, at 19:23, Chris Ridd wrote: On 4 Jan 2010, at 13:50, Quincey Morris wrote: On Jan 4, 2010, at 02:26, Brian Bruinewoud wrote: What's the best way to get an NSDate object for 'today' such that the time is 00:00:00 (or any other constant). I not interested in the time, I

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread Nick Paulson
If you have a solution to this, please report back. I am interested in what you come up with. --Nick Paulson On Jan 5, 2010, at 11:10 AM, Jesse Grosjean wrote: I know most apps don't support AppleScript directly, but I thought there was some way to automatically script the menu items of most

Re: NSDate without time portion

2010-01-05 Thread Nick Zitzmann
On Jan 5, 2010, at 12:23 PM, Chris Ridd wrote: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what would you do? Normalize the time component of the date. One idea is to use 12 PM GMT as a constant

Re: NSDate without time portion

2010-01-05 Thread Karolis Ramanauskas
By formatting the dates as MMDD and keeping them in strings you can use simple string comparison to sort, compare and filter. They are also very easy to format for display purposes. If you want to go standard then use the ISO 8601 date format. It's -MM-DD. See

Re: Getting warning when saving merged MOC

2010-01-05 Thread Quincey Morris
On Jan 5, 2010, at 10:39, Rick Mann wrote: I grant that I'm using NSPersistentDocument in a nonstandard way. I have a Library of Parts (and a Group hierarchy). This Library is managed by a LibraryDoc which inherits from NSPersistentDocument, and I consider this use to be standard. When the

Re: NSDate without time portion

2010-01-05 Thread glenn andreas
On Jan 5, 2010, at 1:48 PM, Karolis Ramanauskas wrote: By formatting the dates as MMDD and keeping them in strings you can use simple string comparison to sort, compare and filter. They are also very easy to format for display purposes. If you want to go standard then use the ISO 8601

[Moderator] Re: New Tablet

2010-01-05 Thread Scott Anguish
This type of speculation is not appropriate for this list. Discussion of this type will end up with the poster moderated, thusly. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: NSDate without time portion

2010-01-05 Thread Quincey Morris
On Jan 5, 2010, at 11:31, David Duncan wrote: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what would you do? The typical approach is to normalize your dates to a specific time before storing

Re: NSDate without time portion

2010-01-05 Thread David Duncan
On Jan 5, 2010, at 12:15 PM, Chris Ridd wrote: On 5 Jan 2010, at 19:41, Nick Zitzmann wrote: On Jan 5, 2010, at 12:23 PM, Chris Ridd wrote: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what

Re: NSDate without time portion

2010-01-05 Thread Karolis Ramanauskas
NSDate conceptually store time relative to Jan 1, 2001, GMT. When it is formatted for display, it uses the current time zone (or more correctly, the NSDateFormatter uses whatever time zone has been specified, or the current system time zone). If your time zone changes (such as by daylight

Re: NSDate without time portion

2010-01-05 Thread Nick Zitzmann
On Jan 5, 2010, at 1:23 PM, Quincey Morris wrote: Firstly, you can't *in general* normalize to a specific time, because you can't in general know that the time exists on every date. Unless you use a specific time zone, and store that time zone information elsewhere in the model. And if you

Re: NSDate without time portion

2010-01-05 Thread Robert Claeson
On 5 Jan 2010, at 20:33, Nick Zitzmann wrote: On Jan 5, 2010, at 1:23 PM, Quincey Morris wrote: Firstly, you can't *in general* normalize to a specific time, because you can't in general know that the time exists on every date. Unless you use a specific time zone, and store that time

Re: NSDate without time portion

2010-01-05 Thread Nick Zitzmann
On Jan 5, 2010, at 1:40 PM, Robert Claeson wrote: Not really. We use GMT (Greenwich, the G in GMT, is in North London) here in the UK and we do have daylight savings. GMT without daylight savings or any other features are commonly referred to as UTC nowadays. To be pedantic, you are

Resolution Independence

2010-01-05 Thread Todd Heberlein
A friend of mine loves her new 27 iMac but has complained at how small everything is. Searching around on the net I found that it has about a 109 dpi pixel density. I also saw today that the new Nexus phone has a pixel size of 800x480 (as opposed to my iPhone's 480x320 pixel size), and the two

Re: NSDate without time portion

2010-01-05 Thread Sean McBride
On 1/5/10 7:23 PM, Chris Ridd said: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what would you do? Core Data has the concept of a 'transformable' type. You can use it to store an NSDateComponents

Re: NSDate without time portion

2010-01-05 Thread mmalc Crawford
On Jan 5, 2010, at 12:40 pm, Robert Claeson wrote: (Greenwich, the G in GMT, is in North London) Well, if we're being pedantic, South East of London, actually...

Re: NSDate without time portion

2010-01-05 Thread Quincey Morris
On Jan 5, 2010, at 12:33, Nick Zitzmann wrote: On Jan 5, 2010, at 1:23 PM, Quincey Morris wrote: Firstly, you can't *in general* normalize to a specific time, because you can't in general know that the time exists on every date. Unless you use a specific time zone, and store that time

Re: NSDate without time portion

2010-01-05 Thread Robert Claeson
On 5 Jan 2010, at 20:59, mmalc Crawford wrote: On Jan 5, 2010, at 12:40 pm, Robert Claeson wrote: (Greenwich, the G in GMT, is in North London) Well, if we're being pedantic, South East of London, actually...

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread has
Jesse Grosjean wrote: I'm developing a small open source app called QuickCursor. [...] Services no good? Only alternative I can think of would be to send Cmd-C/Cmd-V keystrokes, and hope that the user has the right text selected at the time. has -- Control AppleScriptable applications

NSSavePanel with accessory view and file types popup

2010-01-05 Thread jeffs87
Hi, I'm trying to add a custom accessory view to an NSSavePanel with a file types popup and a couple other controls. When shouldRunSavePanelWithAccessoryView returns YES for the default accessory view, the type popup works as expected when dataRepresentationOfType is invoked, the correct

Re: Resolution Independence

2010-01-05 Thread Ricky Sharp
On Jan 5, 2010, at 2:50 PM, Todd Heberlein wrote: A friend of mine loves her new 27 iMac but has complained at how small everything is. Searching around on the net I found that it has about a 109 dpi pixel density. I also saw today that the new Nexus phone has a pixel size of 800x480 (as

Re: NSSavePanel with accessory view and file types popup

2010-01-05 Thread Kyle Sluder
On Tue, Jan 5, 2010 at 1:21 PM, jeff...@aol.com wrote: I know dataRepresentationOfType is depreciated, but I would like 10.3 compatibility.  http://adium.im/sparkle shows what OS their users have and it does not show a lot of people still using 10.3.  Does anyone on this list still support

Window Groups in Cocoa

2010-01-05 Thread Eric Gorr
Was the window group feature (CreateWindowGroup, etc.) in the Carbon UI carried forward into Cocoa? As near I can tell, it was not. The primary feature I need from the Carbon UI is kWindowGroupAttrMoveTogether. So, assuming I haven't missed anything, and if you've needed this yourself, how

Re: NSDate without time portion

2010-01-05 Thread Kyle Sluder
On Tue, Jan 5, 2010 at 1:23 PM, mmalc Crawford mmalc_li...@me.com wrote: An NSDate object represent a single point in time -- you can think of it basically as a wrapper for an NSTimeInterval from the reference date.  If you want to create components from the date, then you must do so with

Re: Window Groups in Cocoa

2010-01-05 Thread Kyle Sluder
On Tue, Jan 5, 2010 at 1:30 PM, Eric Gorr mail...@ericgorr.net wrote: Was the window group feature (CreateWindowGroup, etc.) in the Carbon UI carried forward into Cocoa? Not as flexibly, but take a look at -[NSWindow addChildWindow:ordered:]. --Kyle Sluder

Re: Window Groups in Cocoa

2010-01-05 Thread Jesper Storm Bache
There is no 1 to 1 match between Cocoa and Carbon window groups. In Cocoa you have child windows [NSWindow addChildWindow]. child windows move with their parents. Note that Cocoa does not have a notion of shared activation. Jesper On Jan 5, 2010, at 1:30 PM, Eric Gorr wrote: Was the window

Re: Window Groups in Cocoa

2010-01-05 Thread Seth Willits
On Jan 5, 2010, at 1:30 PM, Eric Gorr wrote: Was the window group feature (CreateWindowGroup, etc.) in the Carbon UI carried forward into Cocoa? [NSWindow addChildWindow: ordered:] -- Seth Willits ___ Cocoa-dev mailing list

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread Jesse Grosjean
Services no good? Well originally I dismissed them because my understanding is that they are meant to work in place. So there would be no time for the user to do there work in the external editor. But now that I think about it I could maybe use services in a bit more tricky manner. For example

Re: NSDate without time portion

2010-01-05 Thread mmalc Crawford
On Jan 5, 2010, at 1:35 pm, Kyle Sluder wrote: On Tue, Jan 5, 2010 at 1:23 PM, mmalc Crawford mmalc_li...@me.com wrote: An NSDate object represent a single point in time -- you can think of it basically as a wrapper for an NSTimeInterval from the reference date. If you want to create

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread has
On 5 Jan 2010, at 21:41, Jesse Grosjean wrote: Last, how would I go about sending Cmd-C/Cmd-V keystrokes directoy to another application? Haven't done it myself, but I would guess CGEventCreateKeyboardEvent() and friends would be simplest. HTH has -- Control AppleScriptable applications

Re: NSDate without time portion

2010-01-05 Thread Greg Guerin
Many good points have already been made. Just wanted to add: http://en.wikipedia.org/wiki/Julian_day The Julian day number can be considered a very simple calendar, where its calendar date is just an integer. This is useful for reference, computations, and conversions. It allows the time

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread Dave DeLong
Yep: CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); CGEventRef pasteCommandDown = CGEventCreateKeyboardEvent(source, (CGKeyCode)9, YES); CGEventSetFlags(pasteCommandDown, kCGEventFlagMaskCommand); CGEventRef

What gets automatically localized?

2010-01-05 Thread Dave DeLong
Hi everyone, I'm working on localizing an application, and I've been trying to figure out what the runtime/OS/whatever will automatically localize for me (specifically referring to the standard menubar). Obviously, if I add my own NSMenuItems, I have to localize them myself. Some menuitems

Re: NSDate without time portion

2010-01-05 Thread Henry McGilton (Boulevardier)
On Jan 5, 2010, at 1:43 PM, mmalc Crawford wrote: On Jan 5, 2010, at 1:35 pm, Kyle Sluder wrote: On Tue, Jan 5, 2010 at 1:23 PM, mmalc Crawford mmalc_li...@me.com wrote: An NSDate object represent a single point in time -- you can think of it basically as a wrapper for an NSTimeInterval

NSATSGlyphStorage memory usage.

2010-01-05 Thread jonat...@mugginsoft.com
My app repeatedly loads and unloads a couple of MB of text into an NSTextView. Running heap(1) reveals heap 12462 -sumObjectFields | grep NSATS 2 22833792 11416896.0 NSATSGlyphStorage ObjCAppKit This 23MB memory is allocated in the auto zone and does not noticeably

Question about looping constructs

2010-01-05 Thread BJ Homer
Branching from the Question about garbage collection thread On Sun, Jan 3, 2010 at 11:40 AM, Bill Bumgarner b...@mac.com wrote: If you are writing your own looping construct, you can call objc_clear_stack(...) to clear the stack at appropriate times, typically when the stack is as shallow

Re: NSDate without time portion

2010-01-05 Thread Quincey Morris
On Jan 5, 2010, at 13:43, mmalc Crawford wrote: I'm not sure what the point is here, though? Well, taking what's likely a rhetorical question literally, the point (at least my point) is that switching from dates represented by conceptual structures such as NSDateComponents + NSCalendar + time

Re: NSATSGlyphStorage memory usage.

2010-01-05 Thread Aki Inoue
It's supposed to be managed automatically. If you see suspicious behavior, please file a bug with reproducing steps if possible. Thanks, Aki On 2010/01/05, at 15:03, jonat...@mugginsoft.com wrote: My app repeatedly loads and unloads a couple of MB of text into an NSTextView. Running

Re: Weird issue with BDAlias/FSRefs and the case of filesystem paths

2010-01-05 Thread Rob Keniger
On 06/01/2010, at 6:18 AM, Kyle Sluder wrote: If the directory is on a case-insensitive HFS volume (the default), Yes, it is. It will also be helpful to see what the value of $HOME is, and if it jives with the on-disk name. echo $HOME /Users/rob This is really, really weird. I've since

Re: Weird issue with BDAlias/FSRefs and the case of filesystem paths

2010-01-05 Thread Rob Keniger
On 06/01/2010, at 10:29 AM, Rob Keniger wrote: This is really, really weird. I've since rebuilt the directory with Diskwarrior with no change to the behaviour. On the other machines here everything's working so it must be something unique to my setup but I have absolutely no idea where to

Path comparison and case sensitivity

2010-01-05 Thread Rob Keniger
My recent troubles with filesystem case got me thinking. Should Cocoa applications always assume that the filesystem is case-insensitive when comparing path strings? Surely this could lead to problems if the user has formatted a volume with a case-sensitive file system? Is there any way to

Re: NSSavePanel with accessory view and file types popup

2010-01-05 Thread jeffs87
Hi, I'm trying to add a custom accessory view to an NSSavePanel with a file types popup and a couple other controls. When shouldRunSavePanelWithAccessoryView returns YES for the default accessory view, the type popup works as expected when dataRepresentationOfType is invoked, the

main document window disappears when resizing

2010-01-05 Thread Shane
Hi, I have a document based application with a main window that, when I try to resize the window, the window just completely disappears. The application doesn't crash and I can open up another window (as the menu is still there) by 'Project -- New'. If I try to resize it, it will disappear. And

Re: main document window disappears when resizing

2010-01-05 Thread Graham Cox
On 06/01/2010, at 2:50 PM, Shane wrote: Hi, I have a document based application with a main window that, when I try to resize the window, the window just completely disappears. The application doesn't crash and I can open up another window (as the menu is still there) by 'Project -- New'.

Re: main document window disappears when resizing

2010-01-05 Thread Shane
Has the window got a silly setting for max or min size? (IB) It does have a minimum size in IB in the 'window size' tab, and maximum size is unchecked in that same tab (or something like a tabbed page). But even if they were both set, it shouldn't disappear. It just shouldn't resize. Any

Re: Path comparison and case sensitivity

2010-01-05 Thread Ken Thomases
On Jan 5, 2010, at 6:51 PM, Rob Keniger wrote: Should Cocoa applications always assume that the filesystem is case-insensitive when comparing path strings? Surely this could lead to problems if the user has formatted a volume with a case-sensitive file system? Don't compare paths. Use APIs

Re: NSRecursiveLock problems

2010-01-05 Thread Stuart Carnie
Check out PLBlocks http://code.google.com/p/plblocks/ if you want to use blocks on 10.5. Cheers, Stu On Tue, Dec 22, 2009 at 12:49 PM, PCWiz pcwiz.supp...@gmail.com wrote: Well what I meant by delegates and selectors was like the secondary thread calls a selector on the main thread (using

Re: NSDate without time portion

2010-01-05 Thread Chris Ridd
On 5 Jan 2010, at 20:56, Sean McBride wrote: On 1/5/10 7:23 PM, Chris Ridd said: However Core Data models dates using NSDate. If you needed to model dates without times in Core Data (and be able to sort/filter on them) what would you do? Core Data has the concept of a 'transformable'

Re: Path comparison and case sensitivity

2010-01-05 Thread Rob Keniger
On 06/01/2010, at 3:39 PM, Ken Thomases wrote: Don't compare paths. Use APIs like FSCompareFSRefs() or call -[NSFileManager attributesOfItemAtPath:error:] and compare the NSFileDeviceIdentifier and NSFileSystemFileNumber keys (this is the Cocoa equivalent of calling stat(2) and comparing