[iPhone] Convert date string to a NSDate object
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 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone] Convert date string to a NSDate object
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 you, Tharindu On Fri, Jan 8, 2010 at 1:58 PM, Tharindu Madushanka tharindu...@gmail.comwrote: 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 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTextView EXC_BAD_ACCESS in deferred layout
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 without issue. When the same test data is loaded into the second NSTextView instance the crash occurs. Obviously NSLayoutManager has initiated deferred layout. Do I have to be aware of any particular layout manager issues in this case? I am not doing any manipulation of the NSTextView contents. The content is established using the following binding. [_textView bind:NSAttributedStringBinding toObject:self withKeyPath:@resultString options:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSConditionallySetsEditableBindingOption, nil]]; Crash details follow. Thanks Jonathan Date/Time: 2010-01-08 11:11:32.074 + OS Version: Mac OS X 10.6.2 (10C540) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x017c Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: objc[653]: garbage collection is ON Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 com.apple.AppKit0x92eadd3e -[NSATSGlyphStorage setAbsorbedCount:forIndex:] + 84 1 com.apple.CoreText 0x95cbf9e3 TObjCGlyphStorage::SetAttachmentCount(long, long) + 51 2 com.apple.CoreText 0x95cbf8b0 long TRun::SetAttachmentsLeftToRighttrue(long, long const*, long) + 402 3 com.apple.CoreText 0x95cbf6a8 TRun::DeleteGlyphs(long, long const*, long) + 60 4 com.apple.CoreText 0x95cbf5c1 TLine::DeleteGlyphs(long, long, long const*) + 243 5 com.apple.CoreText 0x95cab05f TShapingEngine::ShapeGlyphs(TLine, TCharStream const) + 647 6 com.apple.CoreText 0x95cbba47 TTypesetterRunArray::TTypesetterRunArray(__CFArray const*, __CFString const*, void const* (*)(__CTRun const*, __CFString const*, void*), void*) + 209 7 com.apple.CoreText 0x95cbb962 CTTypesetterCreateWithRunArray + 90 8 com.apple.AppKit0x92dae76f -[NSATSGlyphStorage createCTTypesetter] + 1585 9 com.apple.AppKit0x92daa8bc -[NSATSTypesetter _ctTypesetter] + 323 10 com.apple.AppKit0x92da994b -[NSATSLineFragment layoutForStartingGlyphAtIndex:characterIndex:minPosition:maxPosition:lineFragmentRect:] + 72 11 com.apple.AppKit0x92da84a4 -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:] + 2760 12 com.apple.AppKit0x92e1addf -[NSATSTypesetter layoutParagraphAtPoint:] + 155 13 com.apple.AppKit0x9331ecf0 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 2935 14 com.apple.AppKit0x92e19fbe -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 218 15 com.apple.AppKit0x92e19ea2 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:] + 1316 16 com.apple.AppKit0x92e17eb4 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 1020 17 com.apple.AppKit0x92e8a509 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 261 18 com.apple.AppKit0x92e8cf9c +[NSLayoutManager(NSPrivate) _doSomeBackgroundLayout] + 927 19 com.apple.AppKit0x92e51af4 _NSPostBackgroundLayout + 562 20 com.apple.CoreFoundation0x95f8b892 __CFRunLoopDoObservers + 1186 21 com.apple.CoreFoundation0x95f483e2 __CFRunLoopRun + 1154 22 com.apple.CoreFoundation0x95f47864 CFRunLoopRunSpecific + 452 23 com.apple.CoreFoundation0x95f47691 CFRunLoopRunInMode + 97 24 com.apple.HIToolbox 0x96589f0c RunCurrentEventLoopInMode + 392 25 com.apple.HIToolbox 0x96589cc3 ReceiveNextEventCommon + 354 26 com.apple.HIToolbox 0x96589b48 BlockUntilNextEventMatchingListInMode + 81 27 com.apple.AppKit0x92ceeac5 _DPSNextEvent + 847 28 com.apple.AppKit0x92cee306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156 29 com.apple.AppKit0x92cb049f -[NSApplication run] + 821 30 com.apple.AppKit0x92ca8535 NSApplicationMain + 574 31 com.boo.myapp 0x6bf1 main + 376 (main.m:32) 32 com.boo.myapp 0x2a51 start + 53 Thread 1: Dispatch queue: com.apple.libdispatch-manager 0
Re: wait for sheet result
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 Ten Reasons why people hate their day jobs :) Well, the code I posted doesn't do that, and I'm sure Rainer's doesn't either. Once you dismiss a sheet, it's gone. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPhone: validate a NSString for US zipcode
Paul Bruneau mailto:paul_brun...@special-lite.com 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 prefer to use the Cocoa stuff rather than try to remember/learn how to properly code such things. NSSet (and NSDictionary) use hash tables to organize and look up their objects/keys. Look up and insertion times are nearly linear--assuming a well distributed hash function--regardless of collection size. NSArray does not impose an order on its contents. While arrays can be sorted--and as others have pointed out, there are binary search functions in Core Foundation--NSArray never assumes that its contents are ordered and searches are always preformed using a sequential, brute force, comparison of objects. It's easy to demonstrate all of this by setting a breakpoint in the -hash and -isEqual: methods of the objects added to a collection. For ZIP code membership, an NSIndexSet makes a lot more sense. -- James Bucanek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Julian date
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; } + (NSDate *)dateFromJulianDate:(NSTimeInterval)julianDate { NSTimeInterval seconds = (julianDate - 2440587.5) * 86400.0; return [NSDate dateWithTimeIntervalSince1970:seconds]; } @end ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Optimizing View Drawing Code
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 doing mostly DSP :). I should have mentioned earlier - regardless of top up or bottom down Shark results - I'm pretty sure the cause of my high CPU is the behind the scenes view setup prior to drawing that Cocoa does. 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 the CPU drops to almost zero. I'm looking at 15-20% CPU on a dual core 2.3GHz machine - quite a lot really. Of course, GUI updates have a lower priority than all the audio stuff but it would help to get the usage down. Thanks, Stephen That's because you're probably looking at the bottom-up view, which I think is still the default view in Shark, and it's not always helpful in ObjC programs. Did you try looking at the top-down view? Nick Zitzmann http://www.chronosnet.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Implementing search field in core-data app
On Thu, 7 Jan 2010 21:14:55 +0100, Martin Hewitson martin.hewit...@aei.mpg.de 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 like the searching is done in Mail.app. I'm not really sure how to go about this. I've tried binding the predicate bindings of an NSSearchField to the Item array controller, but this only searches in the items of the currently selected category (since the array controller is bound to categorycontroller.selection.items). I also tried making another array controller which contains all items and then set a filter predicate on this depending on the user having chosen a state: 'all categories' or 'currently selected category'. Then I bound my table view to this 'all items array controller'. But this is not so nice since the relationship between categories and items is not automatically handled. Is there a 'correct' way to attack such a problem, or has someone else managed to implement a search interface something like Mail.app? What I would suggest is not using bindings with the search field. That way, you can respond to the user's activities in the search field in any way you like. Take a look, for example, at my Thucydides app - it comes with source code, and uses Core Data, and is a very small simple app so you can see readily what's going on. We simply respond to the old-fashioned target-action signal from the search field by building a predicate and applying that to the controller of the full array of entities. Another complicating factor might your notion that a category entity contains a set of Item entities. This, and your statement that the relationship between categories and items is not automatically handled, makes me wonder whether you've set up your Core Data model in the way that's most appropriate for what you intend to do with this data. But the Thucydides code won't help with that, since it has no categories: the Core Data model is much simpler than what you describe. m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Optimizing View Drawing Code
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 the CPU drops to almost zero. I'm looking at 15-20% CPU on a dual core 2.3GHz machine - quite a lot really. Are you absolutely sure that you're not updating more than the 20 times mentioned in your initial message? Something doesn't add up - that load should be handled easily. You may be calling it more often that you think. Also, how many views are you updating each time the timer expires? I can imagine that if you do that on a lot of views 20 times a second the system could go down like that. Also, do you really have to update the entire view each time? What speeds up drawing a lot is specifying a dirty rect as small as possible and restricting the actual drawing to the area inside the rect whenever possible. May not be relevant in your case as the bottleneck seems to be somewhere else. Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPopupButton menu not showing in custom view for NSMenuItem
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 of the status item? Possibly, but I think you'd have to explain more about your desired user experience before we could make a recommendation. -eric ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CGImageCreate performance
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); CGImageRelease(m_CGImageRef); m_CGImageRef = CGImageCreate(m_bitmap.m_pixelsx, m_bitmap.m_pixelsy, 8, 32, 4*m_bitmap.m_pixelsx, colorSpace, kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host, provider, NULL,YES, kCGRenderingIntentDefault); CGImageRetain(m_CGImageRef); CGColorSpaceRelease(colorSpace); CGDataProviderRelease(provider); Clearly I have kicked NSBitMapImageRep under the bus as the above gives what I am looking for. The performance issue comes from the fact the user will be dragging this bitmap around so I a regenerating m_bitmap.m_array constantly. The specific performance issue with using CGBitmapContextCreate() with CGBitmapContextCreateImage() to wrap a buffer of data is that in order to preserve the semantics of a CGImageRef, CGBitmapContextCreateImage() needs to mark the buffer pointed to by the bitmap context as copy-on-write. This requires a call into the kernel, which is a relatively expensive process. This process is typically cheaper than actually copying the bytes around, but since you aren't actually using the context it is more expensive than going the direct route. However, since creating an image directly via CGImageCreate() is nearly identical to creating a bitmap context, it is the preferred solution since it avoids a call into the kernel. The only significant difference is the need to create a data provider, but doing that is straightforward. In the end, it is about the same number of lines of code to create the image directly, and you avoid the call into the kernel. -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CGImageCreate performance
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 image isn't going to change either way. If you have drawing performance issues, there are likely other venues that can resolve that problem, but we would need performance metrics to know what is your bottleneck. -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: A password strength checker
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 give a score, really. Best wishes, Martin 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 HTH, Phil ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
saving core animation layer to file
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 problem. Only, now, collectionviews aren't tweakable enough for my needs, and I'd like to use a core animation layer that would have many views inside it, or just images that I'll resize, move, etc interactively. I'd like to make sure that I'll be able to save the whole thing, knowing that the visible rect will be smaller than the bounds of total represented items. Could you please confirm me that it should work ? thanks a lot ! :) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa-dev Digest, Vol 7, Issue 35
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 in UTC (if needed) 'Z' marks that the time is in UTC... Then you just call: NSDate *date = [dateExtracter dateFromString: @2010-01-08T08:09:20Z]; 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 Regards. Marcus Grenängen, Software Engineer SourceTech AB Phone: +46 (0)8 447 63 03 Cellphone: +46 (0)702 474 297 Email: mar...@sourcetech.se Web: http://www.sourcetech.se Blog: http://grenangen.se ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Hiding the Window Content View
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 Size Control moves with the drag and we see the desktop in the body area. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hiding the Window Content View
On Fri, Jan 8, 2010 at 12:01 PM, David Blanton aired...@tularosa.net 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. The effect would be that when dragging the Title Bar the Size Control moves with the drag and we see the desktop in the body area. Sounds like you're trying to make a window that would be used as a select a portion of the desktop device. You will need to create a borderless window and do everything (resize, titlebar, etc.) yourself. The actual window shape and opacity is controlled by private API. In this case it's probably for the best, as I'm having trouble understanding what you could be trying to implement that would make sense to do with a window. (Of course, if you're dead-set on using a window, you could always get an image of the desktop and draw that into a custom content view, but that will be a bit slow.) --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Workspace Configuration
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 inline: Picture 3.png but only this inline: Picture 1.png 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 show in this control: Picture 1.png On Jan 8, 2010, at 12:04 PM, Chris Espinosa wrote: On Jan 8, 2010, at 10:50 AM, David Blanton wrote: I guess the terminology is Build Log vs. Build Transcript. I cannot see the Build Log when clicking the error indicator (what do you call the red circle with a white x that follows the gray circle with hammer followed by the word fail, all in the lower right corner of the window?) Control-command-shift-4, drag a rectangle, and paste. You get something like this: PastedGraphic-1.png Is that what you mean? That's the Status Bar (View Layout Show/Hide Status Bar). Clicking on the error or warning icon opens the Build Results window (or tab, depending on your current Layout as specified in Preferences General Layout). If you're running Xcode 3.1.x there are four icons in the split bar between the Build Results and the editor pane, and the third one from the left opens the Build Transcript. In Xcode 3.2, you can open the Build Transcript for an individual step or issue with the rollover on the right edge of the step: PastedGraphic-2.png or see the full build transcript with the context menu (right-click or control-click) PastedGraphic-3.png Chris ___ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (xcode-us...@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/airedale%40tularosa.net This email sent to aired...@tularosa.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Flicker Free Drawing
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 window and scrolling the content. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hiding the Window Content View
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 aired...@tularosa.net 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. The effect would be that when dragging the Title Bar the Size Control moves with the drag and we see the desktop in the body area. Sounds like you're trying to make a window that would be used as a select a portion of the desktop device. You will need to create a borderless window and do everything (resize, titlebar, etc.) yourself. The actual window shape and opacity is controlled by private API. In this case it's probably for the best, as I'm having trouble understanding what you could be trying to implement that would make sense to do with a window. (Of course, if you're dead-set on using a window, you could always get an image of the desktop and draw that into a custom content view, but that will be a bit slow.) --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Flicker Free Drawing
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 aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com Sent: Friday, January 08, 2010 8:38 PM Subject: Flicker Free Drawing 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 window and scrolling the content. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Flicker Free Drawing
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 is one of the joys of programming on the Mac (compared to Windows). Paul Sanders - Original Message - From: David Blanton aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com Sent: Friday, January 08, 2010 8:38 PM Subject: Flicker Free Drawing 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 window and scrolling the content. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hiding the Window Content View
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). You could also subclass the content view if you want to (you can do this in Interface Builder) and draw directly into that. Paul Sanders. - Original Message - From: David Blanton aired...@tularosa.net To: Kyle Sluder kyle.slu...@gmail.com Cc: cocoa-dev List cocoa-dev@lists.apple.com Sent: Friday, January 08, 2010 8:46 PM Subject: Re: Hiding the Window Content View 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. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Flicker Free Drawing
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 wrote: 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 aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com Sent: Friday, January 08, 2010 8:38 PM Subject: Flicker Free Drawing 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 window and scrolling the content. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net This email sent to aired...@tularosa.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
programatically updating UI for NSArrayContoller/NSTableView combo
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 after removal/updating of other objects via the UI. (ie... an NSButton/IBAction) the add method is not accessed through an NSButton in the UI, because it can receive data from other sources. I have tried using willUpdateValueforKey/didUpdateValueforKey and various other methods, nothing will force update the UI. I am using custom table cells, as seen in this tutorial: http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/index.html and initialising the arrayController like so in my init method: subscriptions = [[NSMutableArray alloc] init]; NSString *applicationSupportFolder = [SABApplicationSupportFolderPath stringByExpandingTildeInPath]; NSString *subscriptionsPlistPath = [applicationSupportFolder stringByAppendingPathComponent:SABSubscriptionsPlistFullName]; NSArray* subscriptionsArray = [NSArray arrayWithContentsOfFile:subscriptionsPlistPath]; int i = 0; for (NSDictionary *child in subscriptionsArray) { NSDictionary* subscriptionsDictionary = [subscriptionsArray objectAtIndex:i]; SubscriptionInfo* subscriptionInfo = [[[SubscriptionInfo alloc] initWithInfoDictionary: subscriptionsDictionary] autorelease]; [subscriptions addObject: subscriptionInfo]; i++; } I also have a method to flush out the arrayController and reload from a plist here: - (void)refreshArrayContollerContent { subscriptions = [[NSMutableArray alloc] init]; NSString *applicationSupportFolder = [SABApplicationSupportFolderPath stringByExpandingTildeInPath]; NSString *subscriptionsPlistPath = [applicationSupportFolder stringByAppendingPathComponent:SABSubscriptionsPlistFullName]; NSArray* subscriptionsArray = [NSArray arrayWithContentsOfFile:subscriptionsPlistPath]; int i = 0; //clear subscriptionsArrayController and reload NSArrayController* resetArrayController = subscriptionsArrayController; [[resetArrayController content] removeAllObjects]; for (NSDictionary *child in subscriptionsArray) { NSDictionary* subscriptionsDictionary = [subscriptionsArray objectAtIndex:i]; SubscriptionInfo* subscriptionInfo = [[[SubscriptionInfo alloc] initWithInfoDictionary: subscriptionsDictionary] autorelease]; [subscriptionsArrayController addObject: subscriptionInfo]; i++; } } and here is the relevant part of my add method: // Create our Subscriptions plist file. NSDictionary *output; output = [NSDictionary dictionaryWithObjectsAndKeys:title, @feedNameKey, urlString, @feedURLKey, defaultValue, @feedUpdatedKey, nil]; [subscriptionsArray addObject: output]; // Write the Subscriptions plist file. [subscriptionsArray writeToFile:subscriptionsPlistPath atomically:YES]; [self refreshArrayContollerContent]; does anyone have any ideas? thanks in advance. Russell___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Flicker Free Drawing
Indeed. In fact, all other backing store types are now deprecated. Paul Sanders. - Original Message - From: David Blanton aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com 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 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 wrote: 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 aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com Sent: Friday, January 08, 2010 8:38 PM Subject: Flicker Free Drawing 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 window and scrolling the content. -db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/airedale%40tularosa.net This email sent to aired...@tularosa.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk This email sent to p.sand...@alpinesoft.co.uk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: programatically updating UI for NSArrayContoller/NSTableView combo
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. http://homepage.mac.com/mmalc/CocoaExamples/controllers.html Programmatic modifications to arrays not noticed by table view mmalc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSDatePicker 24 hour clock
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), but the program reverts back to a 12-hour clock. I changed my System Preferences to a 24 hour clock, but the NSDatePicker refuses to change. I tried a programmatic formatter: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@HH:mm]; [myDatePicker setFormatter:dateFormatter]; (Also tried [[myDatePicker cell] setFormatter:dateFormatter];) In desperation, I set a loop trying every NSDatePickerElementFlags from 0 to 513. Have I missed something, or is a 24-hour clock not allowed? The program is for use in a location where 24-hour time is mandatory. Thanks for any insight you might have. Best Regards, Dan___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Flicker Free Drawing
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. All the updates you make from a single -drawRect: call should be flushed at the same time. Kind regards, Alastair. -- http://alastairs-place.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: A password strength checker
On Saturday, January 9, 2010, Philip Ershler ersh...@cvrti.utah.edu 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 explaining how to use the password assistant... http://www.cocoadev.com/?PasswordAssistant Regards, Matt ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hiding the Window Content View
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 somewhat lower level than most of the alternatives, and unless you need to use it for some other reason it's usually best to go with something higher level. For general drawing (including controls and the main views of the majority of applications), Quartz is usually more than fast enough; that's true even for fairly complex animation, though there may be better alternatives for various kinds of animated content. Quartz usually also gives you the best rendering quality, if that matters to you, and has the significant advantage of device independence (so you can draw to a printer just as easily as to the display). If you want to do the kinds of animations you often see in apps these days, or in the demo programs Apple shows off in some of its presentations, Core Animation is the way to go. You can use that from a view's animator, using layer-backed views, or by creating CALayers yourself. Finally if you're doing image processing, you might want to investigate Core Image and/or the Accelerate framework functions (vImage, vDSP et al). In addition, you can do many of these things without any code by using Quartz Composer... There are probably other things I haven't mentioned as well... this is just OTOH. As for flicker, for OpenGL obviously you're going to want to configure things for double buffered operation, and you might care about display synchronisation too (see QA1385 and QA1521). The higher level APIs flush the window buffers automatically in a manner that is synchronised with display refresh so you won't see tearing---though the implication, of course, is that there's a maximum rate at which you can draw before the system starts to throttle your updates (see TN2133). If you're using Core Animation, you need not worry about this at all as it handles the issue for you. Kind regards, Alastair. -- http://alastairs-place.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hiding the Window Content View
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 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 somewhat lower level than most of the alternatives, and unless you need to use it for some other reason it's usually best to go with something higher level. For general drawing (including controls and the main views of the majority of applications), Quartz is usually more than fast enough; that's true even for fairly complex animation, though there may be better alternatives for various kinds of animated content. Quartz usually also gives you the best rendering quality, if that matters to you, and has the significant advantage of device independence (so you can draw to a printer just as easily as to the display). If you want to do the kinds of animations you often see in apps these days, or in the demo programs Apple shows off in some of its presentations, Core Animation is the way to go. You can use that from a view's animator, using layer-backed views, or by creating CALayers yourself. Finally if you're doing image processing, you might want to investigate Core Image and/or the Accelerate framework functions (vImage, vDSP et al). In addition, you can do many of these things without any code by using Quartz Composer... There are probably other things I haven't mentioned as well... this is just OTOH. As for flicker, for OpenGL obviously you're going to want to configure things for double buffered operation, and you might care about display synchronisation too (see QA1385 and QA1521). The higher level APIs flush the window buffers automatically in a manner that is synchronised with display refresh so you won't see tearing--- though the implication, of course, is that there's a maximum rate at which you can draw before the system starts to throttle your updates (see TN2133). If you're using Core Animation, you need not worry about this at all as it handles the issue for you. Kind regards, Alastair. -- http://alastairs-place.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSFilesPromisePboardType
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) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSFilesPromisePboardType
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? http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html What part of the inline sample code are you having trouble understanding? NSURL *dropLocation; // Assume this exists - (BOOL)performDragOperation:(id NSDraggingInfo)sender { NSPasteboard *pboard = [sender draggingPasteboard]; if ( [[pboard types] containsObject:NSFilesPromisePboardType] ) { NSArray *filenames = [sender namesOfPromisedFilesDroppedAtDestination:dropLocation]; // Perform operation using the files’ names, but without the // files actually existing yet } return YES; } - Jim___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSFilesPromisePboardType
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 none. I am dragging from iTunes in list view to my own view. Am I making a mistake somewhere? --Nick On Jan 8, 2010, at 9:51 PM, Jim Correia wrote: 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? http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/DragandDrop/Tasks/DraggingFiles.html What part of the inline sample code are you having trouble understanding? NSURL *dropLocation; // Assume this exists - (BOOL)performDragOperation:(id NSDraggingInfo)sender { NSPasteboard *pboard = [sender draggingPasteboard]; if ( [[pboard types] containsObject:NSFilesPromisePboardType] ) { NSArray *filenames = [sender namesOfPromisedFilesDroppedAtDestination:dropLocation]; // Perform operation using the files’ names, but without the // files actually existing yet } return YES; } - Jim___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa%40nickpaulson.com This email sent to co...@nickpaulson.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDatePicker 24 hour clock
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 attached an NSDateFormatter in IB and specified 24-hour time (HH:MM), but the program reverts back to a 12-hour clock. I changed my System Preferences to a 24 hour clock, but the NSDatePicker refuses to change. I tried a programmatic formatter: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@HH:mm]; [myDatePicker setFormatter:dateFormatter]; (Also tried [[myDatePicker cell] setFormatter:dateFormatter];) In desperation, I set a loop trying every NSDatePickerElementFlags from 0 to 513. Have I missed something, or is a 24-hour clock not allowed? The program is for use in a location where 24-hour time is mandatory. Thanks for any insight you might have. Strange. Have you tried in a test app? My app's NSTextFieldAndStepperDatePickerStyle NSDateField follows Sys Pref settings. I did nothing fancy to get that behaviour. Sean ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSFilesPromisePboardType
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 the pasteboard Looked for HFSPromises on the pasteboard, but found none. I am dragging from iTunes in list view to my own view. Am I making a mistake somewhere? A couple of things to keep in mind here… * See the comment in the documentation about having to assume the files haven’t been created yet? You have to assume that, and it can complicate things. (I’ve logged a lengthy bug requesting ways to simplify file promise dragging, but the problem is complex because it requires system framework support *and* the cooperation of applications doing the dragging.) * You specified the drop location as /. Not all users have write permissions to the root of the disk, and it is unlikely that you really wanted iTunes to create the files here anyway. 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. What is it you are actually trying to accomplish? Perhaps there is another solution. Jim___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSFilesPromisePboardType
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 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 none. I am dragging from iTunes in list view to my own view. Am I making a mistake somewhere? A couple of things to keep in mind here… * See the comment in the documentation about having to assume the files haven’t been created yet? You have to assume that, and it can complicate things. (I’ve logged a lengthy bug requesting ways to simplify file promise dragging, but the problem is complex because it requires system framework support *and* the cooperation of applications doing the dragging.) * You specified the drop location as /. Not all users have write permissions to the root of the disk, and it is unlikely that you really wanted iTunes to create the files here anyway. 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. What is it you are actually trying to accomplish? Perhaps there is another solution. Jim___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa%40nickpaulson.com This email sent to co...@nickpaulson.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSFilesPromisePboardType
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 PromiseHFSFlavor data on the pasteboard (though that doesn’t really help when accessing the data via NSPasteboard.) On Jan 8, 2010, at 11:37 PM, Nick Paulson wrote: 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. The promised data isn’t really what you wanted anyway. The idea behind the promise is that the drag provider *promises* to create a new file in location specified in the drag receiver. It sounds like you are interested in the file that is being dragged, not a copy of it. iTunes does provide all the data in the drag that you need (and more), but does so through the ‘itun’ drag flavor. I haven’t seen this documented anywhere as a public, supported pasteboard flavor. It has been available for some time, but unless it is documented as a such, it could disappear (or change) at any time. Proceed accordingly. - Jim___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com