Re: QuickLook returning small image

2011-01-15 Thread Andy Lee
Thanks, Julien. This is helpful. On Jan 15, 2011, at 2:28 PM, Julien Jalon wrote: When requesting a thumbnail, it's up to the underlying plug-in to honor the requested size. If icon == NO, Quick Look will return the plug-in's image result as is. If icon == YES, Quick Look will force the

Re: Determining whether a dictionary is mutable or not

2011-01-14 Thread Andy Lee
On Jan 14, 2011, at 7:57 AM, Roland King wrote: Again let me say that if the signature to your method is -(void)doSomethingWithADictionary:(NSDictionary*)dictionary; you shouldn't be trying to figure out whether that dictionary is mutable and mutate it. Yup. If you want it to

Re: Locating a contextual menu

2011-01-09 Thread Andy Lee
On Jan 9, 2011, at 8:58 AM, Thomas Davie wrote: I'd like in my app to be able to position an item by right clicking, and selecting something from a contextual menu. I'm struggling with this though, I don't see any way to find the position of the click that caused the contextual menu to

Re: Colored Pattern example problems

2010-12-24 Thread Andy Lee
On Dec 24, 2010, at 11:34 AM, WT wrote: Hi Jack, Without getting into the merits of what expectations one should have regarding Apple's documentation, Or any documentation, for that matter. I just want to point out that the documentation pages have links available for the reader to make

Re: UITableView with only 1 row selectable

2010-12-24 Thread Andy Lee
On Dec 24, 2010, at 12:28 PM, Remco Poelstra wrote: Hi, I'm unable to find that method. Is it still available? Are you looking in the delegate docs? http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/Reference/Reference.html Search the page

Re: UITableView with only 1 row selectable

2010-12-24 Thread Andy Lee
Whoops, sorry. --Andy On Dec 24, 2010, at 12:31 PM, Dave DeLong wrote: NSTableView ≠ UITableView On Dec 24, 2010, at 9:29 AM, Andy Lee wrote: Are you looking in the delegate docs? http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTableViewDelegate_Protocol

Re: NSTextView scrolls to top on Save

2010-12-19 Thread Andy Lee
On Dec 18, 2010, at 10:38 PM, Andy Lee wrote: As a learning experience, I'm trying to make a trivial document-based app: a window with a text view that can edit and save RTF files. What I have now almost works, except that whenever I save changes, the text view scrolls to the top

Re: NSTextView scrolls to top on Save

2010-12-19 Thread Andy Lee
On Dec 19, 2010, at 8:04 PM, Kyle Sluder wrote: On Sun, Dec 19, 2010 at 1:20 PM, Andy Lee ag...@mac.com wrote: I can understand why Apple wouldn't use a bindings-based solution for this example, since bindings is an advanced topic unto itself, but I think using an NSTextStorage would

NSTextView scrolls to top on Save

2010-12-18 Thread Andy Lee
As a learning experience, I'm trying to make a trivial document-based app: a window with a text view that can edit and save RTF files. What I have now almost works, except that whenever I save changes, the text view scrolls to the top. Needless to say, this would be very annoying in a real

Re: Building a GUI for Terminal Applications

2010-12-14 Thread Andy Lee
On Dec 14, 2010, at 11:12 PM, Conrad Shultz wrote: For navigating Apple's doc structure I find that Google's scoping feature is quite helpful: http://www.google.com/search?q=moriarty+site%3Adeveloper.apple.com If you don't mind giving up some space in your browser window, the ADC Search

Re: respondsToSelector warning: may not respond

2010-11-27 Thread Andy Lee
On Nov 27, 2010, at 12:35 PM, David Duncan david.dun...@apple.com wrote: fortunately you can declare that your protocol inherits from another, and there is also an NSObject protocol that defines the core functionality of the class, so you can do this when you declare your protocol and never

Re: how to redraw a view

2010-11-25 Thread Andy Lee
On Nov 24, 2010, at 12:50 PM, Artemiy Pavlov wrote: I tried [self setNeedsDisplay] or [MyView setNeedsDisplay] but this doesn't work. Try [self setNeedsDisplay:YES]. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: NIB doesn't link to objects

2010-11-13 Thread Andy Lee
On Nov 13, 2010, at 8:50 PM, Quincey Morris wrote: 2. You didn't really hook up the outlets in IB. Only you can check that, and you have, but it's worth keeping in mind that it's easy to talk yourself into believing that you've done it right when you haven't. (Speaking from painful personal

Re: Understanding the Run loop idea and the updating of controls during long operations

2010-11-07 Thread Andy Lee
On Nov 7, 2010, at 6:05 AM, eveningnick eveningnick wrote: I assume i should call a one run through the runloop manually, but how? I recommend that you not attempt to invert the event loop or build one yourself. The modal session methods of NSApplication (-beginModalSessionForWindow:,

Re: Dictionary keyed by a few sparse integers?

2010-10-29 Thread Andy Lee
On Oct 29, 2010, at 7:52 AM, Graham Cox wrote: On 29/10/2010, at 10:44 PM, Roland King wrote: It should work the way you've done it in a NSDictionary. Yes the numbers created by +numberWithUnsignedInteger: are distinct objects (normally, if I use low numbers they actually aren't, one

Re: What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-26 Thread Andy Lee
On Oct 26, 2010, at 7:29 AM, G S wrote: Hi all. I'm giving this function what appears to be a perfectly good path: /Users/me/Library/Application Support/iPhone Simulator/4.2/Applications/58BD5465-FD47-49E3-83AC-242961559F48/Library/Caches/4320_th.jpg and it returns nil. Using the exact

Re: Tracing an iPhone application/framework

2010-10-19 Thread Andy Lee
On Oct 18, 2010, at 11:38 PM, Sandro Noël wrote: The framework is built as a template application from which classe/functions can be overloaded to fit the needs of the being built application. not much of an architecture if you ask me but i have to document it none the less. Isn't that

Re: MutableArray and TableView Question

2010-10-19 Thread Andy Lee
On Oct 19, 2010, at 2:29 PM, Conrad Shultz wrote: Are you sure you copied and pasted? I can't believe that inputTablereloadData (without a space) would compile, let alone run. I assumed there was some peculiarity of Chris's emailer that causes the space to get deleted, as seems to have

Google custom search

2010-10-11 Thread Andy Lee
A while back someone set up a Google custom search that was tailored to find Cocoa info, and posted it on this list. As I recall it searched a pretty good list of sites. I can't find that custom search in my email archives -- can someone point me to it? --Andy

Re: Google custom search

2010-10-11 Thread Andy Lee
That was it -- I see Marc Liyanage's post in my archives now. Thanks! --Andy On Oct 11, 2010, at 3:20 PM, Dave DeLong wrote: http://bit.ly/macdev Cheers, Dave On Oct 11, 2010, at 1:17 PM, Andy Lee wrote: A while back someone set up a Google custom search that was tailored to find

Re: Google custom search

2010-10-11 Thread Andy Lee
On Oct 11, 2010, at 3:22 PM, Sherm Pendley wrote: On Mon, Oct 11, 2010 at 3:17 PM, Andy Lee ag...@mac.com wrote: A while back someone set up a Google custom search that was tailored to find Cocoa info, and posted it on this list. As I recall it searched a pretty good list of sites. I

[ANN] AppKiDo 0.985

2010-09-25 Thread Andy Lee
http://homepage.mac.com/aglee/downloads/appkido.html This should fix the problems at least some folks have been having with the iOS 4.1 SDK. It also includes bug fixes from the two 985 sneakypeeks. Many thanks to Gerriet Denkmann for finding and fixing the bug. Any problems (for example, I've

Re: Ports for stringWithContentsOfURL

2010-09-17 Thread Andy Lee
stringWithContentsOfURL: is deprecated. I suggest using stringWithContentsOfURL:encoding:error: or stringWithContentsOfURL:usedEncoding:error: and logging the error or displaying it with +alertWithError: so those users can tell you the exact reason for failure. It might help to print the URL

Re: web-based Cocoa dev docs inaccessible

2010-09-13 Thread Andy Lee
On Sep 12, 2010, at 6:32 PM, Jeffrey Oleander wrote: Normally, I'd file an on-line criticism of the docs, but I can't get there, and this is the closest means I have to doing so. This list isn't an official channel for bug reports, so filing a Radar might actually be closer:

Re: Drag'n Drop Mail.app message to Cocoa app

2010-08-04 Thread Andy Lee
On Aug 4, 2010, at 6:32 PM, Mark Ritchie wrote: I would think that the contents of a mail message might be something that Mail.app wants to keep for itself! ;-) I observe that TextEdit.app accepts the drop and creates a nice URL which goes back to Mail.app. The example app

Re: Adding an image to a project

2010-07-15 Thread Andy Lee
On Jul 15, 2010, at 5:25 AM, Vincenzo Morgante wrote: If you put the image into your project and add it to your application target, Xcode will automatically add it to a Copy Files build phase that places the image into WhateverApp.app/Contents/Resources/imagename.png. That is also the

Re: Adding an image to a project

2010-07-14 Thread Andy Lee
On Jul 14, 2010, at 7:55 AM, Vincenzo Morgante wrote: Well,I read the documentation at linkhttp://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/LoadingResources/ImageSoundResources/ImageSoundResources.html and the example [NSImage imageNamed:]... However in this way I get a

Re: Weak-linking a class

2010-06-27 Thread Andy Lee
NSClassFromString()? Or maybe some objc_xxx runtime function? --Andy On Jun 27, 2010, at 9:50 AM, Graham Cox wrote: How do I test for the existence of a Cocoa class at runtime that could be absent on an earlier system? The situation is that I want to use NSCache instead of

Re: home-rolled notification center... I think?

2010-06-10 Thread Andy Lee
On Jun 9, 2010, at 11:34 PM, Jerry Krinock wrote: On 2010 Jun 09, at 19:02, Andy Lee wrote: Sorry for a vague question, but... a while back there was a discussion of (I *think*) NSNotificationCenter. You may be thinking of Mike Ash's MAKVONotificationCenter. However

Re: home-rolled notification center... I think?

2010-06-10 Thread Andy Lee
On Jun 10, 2010, at 2:21 PM, Quincey Morris wrote: On Jun 10, 2010, at 11:02, Andy Lee wrote: There was a whole thread about it and someone said they'd written a replacement class and it seemed to work and they were pretty happy with it because it gave them a greater ability to debug, I

home-rolled notification center... I think?

2010-06-09 Thread Andy Lee
Sorry for a vague question, but... a while back there was a discussion of (I *think*) NSNotificationCenter. Whatever it was, someone wrote their own version and was happy with the results. Can anyone (like, say the author) refresh my memory on what that was, and the motivation for writing the

CocoaHeads-NYC date change: *tomorrow*

2010-06-08 Thread Andy Lee
The CocoaHeads-NYC meeting this month will be on *WEDNESDAY* June 9 (tomorrow) rather than the usual Thursday. We don't have a speaker this month, so we'll just chat about WWDC and head for burgers early. I encourage you to bring questions and/or code if there's something you want to show

Re: Erasing drawn content

2010-06-08 Thread Andy Lee
On Jun 8, 2010, at 8:58 PM, Graham Cox wrote: On 09/06/2010, at 3:06 AM, Kyle Sluder wrote: Of course by bees, I meant views. Pity, I like the idea of more bee-based metaphors in APIs (or Apis). It could be known as Bee-OS. Nice double pun! --Andy

Re: new to cocoa

2010-05-16 Thread Andy Lee
In addition to what others have pointed out... On May 16, 2010, at 8:19 PM, William Squires wrote: [sourceButtonMap setObject:[NSString stringWithString:@no] forKey:[unitButton description]]; ...there's no reason to use stringWithString:. You can just say: [sourceButtonMap setObject:@no

Re: Finding which window is causing the NSWindow does not support utility styleMask 0x10 error

2010-05-14 Thread Andy Lee
Just a guess -- I'm looking at a xib file and I see this line: int key=NSWindowStyleMask15/int Maybe you could grep your xib's for NSWindowStyleMask, look at the output, and AND the values with 0x10. --Andy On May 14, 2010, at 7:29 AM, Gideon King wrote: I obviously have the utility

CocoaHeadsNYC TONIGHT (Thursday), 6PM

2010-05-13 Thread Andy Lee
Alex McAuley will give a talk entitled You're a Tool If You Don't Use Instruments. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and we like to see code and try to help. (2) We'll have burgers and beer afterwards. (3) If there's a topic

Re: Are there any tools or techniques for detecting / debugging retain-cycles?

2010-05-05 Thread Andy Lee
http://www.mikeash.com/pyblog/friday-qa-2010-04-30-dealing-with-retain-cycles.html http://cocoawithlove.com/2009/07/rules-to-avoid-retain-cycles.html --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: NSTableview background image for column?

2010-04-24 Thread Andy Lee
What about a custom table cell whose draw method draws the appropriate subrectangle of the image? Would that work? You might have to work around the table's intercellSpacing so there aren't breaks in the image. What's in this image anyway? I'm having a hard time imagining an app that would

Re: NSTableview background image for column?

2010-04-24 Thread Andy Lee
Or look into overriding some combination of NSTableView's drawBackgroundInClipRect:, drawGridInClipRect:, and drawRow:clipRect:, possibly using information about the appropriate NSTableColumn to help calculate coordinates. --Andy On Apr 24, 2010, at 2:44 PM, Andy Lee wrote: What about

[ANN] AppKiDo-for-iPhone 0.984 fixes bug with 3.2 SDK

2010-04-08 Thread Andy Lee
Version 0.984 of AppKiDo-for-iPhone contains an important bug fix: http://homepage.me.com/aglee/downloads/appkido.html Many thanks to Jeff Johnson for fixing an incompatibility with the latest 3.2 docs, such that no documentation would appear. Regular AppKiDo (for Cocoa) is unaffected. The

[MEET] CocoaHeads-NYC tonight - NSOperation

2010-03-11 Thread Andy Lee
Sorry for the two hours' notice... Marc van Olmen will give the talk entitled Introduction to NSOperation that he was unable to give last month. I have no doubt it'll be worth the wait. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and we

Re: Custom View in Toolbar

2010-03-08 Thread Andy Lee
On Monday, March 08, 2010, at 11:56AM, David Blanton aired...@tularosa.net wrote: So two hours later I still cannot display a custom view containing buttons in an NSToolbar. Something that in MFC is trivial is near impossible with Cocoa. The Windows guys here are laughing their ... off

Re: NSWindow - makeKeyAndOrderFront problem

2010-03-01 Thread Andy Lee
On Mar 1, 2010, at 6:27 PM, Matthew Lindfield Seager wrote: On Monday, March 1, 2010, Andreas Mayer andr...@harmless.de wrote: Try dragging something onto the iTunes source list. iTunes will import it, but will not activate itself. Apples Oranges... iTunes is (was?) a library application

Re: Removing quit button from dock menu

2010-02-24 Thread Andy Lee
Don't try to achieve this by removing UI options. For one thing, I'm not sure if this prevents AppleScript or shutdown from quitting your app. But regardless, instead of removing the Quit option without explanation, it's better to implement applicationShouldTerminate: in your application

[MEET] CocoaHeads-NYC tomorrow (Thursday) night

2010-02-10 Thread Andy Lee
Marc van Olmen will give a talk entitled Introduction to NSOperation. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and we like to see code and try to help. (2) We'll have food and beer afterwards. (3) If there's a topic you'd like

Re: another responder chain docs bug (validateUserInterfaceItem:)

2010-02-03 Thread Andy Lee
On Feb 3, 2010, at 11:42 AM, Kyle Sluder wrote: On Wed, Feb 3, 2010 at 1:02 AM, Jens Miltner j...@mac.com wrote: Well, in my experience the truth is somewhere between the two: AppKit seems to go up the responder chain and call validateUserInterfaceItem: on each potential target (i.e. each

Re: [MEET] February CocoaHeads Developer Meetings

2010-01-29 Thread Andy Lee
Sorry, I was late entering the NYC meeting: New York- Thursday, February 11, 2010 18:00. --Andy On Thursday, January 28, 2010, at 10:20PM, Stephen Zyszkiewicz st...@cocoaheads.org wrote: Greetings, CocoaHeads is an international Cocoa programmer's group. Meetings are free and open to the

Re: patching the responder chain: puzzled by the docs

2010-01-25 Thread Andy Lee
I went ahead and created rdar://7576845 rather than use the documentation feedback form, because I'd like to see what the answer is. --Andy On Friday, January 22, 2010, at 12:42PM, Andy Lee ag...@mac.com wrote: My understanding was that it's okay to insert things anywhere you want

another responder chain docs bug (validateUserInterfaceItem:)

2010-01-25 Thread Andy Lee
Semi-related to my previous post, I just filed rdar://7577360 (text below). As far as I can tell, it's a bug in the docs. --Andy The Overview at

Re: UIButton's Sender Control Events

2010-01-24 Thread Andy Lee
On Jan 24, 2010, at 2:48 PM, mmalc Crawford wrote: On Jan 24, 2010, at 10:27 am, Chunk 1978 wrote: refactoring code so one method for the same button can handle a small if/else statement could easily be considered more ideal than having two separate methods. No, it couldn't. If you have

Re: UIButton's Sender Control Events

2010-01-24 Thread Andy Lee
On Jan 24, 2010, at 3:10 PM, Andy Lee wrote: On Jan 24, 2010, at 2:48 PM, mmalc Crawford wrote: On Jan 24, 2010, at 10:27 am, Chunk 1978 wrote: refactoring code so one method for the same button can handle a small if/else statement could easily be considered more ideal than having two

Re: View Handling

2010-01-23 Thread Andy Lee
On Jan 23, 2010, at 11:55 AM, Paul Bruneau wrote: I can offer two tips. The first is make the tabs be visible in IB because then it's so much easier to switch between them in IB. You can also use the outline view in the main IB window. I think you can switch by double-clicking the tab you

patching the responder chain: puzzled by the docs

2010-01-22 Thread Andy Lee
My understanding was that it's okay to insert things anywhere you want in the responder chain. In particular, it's okay to put a a view controller between its view and the view's superview. I know I'm not alone in this: * Buck and Yacktman say so in Cocoa Design Patterns, in the section

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Andy Lee
On Friday, January 22, 2010, at 02:27PM, Oleg Krupnov oleg.krup...@gmail.com wrote: I'd like to create a window that would behave exactly as a sheet, except that it doesn't slide down from the window title bar, but fades in instead. The sheet should be modal, but the parent window should still

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Andy Lee
On Friday, January 22, 2010, at 04:18PM, Oleg Krupnov oleg.krup...@gmail.com wrote: Thanks Andy. Here's more info. The sheet is a semi-transparent nag window with some text and a couple of buttons, that overlaps the main window. The sheet does not have a shadow, so there is no problem to

Re: Unable to recieve mouse moved events on NSBorderless window

2010-01-20 Thread Andy Lee
On Jan 20, 2010, at 5:05 PM, Quincey Morris wrote: On Jan 20, 2010, at 05:33, Poonam Virupaxi Shigihalli wrote: I am using NSBorderless window style mask for window to set in full screen mode. I am unable to recieve the mouse moved event on borderless window. If I set the window style mask

Re: Drawing A Mutable String

2010-01-12 Thread Andy Lee
On Jan 12, 2010, at 1:29 PM, Michael Craig wrote: Well, I feel dumb. Your (Andy's) mention of setNeedsDisplay: caught my eye, and I realized soon after that the button whose method causes invalidStack to be YES never tells the view the redraw. I still don't entirely understand why the text

Re: Drawing A Mutable String

2010-01-11 Thread Andy Lee
Bizarre. I love bugs like this that it's easy to prove can't possibly be happening. :) The only desperate, farfetched suggestion I have is that somehow you've accidentally created two instances of your GameView, only one of which is visible, and for some reason when invalidStack is true, the

[MEET] CocoaHeads-NYC this Thursday, 11/12

2010-01-10 Thread Andy Lee
Alex McAuley will give a talk entitled (ahem) Bad Apple: Classes and Methods That Suck. *NOTE* that we are back to our usual location at Tekserve. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and we like to see code and try to help. (2)

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Andy Lee
On Jan 9, 2010, at 8:40 PM, Dave Keck wrote: Discussion This method is a combination of alloc and init. Like alloc, it initializes the isa instance variable of the new object so it points to the class data structure. It then invokes the init method to complete the initialization process.

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Andy Lee
On Jan 9, 2010, at 8:35 PM, Mr. Gecko wrote: I just looked and saw that, so one question. Is array, string, and data all the same as new or are those autorelease?

Re: Drawing A Mutable String

2010-01-07 Thread Andy Lee
Looks fine to me. Is there any chance the correct text *is* being drawn but is subsequently erased or drawn over by something else in the rest of the drawRect: method? --Andy On Thursday, January 07, 2010, at 03:29PM, Michael Craig mks...@gmail.com wrote: Hi all, This has me completely

Re: NS_INLINE and obj = nil;?

2010-01-04 Thread Andy Lee
On Jan 3, 2010, at 5:26 PM, Scott Ribe wrote: Easily fixed: #define GDRelease(x) [(x) release], (x) = nil, (void)0 Not really a good fix; compiler error is preferable to tweaking your macro to allow compilation of nonsense ;-) Actually this causes a compiler error if you try if

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Andy Lee
On Jan 2, 2010, at 6:04 AM, Paul Sanders wrote: I think it's Hillegass who recommends getting plenty of sleep. Ten hours! I keep meaning to try that suggestion, I think there must be something to it. --Andy ___ Cocoa-dev mailing list

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2009-12-31 Thread Andy Lee
On Dec 31, 2009, at 1:14 PM, Joshua Garnham wrote: So would this work?… CGFloat spacing = 5.0f; NSMutablePargagraphStyle *paragraphStyle; [paragraphStyle setLineSpacing:spacing]; [paragraphStyle setMinimumLineHeight:spacing]; [paragraphStyle setMaximumLineHeight:spacing]; [textView

CocoaBuilder is back

2009-12-29 Thread Andy Lee
I haven't seen an announcement on the list, so I thought I'd mention that CocoaBuilder is back up, with some very nice improvements. Congratulations and a million thanks to Bertrand Mansion! --Andy ___ Cocoa-dev mailing list

Re: CocoaBuilder is back

2009-12-29 Thread Andy Lee
On Dec 29, 2009, at 11:13 AM, lbland wrote: On Dec 29, 2009, at 8:25 AM, Andy Lee wrote: I haven't seen an announcement on the list, so I thought I'd mention that CocoaBuilder is back up, with some very nice improvements. Congratulations and a million thanks to Bertrand Mansion! I have

Re: Localization strategies?

2009-12-21 Thread Andy Lee
On Dec 21, 2009, at 8:18 PM, Uli Kusterer wrote: On 20.12.2009, at 21:30, Ricky Sharp wrote: Thus, I'm wondering if it would ultimately be worth it to externalize all strings from my nibs and just put everything in my single .strings file. This will clearly involve me adding tons of

Re: passing a method name?

2009-12-20 Thread Andy Lee
On Dec 20, 2009, at 1:05 PM, Jeffrey Oleander wrote: On Sun, 2009/12/20, Graham Cox graham@bigpond.com wrote: [...] Good programming practice encourages the idea that functions and methods are complete in and of themselves, and are invariant under different calling conditions.

Re: add documentation?

2009-12-13 Thread Andy Lee
On Dec 13, 2009, at 6:18 AM, Chunk 1978 wrote: is it possible to add documentation to xcode? i'd like to add the documentation for OpenAL, as i'm just starting to learn about it, and would like the connivence of command+double click. In the Xcode documentation window, search for docsets.

Re: NSNumber stringValue

2009-12-12 Thread Andy Lee
On Dec 12, 2009, at 12:51 PM, David Rowland wrote: On Dec 12, 2009, at 9:32 AM, Ben Haller wrote: You should not compare floating point numbers for equality in most cases. This is true of any language on any platform. Indeed, some floating-point numbers (such as the one represented by the

Re: NSNumber stringValue

2009-12-12 Thread Andy Lee
On Dec 12, 2009, at 1:07 PM, Andy Lee wrote: If I understand the question, it's not about converting an arbitrary decimal string to a float, but specifically a string that was generated from a float in the first place. As glenn pointed out, that string most certainly *can* be a string

Re: NSNumber stringValue

2009-12-12 Thread Andy Lee
P.P.S. Never mind, passing f = 0.12345678901234567 is a counterexample. So the answer is no, you won't get a bitwise equivalent if you do a stringValue-floatValue round trip. --Andy On Dec 12, 2009, at 1:25 PM, Andy Lee wrote: On Dec 12, 2009, at 1:07 PM, Andy Lee wrote: If I understand

Re: NSNumber stringValue

2009-12-12 Thread Andy Lee
On Dec 12, 2009, at 7:38 PM, RedleX Support wrote: My original intent was to store a representation of the float in a string so I can load it back again. In the meanwhile I found that using the %a format along with NSScanner's scanHexDouble does the trick (since I don't need that string to

Re: Best way to hook into the run loop?

2009-12-06 Thread Andy Lee
On Dec 6, 2009, at 7:36 AM, Graham Cox wrote: My fourth approach is to write my own bloody undo manager and have done with it. Result so far - bliss. FWIW, Wil Shipley agrees about the bliss part: http://wilshipley.com/blog/2007/12/transitions-and-epiphanies.html I was so into using

Re: Best way to hook into the run loop?

2009-12-06 Thread Andy Lee
On Dec 6, 2009, at 10:20 AM, Mike Abdullah wrote: On 6 Dec 2009, at 13:30, Andy Lee wrote: On Dec 6, 2009, at 7:36 AM, Graham Cox wrote: My fourth approach is to write my own bloody undo manager and have done with it. Result so far - bliss. FWIW, Wil Shipley agrees about the bliss part

Re: NSPopUpButton questions

2009-12-06 Thread Andy Lee
On Dec 6, 2009, at 11:34 AM, Matt Neuburg wrote: On Sat, 5 Dec 2009 20:29:25 -0500, timm...@gmail.com timm...@gmail.com said: The Apple docs for NSPopUpButtons says to avoid accessing it's NSMenu directly because it may need to do housekeeping. Where do the Apple docs say that? I'm

[MEET] CocoaHeads-NYC this Thursday (*note location*)

2009-12-06 Thread Andy Lee
For our last meeting of 2009, Bob Clair will talk about blocks. ** IMPORTANT NOTE ABOUT LOCATION ** The December meeting will not be at the usual Tekserve location. Instead, it will be hosted by our friends at Apress: Apress 233 Spring Street (between 6th

Re: NSPopUpButton questions

2009-12-06 Thread Andy Lee
On Dec 6, 2009, at 2:11 PM, Paul Bruneau wrote: On Dec 6, 2009, at 12:29 PM, Andy Lee wrote: Indeed, there are a few methods where the docs specifically recommend accessing the menu directly, e.g.: http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes

[NSWindow document]?

2009-12-01 Thread Andy Lee
I've stumbled onto the fact that NSWindow responds to the -document message, but I can't find any documentation for this. Normally I'd ignore this as I would any undocumented API, but (a) the method name does not begin with an underscore, (b) it seems like a reasonable property for NSWindow to

Re: [NSWindow document]?

2009-12-01 Thread Andy Lee
On Tuesday, December 01, 2009, at 06:36PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Tue, Dec 1, 2009 at 3:27 PM, Andy Lee ag...@mac.com wrote: Is there documentation that confirms window.document as a property I'm allowed to use?  Should I file a documentation bug, and/or should I file

Re: NSConnection retaining delegate?

2009-11-25 Thread Andy Lee
On Wednesday, November 25, 2009, at 12:15PM, Alexander Spohr a...@freeport.de wrote: is NSConnection retaining its delegate? (At least as long as it is collecting data) FWIW I've never used NSConnection, but in the following quick and dirty code it did not retain the delegate I gave it.

Re: setToolTip: not working

2009-11-20 Thread Andy Lee
On Nov 19, 2009, at 1:04 PM, Ben Haller wrote: This led me to suspect the custom NSView subclass that I am using as a content view, and indeed, if I use that custom subclass as the content view in Andy's code, it breaks the tooltip there too. Total shot in the dark: what if you don't change

Re: setToolTip: not working

2009-11-19 Thread Andy Lee
On Nov 18, 2009, at 8:30 PM, Gregory Weston wrote: Ben Haller wrote: [...] I get the impression that others are not seeing it because it's a problem that specially bites apps that build their UI in code, instead of in IB, and that's rare. I was trying to fish for someone who would say

Re: [MEET] CocoaHeads-NYC this Thursday, 11/12 (tonight)

2009-11-12 Thread Andy Lee
A reminder: On Nov 10, 2009, at 11:20 AM, Andy Lee wrote: Demitri Muna will talk about Cappuccino, a web UI framework that lets you build desktop-like apps using code that is eerily similar to Cocoa. Cappuccino uses Objective-J, an extension of JavaScript that looks and works like

[MEET] CocoaHeads-NYC this Thursday, 11/12

2009-11-10 Thread Andy Lee
Demitri Muna will talk about Cappuccino, a web UI framework that lets you build desktop-like apps using code that is eerily similar to Cocoa. Cappuccino uses Objective-J, an extension of JavaScript that looks and works like Objective-C. As usual: (1) Please feel free to bring questions, code,

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Andy Lee
Won't this output the digits in reverse order? --Andy On Nov 9, 2009, at 5:27 AM, Graham Cox graham@bigpond.com wrote: On 09/11/2009, at 9:01 PM, Ron Fleckner wrote: void to_binary(int n) { int r; r = n % 2; if (n = 2) to_binary(n / 2); putchar('0' +

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 6:31 AM, Mads Paulin wrote: Hi, Yes my Document class releases the array in its dealloc method and all Node objects in the array are properly dealloc'ed when deallocing the document. However, I think the problem is unrelated to the retaining of the array member of the

Re: NSTreeController and object retain counts

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 8:16 AM, Mads Paulin wrote: What strikes me as odd is that all Nodes in the document array are created and removed directly via the add and remove actions on the treecontroller. - I dont have a single external access to these objects. I would hence expect the controller

Re: beginner question, NSNumber, NSDecimalAsNumber

2009-11-09 Thread Andy Lee
On Nov 9, 2009, at 9:55 AM, Jay Swartzfeger wrote: On Mon, Nov 9, 2009 at 9:52 AM, Alastair Houghton alast...@alastairs-place.net wrote: Anyway, there are lots of neat tricks of this nature. (All of this probably isn't for newbie C programmers, though it's perfectly possible that a newbie

Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread Andy Lee
On Oct 27, 2009, at 11:11 AM, James Lin wrote: I am still having the mysterious error of Internal Error 500 message returned from stringWithContentsOfURL. Are you passing the URL you think you are passing? If you put this line in your code NSString *result = [NSString

Re: Why getting two awakeFromNib messages??

2009-10-25 Thread Andy Lee
On Oct 25, 2009, at 10:30 PM, DairyKnight wrote: Thanks for the answer. Do you know why the file's owner gets awakFromNib call as well? Is it creating a new file's owner object? Remember the purpose of a nib is to instantiate objects, set their properties, and set connections between them.

Re: Force subviews to stay in place during live resize

2009-10-24 Thread Andy Lee
On Oct 24, 2009, at 9:53 AM, Stamenkovic Florijan wrote: On Oct 24, 2009, at 08:42, Zephyroth Akash wrote: I'm creating a view containing different subviews programmatically. Like this: 1 - NSOutlineView 2 - NSView 3 - NSView This tells almost nothing to the list. Post code. Added

Re: Make an NSButton send a message on right click

2009-10-23 Thread Andy Lee
On Oct 23, 2009, at 2:42 PM, Kyle Sluder wrote: On Fri, Oct 23, 2009 at 10:55 AM, Jens Alfke j...@mooseyard.com wrote: Yup. Subclass NSButton, override -mouseDown: and check whether the event uses the right button. If so, do your thing; otherwise, call the superclass method. This isn't

Re: Dirty rects getting merged together makes for inefficient drawing

2009-10-19 Thread Andy Lee
On Monday, October 19, 2009, at 05:58PM, Ben Haller bhcocoa...@sticksoftware.com wrote: On 19-Oct-09, at 5:27 PM, Dave Keck wrote: Would NSView's -getRectsBeingDrawn:count: help? Well, I'm already using it in my own code where appropriate. (Or actually I'm using -needsToDrawRect:). But

Re: Dirty rects getting merged together makes for inefficient drawing

2009-10-19 Thread Andy Lee
it, but maybe it contains something that would help in your case? Sorry for all the might's and maybe's --I'm hoping one of my stabs in the dark will help. --Andy On Oct 19, 2009, at 9:02 PM, Ben Haller bhcocoa...@sticksoftware.com wrote: On 19-Oct-09, at 6:53 PM, Andy Lee wrote: On Monday

Re: Dirty rects getting merged together makes for inefficient drawing

2009-10-19 Thread Andy Lee
On Oct 19, 2009, at 11:00 PM, Ben Haller wrote: Well, I'm curious about the coalesced update thing. The only ref I find through Google is here: http://developer.apple.com/mac/library/documentation/Performance/Conceptual/Drawing/Articles/CocoaDrawingTips.html and I don't think that's what

Re: Programming Style: Method Definition with or without a semicolon.

2009-10-16 Thread Andy Lee
On Oct 16, 2009, at 3:55 AM, Bill Bumgarner wrote: I haven't booted my NS 0.8 cube in about a decade, but I'm pretty sure the semi-colon was always required in the header file and always allowed in the @implementation. 'Twas many a moon ago, but, I do distinctly remember triple-clicking

Re: NSString Class Instance Variables

2009-10-14 Thread Andy Lee
On Oct 14, 2009, at 3:39 AM, Ariel Feinerman wrote: It seems interesting. If I want to create my own superclass for class cluster, how can I implement it? Could you show simple example, please? Maybe Google knows? http://www.google.com/search?q=class+cluster+example The first hit is

Re: [MEET] CocoaHeads-NYC tomorrow night, Thu 10/8

2009-10-08 Thread Andy Lee
Breaking news: tonight's meeting will have door prizes generously donated by Apress. --Andy On Oct 7, 2009, at 7:59 PM, Andy Lee wrote: Alex McAuley will give a talk entitled The Wonders of kqueue. What can I say, the guy really likes kqueue. As usual: (1) Please feel free to bring

<    1   2   3   4   5   6   7   8   9   >