I'm not sure what you mean by device-specific delegates. I'm assuming that by "shared delegate" you're referring to your application delegate. If you needed something specific to iPhone or iPad, you could do this:
BOOL isiPad = NO;
if ([UIDevice instancesRespondToSelector:@selector(userInterfaceIdiom)]) {
UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom];
if (idiom == UIUserInterfaceIdiomPad) {
isiPad = YES;
}
}
if (isiPad) {
// iPad-specific stuff
} else {
// iPhone-specific stuff
}
That's better than using #define
s because you can compile one universal app to work across all iOS devices.
EDIT: Added some introspection to prevent this from crashing on iPhone OS 3.1.x and earlier. Thanks, Bastian.