Re: NSDate without time portion

2010-01-06 Thread Brian Bruinewoud
Wow. I didn't expect so much conversation from such a 'simple' question. Obviously, not a simple question after all. My iPhone app records events input by the user. The user can then view a list of events with a count for each day on which there was at least one event. I've stuck with the code

Re: Path comparison and case sensitivity

2010-01-06 Thread Alastair Houghton
On 6 Jan 2010, at 05:39, Ken Thomases wrote: > 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

Re: NSDate without time portion

2010-01-06 Thread Matthew Lindfield Seager
Yeah... There are many situations that the simple way will be right 99% of the time... And for the other 1% I reckon 99% of affected users will forgive you for not wasting bug hunting time worrying about leap seconds... Of course 72.3% of statistics are made up on the spot so don't quote me on tho

cocoa widgets and core animation

2010-01-06 Thread Daniel Oberhoff
Hi, I am playing around with coreanimation recently and to make experimenting easier wanted to embed some controls into my layer hierarchy. I just figured I can simply instanitate a custom view in interface builder without a parent window, put my controls in that, and simply put that view's lay

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Chaitanya Pandit
Hi, Are you using the libXML for parsing? Have a look at the XMLPerformance sample code by Apple: http://developer.apple.com/iphone/library/samplecode/XMLPerformance/index.html Thanks, Chaitanya Pandit Expersis Software Inc. On Jan 5, 2010, at 7:13 PM, Eric E. Dolecki wrote: > I take that back -

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

2010-01-06 Thread Martin Stanley
Thanks very much, Bill. I like your approach and in fact I think our scenarios are quite similar so I'm going to implement your solution. By the way, I can't seem to find the "document-already-open" error. Is it a standard error code? Martin On 2010-01-05, at 3:26 PM, Bill Cheeseman wrote:

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Eric E. Dolecki
I'm not using libXML - I'll take a look. Thanks! On Wed, Jan 6, 2010 at 6:01 AM, Chaitanya Pandit wrote: > Hi, > Are you using the libXML for parsing? > Have a look at the XMLPerformance sample code by Apple: > > http://developer.apple.com/iphone/library/samplecode/XMLPerformance/index.html > > T

Printing doc file using cocoa

2010-01-06 Thread Ramesh P
Hi all, Is it possible to print a doc file using cocoa application? If possible please give some suggestions. I printed pdf and image files.. But i didn't get any solution for doc files. Thanks in advace, Ramesh.P ___ Cocoa-dev mailing list (Cocoa-dev

Re: Printing doc file using cocoa

2010-01-06 Thread Jean-Daniel Dupas
Le 6 janv. 2010 à 14:55, Ramesh P a écrit : > Hi all, > > Is it possible to print a doc file using cocoa application? > If possible please give some suggestions. > I printed pdf and image files.. But i didn't get any solution for doc files. > FWIW, the sources of TextEdit are available in Xco

Bindings blues

2010-01-06 Thread jonat...@mugginsoft.com
Is it just me or is fighting with controller bindings one of the most frustrating parts of Cocoa App kit programming? Its great stuff when the data size is small but once data sets grow so does the pain. The main culprits seem to be NSArrayController + NSTableView and NSTreeController + NSOutl

iPhone: tab-based application, 1st view with tableview?

2010-01-06 Thread Eric E. Dolecki
Noob alert. I created a project based on tabbar. The firstViewController I placed a UITableView (in IB). No problems. However I want to hook that tableview up so that numberOfRowsInSection, etc. get fired. In MainWindow.xib I connected the table view with the "Selected First View Controller". I se

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Jeremy Pereira
Trying again, the HTML markup in the previous version of this e-mail sent the size over the list limit. Apologies if the original also turns up I created a little test program to run the XML through a parser and mine worked which was a bit mystifying until I figured out what the problem is.

NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
I am fetching weather data & in my results I am getting today and tomorrow's forecasts. However they have the same node: How can I get at those separately in my didStartElement? Is there a way to turn that into an array or something? ___ Cocoa-dev ma

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

2010-01-06 Thread Bill Cheeseman
No, I created a custom error number and message, and presented an alert accordingly. Bill On Jan 6, 2010, at 8:10 AM, Martin Stanley wrote: > By the way, I can't seem to find the "document-already-open" error. Is it a > standard error code? -- Bill Cheeseman b...@cheeseman.name _

NSBitMapImageRep Woes

2010-01-06 Thread David Blanton
Here is the code: @interface MyDocumentView : NSView { @public NSBitmapImageRep* m_NSBitmapImageRep; NSRect m_frameRect; float m_sz; BBitmap m_bitmap; unsigned char*

Re: NSBitMapImageRep Woes

2010-01-06 Thread David Duncan
On Jan 6, 2010, at 9:21 AM, David Blanton wrote: > m_NSBitmapImageRep = [[NSBitmapImageRep alloc] > > initWithBitmapDataPlanes:m_ptrs > > pixelsWide:m_frameRect.size.width >

Re: NSBitMapImageRep Woes

2010-01-06 Thread Ken Thomases
On Jan 6, 2010, at 11:21 AM, David Blanton wrote: > - (void)drawRect:(NSRect)dirtyRect { > > [NSGraphicsContext saveGraphicsState]; > [m_NSBitmapImageRep drawInRect:dirtyRect]; > [NSGraphicsContext restoreGraphicsState]; > } The docs for -drawInRect: say i

Re: NSBitMapImageRep Woes

2010-01-06 Thread Henry McGilton (Boulevardier)
On Jan 6, 2010, at 9:21 AM, David Blanton wrote: > Here is the code: > > @interface MyDocumentView : NSView { > @public > > NSBitmapImageRep* m_NSBitmapImageRep; > NSRect m_frameRect; > float m_sz; > BBitmap

Re: Printing doc file using cocoa

2010-01-06 Thread Scott Ribe
> Is it possible to print a doc file using cocoa application? Yes, but. It is possible to load a doc file into an attributed string, put it into a text view, and print that. But support is limited--it can't deal with all features of doc files, so you'd need to test for your application. -- Scot

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Jeremy Pereira
On 6 Jan 2010, at 16:22, Eric E. Dolecki wrote: > I am fetching weather data & in my results I am getting today and tomorrow's > forecasts. However they have the same node: > > > > > How can I get at those separately in my didStartElement? Is there a way to > turn that into an array or someth

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
Well okay yes... same element name but I need to tell them apart. On Wed, Jan 6, 2010 at 1:07 PM, Jeremy Pereira wrote: > > On 6 Jan 2010, at 16:22, Eric E. Dolecki wrote: > > > I am fetching weather data & in my results I am getting today and > tomorrow's > > forecasts. However they have the sam

Re: NSBitMapImageRep Woes

2010-01-06 Thread David Blanton
OK. So, from other comments I made some changes. 1. Correctly set the dimensions by using m_bitmap.m_pixelsx and m_bitmap.m_pixelsy (these are members of our portable bitmap class). m_NSBitmapImageRep = [[NSBitmapImageRep alloc] ini

Re: NSBitMapImageRep Woes

2010-01-06 Thread David Duncan
On Jan 6, 2010, at 10:19 AM, David Blanton wrote: > Now, from David Duncan's comment. > > My bitmap data does have alpha, i.e 4 samples per pixel ARGB. I thought > kCGImageAlphaNoneSkipFirst says don't make an alpha plane, skip byte 1 and go > to RED. > > I am not sure how to specify this in

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Jeremy Pereira
On 6 Jan 2010, at 18:13, Eric E. Dolecki wrote: > Well okay yes... same element name but I need to tell them apart. The day attribute has a different value in each case though. Just pull out the the object with the key @"day" from the attribute dictionary. > > On Wed, Jan 6, 2010 at 1:07 PM,

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
This is what I am doing now that feels like a hack (I only ever get a 2 day forecast, the one for today is the first): if( [elementName isEqualToString:@"yweather:forecast"]){ NSString *tmpDay = [attributeDict valueForKey:@"day"]; NSDate *now = [NSDate date]; NSDateFormatter *formatter = [[NSDa

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Philip Vallone
Hi. I would recommend LibXML. This post is excellent and the the author created an Objective C Wrapper. http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html Regards, On Jan 6, 2010, at 2:28 PM, Eric E. Dolecki wrote: > This is what I am doing now that feels like a hack (

Commit Editing Changes as I Type

2010-01-06 Thread cocoa-dev
I have two controls (NSTextField and a NSTableView column) that are bound to the same attribute in core data. I've set up a timer that starts after the NSTextField starts editing and I'd like it to periodically commit the editing as the user is typing. If the user hits the Enter key I do see the

Looking tutorials or blogs on NSOutlineView & NSTreeController . . .

2010-01-06 Thread Michael A. Crawford
Never used this view/control before. I'm looking for resources to help me shorten the curve, especially when used with the NSTreeController. I'm also considering switching my model to CoreData. Currently I have some code working that uses neither CoreData nor NSTreeController and I wondering

Re: Commit Editing Changes as I Type

2010-01-06 Thread Ken Thomases
On Jan 5, 2010, at 4:50 PM, cocoa-dev wrote: > I have two controls (NSTextField and a NSTableView column) that are bound to > the same attribute in core data. I've set up a timer that starts after the > NSTextField starts editing and I'd like it to periodically commit the editing > as the user

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Peter Blazejewicz
Hi Eric, On Wed, Jan 6, 2010 at 9:46 PM, Philip Vallone wrote: > Hi. > > I would recommend LibXML. This post is excellent and the the author created > an Objective C Wrapper. > > http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html > > Regards, > I can see you have already

Re: Commit Editing Changes as I Type

2010-01-06 Thread Kiel Gillard
Are you using bindings for your user interface? If you are using bindings, each binding has an option which reads something like "Continuously updates value". Enable this option for the text field's value binding. This will give you the desired effect. Kiel "The best way to cheer yourself up is

Re: Bindings blues

2010-01-06 Thread Rob Keniger
On 07/01/2010, at 12:35 AM, jonat...@mugginsoft.com wrote: > Okay, so its a bug, or an issue. > Its just the fact that every app seems to end up binding on the bindiings. > > I like the view controller bindings but I hate fighting with them. > > There is more coding with a data source but perfo

Re: Commit Editing Changes as I Type

2010-01-06 Thread Wyatt Webb
There's an option on the binding labeled "Continuously Updates Value" in IB. Make sure that's on. (or set it in the options dictionary if you're using the API call to bind). On a separate note, instead of a timer to check for changes, try setting a delegate on that NSTextField and watching for

Re: Looking tutorials or blogs on NSOutlineView & NSTreeController . . .

2010-01-06 Thread Rob Keniger
On 07/01/2010, at 8:52 AM, Michael A. Crawford wrote: > Never used this view/control before. I'm looking for resources to help me > shorten the curve, especially when used with the NSTreeController. I'm also > considering switching my model to CoreData. Currently I have some code > working

Re: Looking tutorials or blogs on NSOutlineView & NSTreeController . . .

2010-01-06 Thread Ken Thomases
On Jan 6, 2010, at 4:52 PM, Michael A. Crawford wrote: > Never used this view/control before. I'm looking for resources to help me > shorten the curve, especially when used with the NSTreeController. I'm also > considering switching my model to CoreData. Currently I have some code > working

duplicate method found, but can't locate

2010-01-06 Thread Shane
I'm getting this error from my main app controller which is trying to send a message to a thread on a queue (using YAMessageQueue). [[networkQueue proxyForTarget:networkServer] save:[self saveFile]]; Cannot convert 'NSString*' to 'NSError**' in argument passing I have no idea where it thinks it n

NSEvent timestamp is zero

2010-01-06 Thread jonat...@mugginsoft.com
I am trying to filter my NSEvents by timestamp but some, with event type of NSAppKItDefined, have a zero timestamp. I can work around this by calculating a timestamp value for the event as the current time since system boot. Is a mach timer the way to go on this? Regards Jonathan Mitchell De

Re: NSXMLParser question about duplicate nodes

2010-01-06 Thread Eric E. Dolecki
Thanks for all that I will read it up tonight, much appreciated. Thanks, Eric On Jan 6, 2010, at 6:36 PM, Peter Blazejewicz > wrote: Hi Eric, On Wed, Jan 6, 2010 at 9:46 PM, Philip Vallone wrote: Hi. I would recommend LibXML. This post is excellent and the the author created an Objectiv

Problems Fading Out Music

2010-01-06 Thread Chunk 1978
i'm attempting to fade out music by supplying a duration and a target volume, but i'm running into complications. for this example, the current playing volume is set at 1.0, i want to fade the volume down to 0.5 over a duration of 4 seconds. this works alright - it's not perfect because i'm using

Re: main document window disappears when resizing

2010-01-06 Thread Shane
> I've seen this once before, and it was because something wasn't retained > (maybe the window?).  Check to make sure you're holding onto your objects.. > One thing I'm not clear on that I think may be a possibility. My main window is within a *.nib and I have an 'IBOutlet NSWindow *mainWindow'

Re: Looking tutorials or blogs on NSOutlineView & NSTreeController . . .

2010-01-06 Thread Michael A. Crawford
Thanks for the pointers (Ken & Rob). -Michael On Jan 6, 2010, at 5:52 PM, Michael A. Crawford wrote: > Never used this view/control before. I'm looking for resources to help me > shorten the curve, especially when used with the NSTreeController. I'm also > considering switching my model to C

Re: duplicate method found, but can't locate

2010-01-06 Thread Jim Correia
On Jan 6, 2010, at 7:33 PM, Shane wrote: > I'm getting this error from my main app controller which is trying to > send a message to a thread on a queue (using YAMessageQueue). > > [[networkQueue proxyForTarget:networkServer] save:[self saveFile]]; > Cannot convert 'NSString*' to 'NSError**' in a

Re: What gets automatically localized?

2010-01-06 Thread Jerry Krinock
On 2010 Jan 05, at 14:11, Dave DeLong wrote: > 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

iCal-style NSTextFields

2010-01-06 Thread Ulai Beekam
Hi, Go into iCal (in Snow Leopard) and create a new event and and then click outside that event. Then double-click on that event and hit the "Edit" button. In the window you see, you have some neat looking text fields that show only text when not in focus but show you a white background with a

Re: NSBitMapImageRep Woes

2010-01-06 Thread Graham Cox
On 07/01/2010, at 4:21 AM, David Blanton wrote: > bytesPerRow:(4 * > m_frameRect.size.width) > bitsPerPixel:32]; Apart from what others have said, you can pass 0 for these parameters and they get

Re: Problems Fading Out Music

2010-01-06 Thread Graham Cox
On 07/01/2010, at 11:55 AM, Chunk 1978 wrote: > i would *love* to find out how to fade the volume similar to how core > animation animates, by simply supplying a target and a duration and > allowing it to work out the details with precisely and automatically, > but i'm doubtful that's possible.

Re: Problems Fading Out Music

2010-01-06 Thread Chunk 1978
unfortunately i'm developing for iPhone OS (which i should have stated earlier) so NSAnimation doesn't seem to be an option :-/ On Wed, Jan 6, 2010 at 10:12 PM, Graham Cox wrote: > > On 07/01/2010, at 11:55 AM, Chunk 1978 wrote: > >> i would *love* to find out how to fade the volume similar to ho

Re: NSEvent timestamp is zero

2010-01-06 Thread Rob Keniger
On 07/01/2010, at 10:47 AM, jonat...@mugginsoft.com wrote: > I am trying to filter my NSEvents by timestamp but some, with event type of > NSAppKItDefined, have a zero timestamp. > > I can work around this by calculating a timestamp value for the event as the > current time since system boot.

Re: Problems Fading Out Music

2010-01-06 Thread Graham Cox
On 07/01/2010, at 2:23 PM, Chunk 1978 wrote: > unfortunately i'm developing for iPhone OS (which i should have stated > earlier) so NSAnimation doesn't seem to be an option :-/ So just use NSTimer, within or without a wrapper object of your own devise. Here's the basics of the code I used, whi

Re: Printing doc file using cocoa

2010-01-06 Thread Ramesh P
Thanks Scott and Daniel, I tried using NSTextview. Now i can print the doc file. But it printing as a single page. My doc file has 5 pages. But it printing as a single page in very small size of letters. How to solve this? Thanks, Ramesh.P On Wed, Jan 6, 2010 at 11:34 PM, Scott Ribe wrote: >

help system structure

2010-01-06 Thread Shane
I'm trying to implement a help system and don't understand the structure. Here's how my current XCode project is laid out. MyApp |- AquaticPrime.framework |- build |- English.lproj |- images |- Importer |- includes |- MyApp-Info.plist |- source `- Sparkle.framework I wa

Re: Printing doc file using cocoa

2010-01-06 Thread Ramesh P
I solved that.. It printing in multiple pages. I added the following line. [printInfoDict setObject:filename forKey:NSPrintSavePath]; Thanks, Ramesh.P On Thu, Jan 7, 2010 at 10:46 AM, Ramesh P wrote: > Thanks Scott and Daniel, > > I tried using NSTextview. Now i can print the doc file. But it

wait for sheet result

2010-01-06 Thread Rainer Standke
Hello, another newbie question, I'm afraid. My app has an number of items to process, and on each the user is asked for input in a sheet attached to the document's window. Everything works fine when I present the sheet for the first time. But when user interaction with the sheet is finish

Re: wait for sheet result

2010-01-06 Thread Graham Cox
On 07/01/2010, at 5:10 PM, Rainer Standke wrote: > How do I go about solving this? This is down to the logic of your app. While a sheet is up, events are being processed as normal, so presumably you are relying on the event loop to process the items. You'll need to rework your design so that

Re: help system structure

2010-01-06 Thread Rob Keniger
On 07/01/2010, at 3:24 PM, Shane wrote: > I was trying to follow this link on "Organizing the Help Book Bundle" > but I'm a bit confused on whether I should create the 'Contents' and > 'Resources' folder or what goes where. > http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/

Binding NSPopUpButton selectedIndex with custom view for menu item

2010-01-06 Thread Tom
I have a NSPopUpButton with a menu of 3 options. The second option has a view assigned (in IB). The view properly updates the button's selection when clicked (through mouseDown: override). However when I bind the button's selectedIndex it doesn't work for my view. The binding properly updates the r