Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use @protocol in AppDelegate iPhone app?
    text
    copied!<p>I am working in iPhone app with 5 screens. I want to refresh the values in the screen 4th in UITabBarController. I have added @protocol in AppDelegate but it is not calling. This is the first time am using @protocol could you please help me to solve this issue,</p> <p>In <strong>AppDelegate.h</strong></p> <pre><code>@protocol ReloadViewControllerDelegate &lt;NSObject&gt; -(void) refreshViewController:(NSString *)result; @end id refreshViewControllerDelegate; @property (nonatomic, retain) id refreshViewControllerDelegate; </code></pre> <p>and i have synthesized. </p> <p>In <strong>AppDelegare.m</strong></p> <pre><code>@synthesize refreshViewControllerDelegate; if ([refreshViewControllerDelegate conformsToProtocol:@protocol(ReloadViewControllerDelegate)]) { [refreshViewControllerDelegate performSelectorOnMainThread:@selector(refreshViewController:) withObject:@"YES" waitUntilDone:NO]; }// Control not come inside of if Condition.... From here i want to update the fourthViewController.. </code></pre> <p>But <code>control not go inside of the if condition</code>. Could you please guide me where am doing wrong?</p> <p>In my <strong>4th ViewController.h</strong></p> <pre><code>#import "AppDelegate" @interface fourthViewController : UIViewController &lt;ReloadViewControllerDelegate&gt; </code></pre> <p>In my <strong>4th ViewController.m</strong></p> <pre><code>-(void) refreshViewController:(NSString *)result { NSLog(@"Result : %@", result); } </code></pre> <p>Can anyone please help me to do this? Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload