Re: Delegates

2008-05-19 Thread Andy Lee
D'oh, I see that point was already made. --Andy On May 19, 2008, at 2:52 PM, Andy Lee wrote: Another difference between delegates and observers is that delegates sometimes have the power of veto over some operation (e.g., - applicationShouldTerminate: and -textShouldEndEditing:), whereas

Re: Delegates

2008-05-19 Thread Andy Lee
On May 19, 2008, at 2:54 PM, Michael Vannorsdel wrote: I know this discussion can go round and round, but I still think reading the english dictionary for delegates won't tell you the whole story on Cocoa delegates. There's also Wikipedia:

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Andy Lee
Am 19.05.2008 um 13:11 Uhr schrieb Peter Duniho: I just don't see how declaring an interface and then using it is so inferior to an informal protocol that it justifies the entire message-dispatching paradigm, especially given that there are in fact advantages to the former. At best, it's a

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Andy Lee
On May 19, 2008, at 4:29 PM, Jayson Adams wrote: On May 19, 2008, at 12:51 PM, Andy Lee wrote: * Interface Builder is sometimes given as an example of an app that would be more difficult to write in, say, Java. It's not - I did this in a past life, with Control-drag to form connections

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Andy Lee
On May 19, 2008, at 4:36 PM, Peter Duniho wrote: But not the sort of compelling we really need the language to be this way otherwise it just doesn't work example I was hoping for. I wonder -- just thinking out loud now -- if this standard is too high for Objective-C to meet. I also wonder

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Andy Lee
On May 19, 2008, at 6:06 PM, Peter Duniho wrote: Date: Mon, 19 May 2008 15:51:07 -0400 From: Andy Lee [EMAIL PROTECTED] * Objective-C allows you to create categories, effectively modifying a class's interface at runtime. C# provides partial class implementations for when you want to split

Re: Guidance for Cocoa's steep learning curve

2008-05-16 Thread Andy Lee
On May 16, 2008, at 10:50 AM, Jens Alfke wrote: but there are still a lot of concepts and details to learn, and many times their topology does not reduce to a directed acyclic graph (i.e. you can't present them in order without forward references.) Jens, I was going to bring up the concept

Re: The challenge for Cocoa's on-line documentation

2008-05-16 Thread Andy Lee
On May 16, 2008, at 5:05 PM, Erik Buck wrote: [Re-post from http://www.cocoabuilder.com/archive/message/cocoa/2007/8/20/188026 ] That was well worth reposting. This may partly answer my question about why people don't notice or study the concepts docs. Maybe we're too used to clicking on

Re: Bypassing Interface Builder

2008-05-15 Thread Andy Lee
On May 14, 2008, at 10:33 PM, Johnny Lundy wrote: So it's the application instance. I don't understand what the application instance is. I can recite the documentation, which says it is a shared instance of NSApplication, also known as NSApp which is a global variable, none of which help

Re: Launching Cocoa Application externally

2008-05-14 Thread Andy Lee
Is MyApp.app a Release build or a Debug build? --Andy On May 14, 2008, at 11:13 AM, Yann Disser wrote: The App runs fine in gdb and even writes the output file. Still the same error (crash and no output written) when running it with open MyApp.app. Yann On 14. May 2008, at 16:47,

Re: Bypassing Interface Builder

2008-05-14 Thread Andy Lee
On May 14, 2008, at 11:11 AM, I. Savant wrote: I rather just make it in Xcode or Textmate and know what's going on behind the scenes. Using IB and knowing what goes on behind the scenes are not mutually exclusive. I use IB and (because I thoroughly read the documentation) know what's going on

Re: Bypassing Interface Builder

2008-05-14 Thread Andy Lee
On May 14, 2008, at 11:35 AM, colo wrote: Hmmm. The letting it create the files in the nib file sounds fine for me. But what about the linking and configuring? It's just all reflected in code correct? The dragging a pipe to one object to the other that just all shows up in the .m right? No.

Re: NSRange

2008-05-14 Thread Andy Lee
On May 14, 2008, at 7:25 PM, Mr. Gecko wrote: Hello I am trying to find out how to get characters in the middle of two characters I have heard of NSRange but I can't find documentation to it in xcode. Enter NSRange in the search field of the Xcode documentation window and do an API

Re: Bypassing Interface Builder

2008-05-14 Thread Andy Lee
On May 14, 2008, at 8:45 PM, Graham Cox wrote: On 15 May 2008, at 10:15 am, Johnny Lundy wrote: Also, the documentation only says about File's Owner that it is the object that loaded the nib file. What is that object, if my nib file just gets loaded at application launch? It depends. It's

Re: Bypassing Interface Builder

2008-05-14 Thread Andy Lee
On May 14, 2008, at 8:51 PM, I. Savant wrote: Also, the documentation only says about File's Owner that it is the object that loaded the nib file. What is that object, if my nib file just gets loaded at application launch? Your app's NSApplication instance. This is in the documentation.

Re: Bypassing Interface Builder

2008-05-14 Thread Andy Lee
It might get confusing if you have multiple objects with differently named outlets pointing to the same thing. --Andy On May 14, 2008, at 9:02 PM, Graham Cox wrote: Actually I wonder if this could be a useful enhancement to IB? Say if you've never edited the object's name from the default,

Re: NSURL urlWithString return nil

2008-05-12 Thread Andy Lee
Another possibility is that there is an invisible character in your URL (perhaps due to copy-paste) which Safari is kind enough to escape for you as %11. I would try deleting the showtopic449 part and retyping it by hand to make sure there is no hidden character between topic and 449.

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 2:59 PM, Philip Bridson wrote: Can anyone tell me why when I use [MyWindow center] the window ends up about an inch from the top of the screen? I thought this method is meant to center the window. Is there something I am doing wrong? Only not reading the documentation. :)

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 3:06 PM, Andy Lee wrote: center Sets the receiver’s location to the center of the screen. - (void)center Discussion The receiver is placed exactly in the center horizontally and somewhat above center vertically. [...] In fairness, I think it's easy to stop reading after

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 4:05 PM, Philip Bridson wrote: I am sorry if I have offended you. Sean was more gracious than I was. Let's forget about the whole thing. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 3:52 PM, Sean McBride wrote: I suspect that back in the NeXTStep days it actually did centre it. But when NeXTStep merged with Mac OS, the behaviour was changed to match the Mac OS behaviour. In Classic Mac OS this position is called the 'alert position'. See for example

Re: Off Topic: selling a product line

2008-05-07 Thread Andy Lee
On May 7, 2008, at 8:31 PM, Kimo wrote: I hope this topic is not too far off-topic. I would say it is pretty far off-topic. Try this list, where questions very similar to yours have been asked a lot: http://tech.groups.yahoo.com/group/mac-gui-dev/ --Andy

Re: Off Topic: selling a product line

2008-05-07 Thread Andy Lee
Please disregard. I was confusing this with the list Andrew Merenbach pointed to. Sorry for the noise. --Andy On May 7, 2008, at 8:44 PM, Andy Lee wrote: On May 7, 2008, at 8:31 PM, Kimo wrote: I hope this topic is not too far off-topic. I would say it is pretty far off-topic. Try

Re: -draggingEntered: never gets called [solved?]

2008-05-06 Thread Andy Lee
I haven't been following this thread and I'm not sure this would make a difference, but do you really mean -init:, or -initWithFrame:? --Andy On May 6, 2008, at 10:27 AM, Michael Gardner wrote: With help from Stéphane Sudre, I found that calling - registerForDraggedTypes: somewhere outside

Re: Cocoa UI Question

2008-05-06 Thread Andy Lee
On May 6, 2008, at 12:16 PM, Kristopher Matthews wrote: (I apologize in advance if this question is not appropriate for this list.) Here's a list it's definitely appropriate for: http://tech.groups.yahoo.com/group/mac-gui-dev/ --Andy ___

Re: Forwarding messages from an application delegate

2008-05-02 Thread Andy Lee
Delegate methods aren't sent at all unless the delegate implements them. I think your delegate is going to have to implement all possible delegate methods and then forward them *if* the old delegate implements them, and otherwise return an appropriate default value if there is a return

Re: Custom View initialization: where?

2008-05-02 Thread Andy Lee
The doc I found says there are *two* ways a custom view is initialized. One uses initWithFrame:, the other doesn't. Are you sure your case is the first case? It sounds like it, but I thought I'd double-check.

Re: [MEET] May CocoaHeads Mac Developer Meetings

2008-04-30 Thread Andy Lee
Also, the NYC CocoaHeads group will meet on Thursday, May 8, from 6:00-8:00 PM. Location: Tekserve, on 23rd St. west of 6th Ave http:// www.tekserve.com --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Deleting preference file from within the application

2008-04-29 Thread Andy Lee
If you call this, the prefs file will be deleted for you, and will stay deleted: [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@bundle.identifier.for.your.app]; I tested this by calling it in -applicationWillTerminate:. I assume you could call it

Re: Deleting preference file from within the application

2008-04-29 Thread Andy Lee
This would be better than hard-coding the bundle identifier... [[NSUserDefaults standardUserDefaults] removePersistentDomainForName: [[NSBundle mainBundle] bundleIdentifier]]; --Andy On Apr 29, 2008, at 2:18 AM, Andy Lee wrote: If you call this, the prefs file

Re: How to adopt a superclass's protocol?

2008-04-29 Thread Andy Lee
Sorry to answer a question with a question, but will this really do what you want? I see from the docs that the @optional keyword means the method is not required. Doesn't that mean you can conform to the Check protocol without implementing -optionalMethodToImplement, which would mean

Re: NSTextField with NSLevelIndicator

2008-04-28 Thread Andy Lee
Give your text field a delegate, and in the delegate implement - controlTextDidChange:. See the docs for more details. --Andy On Apr 28, 2008, at 3:17 PM, Philip Bridson wrote: Hi there, I want to create a password analysis tool that updates an NSLevelIndicator with each character entered

Re: NSTextField with NSLevelIndicator

2008-04-28 Thread Andy Lee
I don't use them much. Thanks, Phil On Monday, April 28, 2008, at 08:34PM, Andy Lee [EMAIL PROTECTED] wrote: Give your text field a delegate, and in the delegate implement - controlTextDidChange:. See the docs for more details. --Andy On Apr 28, 2008, at 3:17 PM, Philip Bridson wrote: Hi

AppKiDo, delegates, known bugs

2008-04-28 Thread Andy Lee
There was a question here recently that asked for clarification on the use of a delegate method. I thought I'd mention that one of the goals of my application AppKiDo was to help people see what delegates are. In the Quicklist drawer, you can click on Classes with delegates to see all

Re: Uneditable NSTableView

2008-04-23 Thread Andy Lee
On Apr 23, 2008, at 4:33 AM, Ewan Delanoy wrote: I have the line [uneditableTableView setDoubleAction:@selector(updateLowerPartAfterSelectionInUpperPart:)]; Unfortunately, this doesn't work : although the rows are indeed uneditable and I can select any one of them, the

Re: Uneditable NSTableView

2008-04-23 Thread Andy Lee
Good question -- if you want the double action to be called, you have to set the app controller to be the table view's target, not just its delegate. You can, of course, make the connection in IB; you don't have to use setTarget:. --Andy On Apr 23, 2008, at 5:22 AM, Ian Jackson wrote:

Re: Problems with [NSArray count]

2008-04-22 Thread Andy Lee
On Apr 22, 2008, at 5:03 PM, Peter Browne wrote: The docs tell me that [NSArray count] returns an NSUInteger, but exactly WHAT one of these is, or how I use it is baffling me. You could do a search using the built-in documentation browser in Xcode (it's in the Help menu). Alternatively,

Re: Subclassing

2008-04-18 Thread Andy Lee
On Apr 18, 2008, at 5:56 PM, K. Darcy Otto wrote: I am working on a program with a complex hierarchy of classes, and I want to subclass one of the objects a few steps down on that hierarchy. Do I have to create a parallel hierarchy to do this? Here is the problem: AppController

Re: ObjC static member variable

2008-04-10 Thread Andy Lee
On Apr 10, 2008, at 4:08 PM, Scott Ribe wrote: Yes that works but then it becomes a global variable. Not when it's declared static. As in plain C, static variables are at file scope. If you really want to access it via instances of the Objective-C class (or the class itself), you'll just

Re: KVC - how to get properties into a common form?

2008-04-03 Thread Andy Lee
Right, it depends on your requirements for the common form. Rather than do a huge switch statement, you could add your own - myDescription method in a category of NSObject. It could call - description by default, and you could override it in categories of other classes you care about where

Re: Name of NSTableView

2008-04-02 Thread Andy Lee
Here's what it _sounds_ like you're trying to do. Let me know if I've misunderstood: * You have multiple table views. * The data source logic for all of them is essentially the same. * You are trying to have one _instance_ of your data source class be the data source for all of your

Re: Best practice for overridden initializers in subclasses

2008-03-25 Thread Andy Lee
A similar question was asked recently. To paraphrase (and slightly correct) my reply: I do essentially this: - (id)init { NSLog(@%@ -- '%@' is not the designated initializer, [self class], NSStringFromSelector(_cmd)); [self release]; return nil; } You can imagine

Re: Best practice for overridden initializers in subclasses

2008-03-25 Thread Andy Lee
On Mar 25, 2008, at 8:09 PM, Quincey Morris wrote: On Mar 25, 2008, at 16:26, Andy Lee wrote: - (id)init { NSLog(@%@ -- '%@' is not the designated initializer, [self class], NSStringFromSelector(_cmd)); [self release]; return nil; } Unless there is some special runtime magic

Re: best practices for object instance initialization

2008-03-21 Thread Andy Lee
On Mar 21, 2008, at 4:07 PM, Stuart Malin wrote: 1) Do I just let -init dangle (so to speak)? and then if I ever forget that the object needs special initialization and instead call -init, the code will end up failing down the line somewhere where those initialization parameters matter...

Re: Can CoreData return only unique results of an attribute

2008-02-26 Thread Andy Lee
Wouldn't it be cheaper to put the URLs into an NSMutableSet, if you're discarding the names anyway? --Andy On Feb 26, 2008, at 9:08 PM, Jim Murry wrote: Populate an NSMutableDictionary using our objects: setObject:@Sam forKey:@http://www.aol.com; setObject:@Adam

<    4   5   6   7   8   9