Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Declare two different delegates. Best way, Never instantiate the same delegate twice as it will end up in weird juju happening with your code. </p> <p>In your UIImagePickerController.h write:</p> <pre><code> #pragma mark - Protocols advance declarations @protocol imageTypeADelegate @required -(void) takeImageOfTypeA:(id)object; @end #pragma mark - Protocols advance declarations @protocol imageTypeBDelegate @required -(void) takeImageOfTypeB:(id)object; @end </code></pre> <p>add them to your property declarations as such</p> <pre><code> #pragma mark - Property declarations @property (assign) id &lt;imageTypeADelegate&gt; typeADelegate; @property (assign) id &lt;imageTypeADelegate&gt; typeBDelegate; </code></pre> <p><strong>Then</strong> you on your .m file add:</p> <pre><code> #pragma mark - Protocols -(void) pressedButtonToTakeImageOfTypeA:(id)sender; { [[self _typeADelegate] takeImageOfTypeA:(id)object]; } -(void) pressedButtonToTakeImageOfTypeB:(id)sender; { [[self _typeBDelegate] takeImageOfTypeB:(id)object]; } </code></pre> <p>Then on whatever class you need them to run a routine all you have to do is add this to the .h you want it to notify</p> <pre><code> #import "UIImagePickerController.h" @interface OtherViewController : UIViewController &lt;imageTypeADelegate, imageTypeBDelegate&gt; </code></pre> <p>and on your .m somewhere</p> <pre><code>-(void) takeImageOfTypeA:(id)object; { // Do something } -(void) takeImageOfTypeA:(id)object; { // Do something } </code></pre> <p>/~End of Line</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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