Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @interface NSURLRequest (MyURLRequest)
- @end
- @implementation NSURLRequest (MyURLRequest)
- - (id) MyMakeRequest:(NSURL *)theURL{
- NSLog(@"WHOA IN HERE");
- return [self requestWithURL:theURL];
- }
- @end
- @implementation MyPlugin
- + (MyPlugin *)sharedInstance
- {
- static MyPlugin* plugin = nil;
- if (plugin == nil)
- plugin = [[MyPlugin alloc] init];
- return plugin;
- }
- + (void) load
- {
- MyPlugin* plugin = [MyPlugin sharedInstance];
- Method method = nil;
- method = class_getInstanceMethod(NSClassFromString(@"NSURLRequest"),@selector(requestWithURL));
- if(method == nil){
- NSLog(@"Couldn't find method...");
- } else {
- NSLog(@"Found method...");
- }
- NSLog(@"DMyPlugin installed");
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement