How do I call a function from the model that binds the model delegate to the delegate?

I am designing a model that UIPopoverController

the iPhone can have . The model has a delegate (class UIViewController

), I bind a function that adds UITapGestureRecognizer

for the delegate in the model, how can I initialize the model and call the function.

I can do this because I found that Xcode called the same name function in the delegate, which did not call the function in the model;

Here's some code:

if ([self isKindOfClass:[UIViewController class]])
{
    UIViewController *presentViewController = (UIViewController*)self.delegate;

    [presentViewController.view addSubview:INviewController.view];

    [self addGesture]
}

self.tapGR = [[UITapGestureRecognizer alloc]initWithTarget:self.delegate action:@selector(test)];

      

+3
ios objective-c iphone


source to share


No one has answered this question yet

Check out similar questions:

1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
1276
How can I disable ARC for one file in a project?
1172
How can I disable the selection of a UITableView?
1141
How can I develop for iPhone using Windows development machine?
928
How do I call Objective-C code from Swift?
661
How do I create delegates in Objective-C?
227
What are the dangers of Swizzling method in Objective-C?
2
Monotouch binding does not accept delegate model
2
UIScrollView not working properly for iPhone6 ​​and iPhone 6Plus
1
Invalid delegate method



All Articles
Loading...
X
Show
Funny
Dev
Pics