Okay so i am wanting to create a tweak that hooks into the MPMovieController.h
file and changes the scaling button to another button. So firstly i checked i can hook into that class just for testing reason, so i hooked into the play function to see if when a video had began playing if i could show a UIAlertView
. However I was unable to do so. Even though everything compiled fine and the DEB file was built successfully I still can not get this message to appear when the movie player is playing.
This is my Code:
Tweak.xm:
#import <UIKit/UIKit.h>
@interface MPMoviePlayerController
-(void)play;
@end
%hook MPMoviePlayerController
-(void)play
{
NSString *Title = [NSString stringWithFormat:@"Title", nil];
NSString *message = [NSString stringWithFormat:@"Message", nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:Title message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
%orig;
}
%end
Thanks. P.S. After Installing I have reset and re-sprung my iphone.