SBAwayDateView
doesn't have sharedInstance
nor updateClock
class methods.
In cases when you are working with class that is not a singleton you need to either find valid instance of this class in some other class - it might contain it in instance variable or return from some method. Or you can hook init
method and save somewhere instances yourself. Depends on what you want to do.
In your case SBAwayView
has instance variable SBAwayDateView *_dateHeaderView
- problem solved
%hook SBAwayView
-(void)updateInterface
{
//do some stuff
SBAwayDateView* dateView = MSHookIvar<SBAwayDateView*>(self, "_dateHeaderView");
[dateView updateClock];
//run %orig;
%orig;
}
%end