Re: Graphite / GraphKit
Re: Graphite / GraphKit
- Subject: Re: Graphite / GraphKit
- From: "Louis C. Sacha" <email@hidden>
- Date: Thu, 2 Dec 2004 02:10:25 -0800
Hello...
I am wanting to use Graphite / GraphKit for my application. Yes I
know it's private so don't come at me with it might break my
application ;-)
[insert standard warning about doing things in public that really are
better suited to the privacy of your own home]
it uses the data source pattern, but unlike NSTableView it doesn't
throw up log messages if the data source doesn't implement a
required data source method. In GDB when I try to step into the
[GRDataSet setDataSource:] method it steps straight over it. Class
dump doesn't show the delegate methods in an NSObject category. Does
anyone know a plan of attack to find out the required methods to
implement in the data source?
There are several possibilities that you might want to try (or a
combination thereof):
1) use class-dump on whatever Apple applications use the private framework
Pro: class-dump gives you the base type of the arguments (ie
id, float, int, etc...)
Con: there may be additional optional delegate methods that
aren't being used in the app(s) you check
2) pass a simple "test" object in the setDatatSource: message that
logs what methods are checked
Pro: you will usually (eventually) find out all of the
methods that can be implemented in the delegate
Con: you may have to do a little extra detective work in
determining the argument types
To do number 2, you basically start with a simple subclass of
NSObject that logs any missing method that is checked for at runtime,
and in most cases something like the following would probably be
enough:
/* typed in mail, etc... */
@implementation TestDataSource : NSObject
/* ... add method implementations here as you discover them ... */
@end
@implementation TestDataSource (WhyDontYouJustSayTheNameOfTheMovieYouWantToSee)
+ (BOOL)instancesRespondToSelector:(SEL)aSelector
{
BOOL responds = [super instancesRespondToSelector:aSelector];
if (!responds) {NSLog(@"TestDataSource doesn't respond to -
%@", NSStringFromSelector(aSelector));}
return responds;
}
- (BOOL)respondsToSelector:(SEL)aSelector
{
BOOL responds = [super respondsToSelector:aSelector];
if (!responds) {NSLog(@"TestDataSource doesn't respond to -
%@", NSStringFromSelector(aSelector));}
return responds;
}
@end
Then you pass an intance of this test class to be used as the data
source. Run the app, and see what method(s) were checked. Add those
methods to your implementation, rebuild the app and repeat as
necessary.
Hope that helps,
Louis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden