[iPhone] Convert date string to a NSDate object

2010-01-08 Thread Tharindu Madushanka
Hi, I am having a time stamp string like 2010-01-08T08:09:20Z I would like to know how I could convert this to a represented NSDate object.. Is it possible to do this without separating the string into several parts.. Thank you and Kind Regards, tharindufit.wordpress.com ___

Re: [iPhone] Convert date string to a NSDate object

2010-01-08 Thread Tharindu Madushanka
Just found the answer from Date Formatting Prog. Guide.. Format Strings section.. NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; [inputFormatter setDateFormat:@"-MM-dd'T'HH:mm:ss'Z'"]; NSDate *formatterDate = [inputFormatter dateFromString:@ "2010-01-08T08:09:20Z"]; Thank y

NSCollectionView not updated, NSTableView is updated, same array controller

2010-01-08 Thread Alexander Reichstadt
Hi, I have an NSCollectionView and an NSTableView, both bound to the same NSArrayController and exact same values. Upon a change I can see that the list entry is being removed from the NSTableView, but it stays around in the NSCollectionView until I resize the window. Do I need to overr

NSTextView EXC_BAD_ACCESS in deferred layout

2010-01-08 Thread jonat...@mugginsoft.com
My GC app has two NSTextViews in two windows. Distinct attributed text can loaded into both NSTextView instances. The problem test text data size is 2MB. The problem does not manifest itself for smaller data sizes. The 2MB test data can be loaded repeatedly into a single NSTextView instance wit

Re: wait for sheet result

2010-01-08 Thread Jerry Krinock
On 2010 Jan 07, at 22:23, Graham Cox wrote: > [In] MS Powerpoint on Mac ... sheets opening and closing all over the place > ... as you back out of the sequence, all the sheets that were called on the > way pop back into view one by one). Ah, PowerPoint presentations -- currently #6 in the Top

Re: iPhone: validate a NSString for US zipcode

2010-01-08 Thread James Bucanek
Paul Bruneau wrote (Thursday, January 7, 2010 11:00 AM -0500): To help make this thread more Cocoa-y, I would like to ask: Do the NSSet and NSArray methods like -containsObject perform in a fashion comparable to a home-rolled binary search? I greatly prefe

Re: Julian date

2010-01-08 Thread David Riggle
These two methods work fine for my astronomical calculations. Maybe they'll be inaccurate after 2100. Beats me. The world's going to end in 2012 anyway. ;) @implementation NSDate (JulianDates) - (NSTimeInterval)julianDate { return ([self timeIntervalSince1970] / 86400.0) + 2440587.5;

Re: Optimizing View Drawing Code

2010-01-08 Thread Stephen Blinkhorn
On 7 Jan 2010, at 18:16, Nick Zitzmann wrote: On Jan 7, 2010, at 4:58 PM, Stephen Blinkhorn wrote: The real cause seems to be all the view setup messaging that needs to happen after I mark the view with setNeedsDisplay:YES. My top hit in shark is: objc_msgSend (seems wrong for an app doi

Re: Implementing search field in core-data app

2010-01-08 Thread Matt Neuburg
On Thu, 7 Jan 2010 21:14:55 +0100, Martin Hewitson said: >Dear list, > >I have a fairly basic core-data model with a set of Category entities, each category contains then a set of Item entities. What I want to do is implement a search field which searches all items from all categories - something

Re: Optimizing View Drawing Code

2010-01-08 Thread Markus Spoettl
On Jan 8, 2010, at 5:18 PM, Stephen Blinkhorn wrote: > I can verify this by removing all drawing code from my drawRect: method but > gaining almost no extra performance (CGLayers are fast :). Even with an > empty drawRect: method if I comment out the setNeedsDisplay:YES line in the > meter then

Re: NSPopupButton menu not showing in custom view for NSMenuItem

2010-01-08 Thread Eric Schlegel
On Jan 7, 2010, at 6:04 PM, Daniel Meachum wrote: > Thank you Mr. Cox and Mr. Schlegel for your help. I'm using the nsmenuitem > view to be displayed when clicking a status item (from the menu bar). Would > it be better to display the view another way? Maybe in a window attached at > the point

Re: CGImageCreate performance

2010-01-08 Thread David Duncan
On Jan 7, 2010, at 5:36 PM, David Blanton wrote: > CGColorSpaceRef colorSpace; > colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); > CGDataProviderRef provider = CGDataProviderCreateWithData > (NULL,m_bitmap.m_array, 4*m_bitmap.m_pixelsx*m_bitmap.m_pixelsy, NULL)

Re: CGImageCreate performance

2010-01-08 Thread David Duncan
On Jan 7, 2010, at 5:36 PM, David Blanton wrote: > The performance issue comes from the fact the user will be dragging this > bitmap around so I a regenerating m_bitmap.m_array constantly. And in case I may have missed the point on the previous message, the performance of actually drawing the

Re: A password strength checker

2010-01-08 Thread Philip Ershler
On Jan 7, 2010, at 12:51 PM, Martin Hewitson wrote: > Dear list, > > Is anybody aware of a reasonable algorithm or some code that can be used to > test/check the strength of a password? I'd like to give a kind of score or a > color (red,yellow,green). I've looked at cracklib, but that doesn't

saving core animation layer to file

2010-01-08 Thread Nicolas Berloquin
Hi ! I'm asking here before I jump so that I don't spend too much time trying something that wouldn't work. I started out using an IKImageBrowserView only to find out that I couldn't save it to a bitmap then a jpeg. I then rewrote with NSCollectionViews, which I can output to a file without a prob

Re: Cocoa-dev Digest, Vol 7, Issue 35

2010-01-08 Thread Marcus Grenängen
Just create a NSDateFormatter specifying the format of the expected date/time: NSDateFormatter *dateExtracter = [[NSDateFormatter alloc] init]; [dateExtracter setDateFormat: @"-MM-dd'T'HH:mm:ss"]; [dateExtracter setTimeZone: [NSTimeZone timeZoneWithName:@"UTC"]]; // All date/times is received

Hiding the Window Content View

2010-01-08 Thread David Blanton
When the content view of a window has setHidden:YES called on it the result is a Title Bar, Size Control and a "body" (for lack of a better term). Is it possible to get rid of this "body" leaving just the Title Bar and Size Control. The effect would be that when dragging the Title Bar the

Re: Hiding the Window Content View

2010-01-08 Thread Kyle Sluder
On Fri, Jan 8, 2010 at 12:01 PM, David Blanton wrote: > When the content view of a window has setHidden:YES called on it the result > is a Title Bar, Size Control and a "body" (for lack of a better term).  Is > it possible to get rid of this "body" leaving just the Title Bar and Size > Control.  T

Re: Workspace Configuration

2010-01-08 Thread David Blanton
How I don't know but View / Smart Groups / Error & Warnings wasn't on. But still, using Xcode 3.1.2, why do my previous XC 2.1.4 projects not show <> but only this <> On Jan 8, 2010, at 12:12 PM, David Blanton wrote: OK. I guess the real question is this: How do I get theBuild tab to

Flicker Free Drawing

2010-01-08 Thread David Blanton
Does NSBackingStoreBuffered guarantee there will be no flicker when drawing? That is, I won't see the content view background drawn, then myview background drawn, then myview whatever I draw into bounds rect ... which would be "flicker, flicker" if I am drawing all through resizing the wi

Re: Hiding the Window Content View

2010-01-08 Thread David Blanton
I am just trying to find the best way to do rapid drawing with no flicker. I don't see an override on background drawing so I was wanting to eliminate the backgroud of the content view. On Jan 8, 2010, at 1:30 PM, Kyle Sluder wrote: On Fri, Jan 8, 2010 at 12:01 PM, David Blanton wrote: W

Re: Flicker Free Drawing

2010-01-08 Thread Paul Sanders
Correct. Nothing happens until the window is 'flushed' (which normally happens in the event loop). It is one of the joys of programming on the Mac (compared to Windows). Paul Sanders - Original Message - From: "David Blanton" To: "cocoa-dev List" Sent: Friday, January 08, 2010 8:38

Re: Flicker Free Drawing

2010-01-08 Thread David Blanton
Great and thanks! Now, if my app is a Cocoa document-based application where do I implement initWithContentRect:styleMask:backing:defer: -db On Jan 8, 2010, at 1:48 PM, Paul Sanders wrote: Correct. Nothing happens until the window is 'flushed' (which normally happens in the event loop). It

Re: Hiding the Window Content View

2010-01-08 Thread Paul Sanders
Well, there is no flicker issue to worry about, but to optimise for this case (i.e. save some CPU cycles), have the view you are drawing into return YES from its isOpaque method. Cocoa will then assume that this view completely obliterates whatever lies behind it (including the content view).

Re: Flicker Free Drawing

2010-01-08 Thread David Blanton
I guess I just choose Buffered in Window Attributes in IB. On Jan 8, 2010, at 1:56 PM, David Blanton wrote: Great and thanks! Now, if my app is a Cocoa document-based application where do I implement initWithContentRect:styleMask:backing:defer: -db On Jan 8, 2010, at 1:48 PM, Paul Sanders

programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-08 Thread Russell Gray
I am having trouble trying to get a tableView to update its contents, when bound to an NSArrayController - but only when new objects are added. removal, and updating of current objects works fine. The arraycontroller is bound to a mutablearray of dictionaries, and will update correctly only aft

Re: Flicker Free Drawing

2010-01-08 Thread Paul Sanders
Indeed. In fact, all other backing store types are now deprecated. Paul Sanders. - Original Message - From: "David Blanton" To: "cocoa-dev List" Sent: Friday, January 08, 2010 9:06 PM Subject: Re: Flicker Free Drawing I guess I just choose Buffered in Window Attributes in IB. On

Re: programatically updating UI for NSArrayContoller/NSTableView combo

2010-01-08 Thread mmalc Crawford
On Jan 8, 2010, at 1:10 pm, Russell Gray wrote: > I am having trouble trying to get a tableView to update its contents, when > bound to an NSArrayController - but only when new objects are added. removal, > and updating of current objects works fine. >

NSDatePicker 24 hour clock

2010-01-08 Thread Daniel Wambold
Hello. I have an NSDatePicker (NSTextFieldAndStepperDatePickerStyle) and I need it to display time in a 24-hour time mode. After reading Apple's docs and searching the Web, I can't seem to find a way to make this happen. I have attached an NSDateFormatter in IB and specified 24-hour time (HH:MM)

Re: Flicker Free Drawing

2010-01-08 Thread Alastair Houghton
On 8 Jan 2010, at 21:06, David Blanton wrote: > I guess I just choose Buffered in Window Attributes in IB. Buffered is the default. So by default, you do precisely nothing. You can still achieve flickery drawing if you try hard, of course, but you have to do it deliberately one way or another.

Re: A password strength checker

2010-01-08 Thread Matthew Lindfield Seager
On Saturday, January 9, 2010, Philip Ershler wrote: > Martin, >        If you haven't seen this already, check this out. > > Password generation via a free app and built-in OS X tool > > > http://www.macosxhints.com/article.php?story=2010010515545381 And that article links to CocoaDev explainin

Re: Hiding the Window Content View

2010-01-08 Thread Alastair Houghton
On 8 Jan 2010, at 20:46, David Blanton wrote: > I am just trying to find the best way to do rapid drawing with no flicker. The answer to that question depends rather on what you mean by "rapid" and on what you're trying to draw. The fastest way to draw on Mac OS X is generally OpenGL; it's also

Re: Hiding the Window Content View

2010-01-08 Thread David Blanton
Thanks for references and tips. I think I will be able to achieve the results I am looking for from all who have commented! - db On Jan 8, 2010, at 4:39 PM, Alastair Houghton wrote: On 8 Jan 2010, at 20:46, David Blanton wrote: I am just trying to find the best way to do rapid drawing with

NSFilesPromisePboardType

2010-01-08 Thread Nick Paulson
Hello list, Can someone please explain to me how I handle NSFilesPromisePboardType? I register for the dragged types, but I don't understand exactly how to get the data. Thanks, Nick Paulson___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: NSFilesPromisePboardType

2010-01-08 Thread Jim Correia
On Jan 8, 2010, at 7:52 PM, Nick Paulson wrote: > Can someone please explain to me how I handle NSFilesPromisePboardType? I > register for the dragged types, but I don't understand exactly how to get the > data. Did you read the documentation?

Re: NSFilesPromisePboardType

2010-01-08 Thread Nick Paulson
I am doing the following code: NSArray *filenames = [sender namesOfPromisedFilesDroppedAtDestination:[NSURL fileURLWithPath:@"/"]]; However, it is getting the following lines in console: Couldn't get a copy of an HFS Promise from the pasteboard Looked for HFSPromises on the pasteboard, but found

Re: NSDatePicker 24 hour clock

2010-01-08 Thread Sean McBride
Daniel Wambold (wambo...@gmail.com) on 2010-01-08 6:12 PM said: >Hello. I have an NSDatePicker (NSTextFieldAndStepperDatePickerStyle) and >I need it to display time in a 24-hour time mode. After reading Apple's >docs and searching the Web, I can't seem to find a way to make this >happen. I have at

Re: NSFilesPromisePboardType

2010-01-08 Thread Jim Correia
On Jan 8, 2010, at 10:24 PM, Nick Paulson wrote: > I am doing the following code: > > NSArray *filenames = [sender namesOfPromisedFilesDroppedAtDestination:[NSURL > fileURLWithPath:@"/"]]; > > However, it is getting the following lines in console: > Couldn't get a copy of an HFS Promise from th

Re: NSFilesPromisePboardType

2010-01-08 Thread Nick Paulson
I am trying to get the path of an item dropped onto a view by iTunes. iTunes seems to only do this with NSFilesPromisePboardType. Maybe I am wrong, though. --Nick On Jan 8, 2010, at 11:33 PM, Jim Correia wrote: > On Jan 8, 2010, at 10:24 PM, Nick Paulson wrote: > >> I am doing the following c

Re: NSFilesPromisePboardType

2010-01-08 Thread Jim Correia
On Jan 8, 2010, at 11:33 PM, Jim Correia wrote: > Ultimately, it appears that iTunes is putting bad promise data in the drag. > At this point it is probably best to file a bug against iTunes. Looks like this might simply be a byte order bug with the value in the promisedFlavor field in the Prom