Re: [iPhone] (newbie) navigation controller is null, combining navigation controller and tab bar controller

2009-06-15 Thread Greg Titus
Hi Beth, Something that you might try, just to simplify the number of IB hookups and cut down on the possibility of errors there, is to change this line: [delegate.topicsTableNavController pushViewController:questionDetail animated:YES]; To just: [self.navigationController pushViewCont

Re: GC pros and cons

2009-06-24 Thread Greg Titus
On Jun 24, 2009, at 10:38 PM, Marcel Weiher wrote: On Jun 24, 2009, at 11:00 , Bill Bumgarner wrote: On Jun 24, 2009, at 12:51 PM, Quincey Morris wrote: In a nutshell, for folks like me who regularly use CFCreate … CFRelease in loops, what are the benefits of GC? If CFCreate/CFRelease is

Re: Undo without Redo

2009-07-12 Thread Greg Titus
On Jul 12, 2009, at 7:10 AM, John Nairn wrote: I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leav

Re: dragging to move objects around?

2009-07-22 Thread Greg Titus
Hi Darren, The point passed into -draggedImage:endedAt:operation: is in screen coordinates, which is different from the window base coordinates that - convertPointFromBase: expects. You want to convert from screen to base, and then from base to your superview's coordinate system (because t

Re: Exception-like behavior in save panel used for file choose

2009-07-31 Thread Greg Titus
On Jul 31, 2009, at 9:23 AM, Kyle Sluder wrote: On Jul 31, 2009, at 8:38 AM, Steve Christensen wrote: If you set a breakpoint on -[NSException raise], you can break when the exception actually happens. On Leopard you want to break on obj_exceptionThrow instead. Typo there... it's objc_e

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Greg Titus
Peter Duniho wrote: In C#: void setColor(NSColor color) { undoManager.prepareWithInvocationTarget(this).setColor(mColor); mColor = color; } Your point being? If you think your example is useful in presenting your claim, you'll need to be a lot more specific. [...] W

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Greg Titus
On May 19, 2008, at 10:52 AM, David Wilson wrote: On Mon, May 19, 2008 at 1:33 PM, Peter Duniho <[EMAIL PROTECTED]> wrote: Maybe I'm misinformed about how message-dispatching in Objective-C works. But AFAIK, it's nothing like the direct invocation and v-table mechanisms that exist in C# an

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Greg Titus
On May 19, 2008, at 11:00 AM, Peter Duniho wrote: On May 19, 2008, at 10:48 AM, Greg Titus wrote: You've translated the Objective-C syntax into C# syntax, but the point of the question is to think about what prepareWithInvocationTarget() does. How would you write that method

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Greg Titus
On May 19, 2008, at 12:08 PM, Peter Duniho wrote: [...] However, _with_ reflection we can do much of the same kinds of things that Obj-C does, without knowing in advance the classes that might use the NSUndoManager class. One advantage I see in Cocoa is that, because classes may respond to

Re: Trying to understand -- please help...

2008-05-22 Thread Greg Titus
On May 21, 2008, at 12:37 PM, Johnny Lundy wrote: This is just one example of that "little tidbit" that is always left out of these references by Apple. It seems to be the <.O. for some reason. The "tidbit" isn't some extraneous bell or whistle; it's always something fundamental. They c

Re: How hard is it to learn Cocoa - Survey ?

2008-05-25 Thread Greg Titus
I think it'll be very hard to compare learning times then to learning times now because the frameworks involved are quite a bit different. I started working on Cocoa stuff for Omni near the end of 1993. A lot of the concepts behind the AppKit class hierarchy have changed surprisingly little

Re: Detecting a resize window event?

2008-05-25 Thread Greg Titus
Assuming you are asking because you need to do drawing differently based on whether resizing is taking place, see here: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/CocoaLiveResize.html You'll want to override the -viewWillStartLiveResize and - viewDidEn

Re: Detecting a resize window event?

2008-05-25 Thread Greg Titus
In your NSView: - (void)viewDidMoveToWindow { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification object:[self window]]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self];

Re: Good mouse tracking design for dynamic view?

2008-06-26 Thread Greg Titus
On Jun 26, 2008, at 11:56 AM, Douglas Davidson wrote: On Jun 26, 2008, at 11:20 AM, Nathan Vander Wilt wrote: So it seems I need to do more bookwork myself, but I'm wondering which direction others would recommend: a) Set up a single tracking area for the whole view, and perform all my ow

Re: Delete action from variety of key presses

2008-07-07 Thread Greg Titus
Hi Nathan, By overriding -keyDown: and not calling [super keyDown:keyEvent], you have stopped your view from actually processing the keys any further. That's why you aren't getting to either of the delete methods. Hope this helps, - Greg On Jul 7, 2008, at 4:59 PM, Nathan Vander Wi

Re: Remove overlap on NSBezierPath

2008-07-14 Thread Greg Titus
On Jul 14, 2008, at 4:24 AM, Graham Cox wrote: Right now I use GPC and (optional) curve fitting. It keeps the curves in terms of their appearance but can greatly alter the number and location of the control points. I don't like it much either - one reason I'd love there to be a great soluti

Re: Remove overlap on NSBezierPath

2008-07-14 Thread Greg Titus
Thanks! - Greg On Jul 14, 2008, at 4:24 AM, Graham Cox wrote: On 14 Jul 2008, at 7:48 pm, Georg Seifert wrote: Hello, Thanks for you replies. To clarify: I need it in a small drawing app, where you can draw shapes and then you should be able to combine them. There is no outline

Re: Blue lines

2008-07-15 Thread Greg Titus
Interface Builder actually makes a couple of windows to do that. One wide window for the horizontal part of the line, and another tall and thin window for the vertical part. The positions of the windows change as your mouse moves, and they have simple views inside that draw basically just b

Re: Tabbed preference panels

2008-08-22 Thread Greg Titus
You may also want to take a look at OmniAppKit's OAPreferences implementation: . Hope this helps, - Greg On Aug 22, 2008, at 9:29 AM, Sumner Trammell wrote: Hi, I'm working on a preferences panel. I want to build a compound panel like the kind see

Re: array segment

2008-09-01 Thread Greg Titus
Hi James, It sounds like you want -subarrayWithRange: Hope this helps, - Greg On Sep 1, 2008, at 8:37 AM, James Maxwell wrote: Hello All, Is there an obj-C equivalent to Java's System.arraycopy() which will allow me to easily copy a segment of an NSArray into a new array? If so,

Re: How to track Slider's value while dragging the mouse?

2008-09-24 Thread Greg Titus
Hi Oleg, The property you want is setContinuous:YES, or check the "Continuous" checkbox in Interface Builder. (The method is defined on NSSilder's superclass, NSControl.) Hope this helps, - Greg On Sep 24, 2008, at 7:08 AM, Oleg Krupnov wrote: NSSlider only changes its value (and

Re: cocoa http client library

2008-03-28 Thread Greg Titus
Hi Sandeep, Look some more. :-) NSMutableURLRequest, which is the request you pass to the NSURLConnection should allow you to set whatever custom headers you need. - Greg On Mar 28, 2008, at 11:27 AM, C Sandeep wrote: Hi Jens, Thanks. I looked at NSURLConnection docs. It doesn't

Re: Cocoa-dev Digest, Vol 5, Issue 600

2008-04-13 Thread Greg Titus
On Apr 13, 2008, at 12:40 PM, Alex Curylo wrote: No, I can personally assure you that exact practice has led me to finding many dozens -- quite possibly several hundreds by now actually -- of 'calling methods of a deleted object' type bugs in C+ + code, particularly game code I port from Win

Re: Stale Objective-C object pointer detection

2008-04-13 Thread Greg Titus
s has the added advantage of being able to more easily see what the pointer _used_ to point to, because the zombie has information about the original class name. - Greg On Apr 13, 2008, at 1:35 PM, Alex Curylo wrote: On 13-Apr-08, at 1:06 PM, Greg Titus wrote: The big difference is

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Greg Titus
I think you'd ask the NSEvent for its -keyCode, then pass that key code to UCKeyTranslate() with all the modifier key state (including shift) turned off in order to get a unicode string for what that key would mean if the user hadn't been pressing any modifiers. Hope that helps, - G

Re: Hyperlinks

2009-01-08 Thread Greg Titus
Hi Matt, You need to use an NSTextView here rather than an NSTextField. The behavior you are seeing is because an NSTextField is not 'active' until clicked upon, and then it gets the window's field editor (which is a shared NSTextView used by all fields on the window), and places that vie

Re: What's the most cocoa-ey pattern for this?

2009-01-08 Thread Greg Titus
Hey Wave, Is the Sequence delegate interested in all Element/Markers moved into and out of? Or only some small subset? If the former, you really just want something like: NSNotificationCenter* ctr = [NSNotificationCenter defaultCenter]; SEL s = @selector(enteredElement:); [ctr addObserver:de

Re: What's the most cocoa-ey pattern for this?

2009-01-08 Thread Greg Titus
On Jan 8, 2009, at 3:28 PM, j o a r wrote: On Jan 8, 2009, at 2:59 PM, Michael B Johnson wrote: This Sequence has a delegate, that would like to express interest in the following: (1) when the "current time" moves forward into the beginning of an Element or Marker. (2) when the "current

Re: How to add a -(unsigned long long)unsignedLongLongValue method to NSString

2009-01-11 Thread Greg Titus
On Jan 11, 2009, at 10:48 AM, Kyle Sluder wrote: On Sun, Jan 11, 2009 at 2:50 AM, Ken Thomases wrote: Sure it would. Both unichar (as typedef'd) and char are integer types in C. '7' is another way of writing a number, although not the number 7. Which number depends on the encoding of yo

Re: ObjC in time-critical parts of the code

2009-01-15 Thread Greg Titus
Jens, The point of what people are trying to tell you is that the result you are getting (3ms per empty Objective-C call) is approximately 500,000 times longer than the time you ought to be getting (5-6ns). If an Objective-C message send took 3 milliseconds (333 method calls per second!),

Re: NSMutableArray comparator; sorting on insert

2009-01-16 Thread Greg Titus
On Jan 16, 2009, at 8:27 AM, David Harper wrote: Hello, I have written a comparator that returns an NSComparisonResult based on the comparison of two objects as required for [(NSMutableArray *)someArray sortUsingSelector:@selector(theSelector:)] Now, I want this array to remain sor

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Greg Titus
On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: Jean-Daniel Dupas wrote: > > Each time you use KVC/KVO. Hi Jean-Daniel, Sorry if I misreading this, your response was short - it could mean a few things. I am inclined to think you were responding to my question "how often do your subcla

Re: Still can't get NSFormatter working....

2009-02-17 Thread Greg Titus
How about take a step back. Is 'nameField' hooked up in IB correctly so that the formatter is actually being set on a real field? You might try logging both 'nameField' and '[nameField formatter]' right after your code to assign it. Hope this helps, Greg On Feb 17, 2009, at 7:57 AM

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-18 Thread Greg Titus
Brian, The way to handle this is to _not_ respond to memory warnings in subclasses (at least not for the purposes of view outlet handling - there may be other non-view memory you want to free up in response to a memory warning). Instead, implement -setView: in your UIViewController subcla

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-19 Thread Greg Titus
On Nov 19, 2008, at 7:00 AM, Brian Stern wrote: This leaves us for now with two solutions: (a) Greg's (override setView:) which is more future-proof but is in many respects academically unsatisfying. (b) For non-top-level-object, specify an assign attribute for the property -- and risk dang

Re: NSIndexSet

2008-11-21 Thread Greg Titus
On Nov 21, 2008, at 7:44 AM, David Blanton wrote: How would one construct an NSIndexSet containing the indices 2,4,5 ? I did: NSRange two = NSMakeRange(2, 1); NSRange four = NSMakeRange(4, 1); NSRange five = NSMakeRange(5, 1); NSRange u1 = NSUnionRange(two,four)

Re: CGPoint and CGRect

2008-11-21 Thread Greg Titus
On Nov 21, 2008, at 3:19 PM, DKJ wrote: I want to determine whether a line between two CGPoints in a view intersects with a given CGRect. There's nothing in the CGGeometry reference that does this specifically, and I don't yet see how to use the functions that are there to figure this out.

Re: NSLog with %f and comparisons using ==

2009-04-11 Thread Greg Titus
If what you really want is to see whether the result is the same as %f previously printed, then you could always make your array of constants an array of constant _strings_ and then compare the strings. Not terribly efficient, maybe, but straightforward. - Greg On Apr 11, 2009, at