Re: Conceptual problem
Re: Conceptual problem
- Subject: Re: Conceptual problem
- From: Chris Hanson <email@hidden>
- Date: Thu, 9 Jan 2003 02:18:21 -0600
At 6:01 PM +1300 1/9/03, Michael Norris wrote:
For instance: [MyDocument newEntry] is obviously wrong, as the
compiler complains about "factory methods". How would I get a handle
to the current instantiation of the NSDocument class?
Or is this a conceptual problem I'm having? Should I be sending that
message somewhere else?
Probably.
I'd implement it as something your table view's delegate can handle,
using something like this:
- (void)userHitTabInLastRow
{
id myDelegate = [self delgate];
if ([myDelegate respondsToSelector:@(userHitTabInLastRowOfTableView:)]) {
[myDelegate userHitTabInLastRowOfTableView:self];
}
}
Then make your NSDocument subclass -- or whatever object you want to
actually handle adding a new row to the bottom of your table view --
your table view's delegate in Interface Builder, and have it respond
to the message -userHitTabInLastRowOfTableView:(MyTableView *).
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.