<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>NSObject(A2BlockDelegate) Category Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.0.5 (build 789)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">BlocksKit 1.8.1 </a></h1>
				<a id="developerHome" href="../index.html">Pandamonia LLC</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">NSObject(A2BlockDelegate) Category Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/linkDataSourceMethods:">&nbsp;&nbsp;&nbsp;&nbsp;+ linkDataSourceMethods:</option>
	
	<option value="//api/name/linkDelegateMethods:">&nbsp;&nbsp;&nbsp;&nbsp;+ linkDelegateMethods:</option>
	
	<option value="//api/name/linkProtocol:methods:">&nbsp;&nbsp;&nbsp;&nbsp;+ linkProtocol:methods:</option>
	
	<option value="//api/name/registerDynamicDataSource">&nbsp;&nbsp;&nbsp;&nbsp;+ registerDynamicDataSource</option>
	
	<option value="//api/name/registerDynamicDataSourceNamed:">&nbsp;&nbsp;&nbsp;&nbsp;+ registerDynamicDataSourceNamed:</option>
	
	<option value="//api/name/registerDynamicDelegate">&nbsp;&nbsp;&nbsp;&nbsp;+ registerDynamicDelegate</option>
	
	<option value="//api/name/registerDynamicDelegateNamed:">&nbsp;&nbsp;&nbsp;&nbsp;+ registerDynamicDelegateNamed:</option>
	
	<option value="//api/name/registerDynamicDelegateNamed:forProtocol:">&nbsp;&nbsp;&nbsp;&nbsp;+ registerDynamicDelegateNamed:forProtocol:</option>
	
	
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Linking Block Properties">Linking Block Properties</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Delegate replacement properties">Delegate replacement properties</a></span></li>
	
</ul></li>







<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/linkDataSourceMethods:">linkDataSourceMethods:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/linkDelegateMethods:">linkDelegateMethods:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/linkProtocol:methods:">linkProtocol:methods:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/registerDynamicDataSource">registerDynamicDataSource</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/registerDynamicDataSourceNamed:">registerDynamicDataSourceNamed:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/registerDynamicDelegate">registerDynamicDelegate</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/registerDynamicDelegateNamed:">registerDynamicDelegateNamed:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/registerDynamicDelegateNamed:forProtocol:">registerDynamicDelegateNamed:forProtocol:</a></span></li>
	
</ul></li>




			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="NSObject(A2BlockDelegate) Category Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">NSObject(A2BlockDelegate) Category Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">A2BlockDelegate.h</td>
</tr>
						</tbody></table></div>
					
					
					
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>The A2BlockDelegate category extends features provided by <a href="../Classes/A2DynamicDelegate.html">A2DynamicDelegate</a>
to create custom block properties in a category on a delegating object and
dynamically map them to delegate (<code>UIAlertViewDelegate</code>), data source
(<code>UITableViewDataSource</code>), or other delegated protocol
(<code>NSErrorRecoveryAttempting</code>) methods.</p>

<p>A2BlockDelegate also supports replacing the delegate of a given class with an
automatic &ndash; though optional &ndash; version of these block-based properties, while
still allowing for traditional method-based delegate implementations.</p>

<p>Simply call one of the methods in the category on a class to add a block
property to that class, preferably during a <code>+load</code> method in a category.</p>

<p>To interplay between classes that support delegation but are extended to have
block properties through delegate replacement extended to have block
properties, one should implement an <code>A2Dynamic&lt;ProtocolName&gt;</code> subclass of
<a href="../Classes/A2DynamicDelegate.html"><code>A2DynamicDelegate</code></a>. This behavior is documented in detail in the class
documentation for <a href="../Classes/A2DynamicDelegate.html">A2DynamicDelegate</a>, and examples exist in BlocksKit.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Linking Block Properties" name="task_Linking Block Properties"></a>
						<h3 class="subsubtitle task-title">Linking Block Properties</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/linkDataSourceMethods:">+&nbsp;linkDataSourceMethods:</a></code>
		<span class="tooltip"><p>Synthesizes multiple properties and links them to the appropriate selector
in the data source protocol.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/linkDelegateMethods:">+&nbsp;linkDelegateMethods:</a></code>
		<span class="tooltip"><p>Synthesizes multiple properties and links them to the appropriate selector
in the delegate protocol.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/linkProtocol:methods:">+&nbsp;linkProtocol:methods:</a></code>
		<span class="tooltip"><p>Synthesizes multiple properties and links them to the appropriate selector
in the given protocol.</p></span>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Delegate replacement properties" name="task_Delegate replacement properties"></a>
						<h3 class="subsubtitle task-title">Delegate replacement properties</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/registerDynamicDataSource">+&nbsp;registerDynamicDataSource</a></code>
		<span class="tooltip"><p>Registers a dynamic data source replacement using the property name
<code>dataSource</code> and the protocol name <code>FooBarDataSource</code> for an instance of
<code>FooBar</code>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/registerDynamicDelegate">+&nbsp;registerDynamicDelegate</a></code>
		<span class="tooltip"><p>Registers a dynamic delegate replacement using the property name <code>delegate</code>
and the protocol name <code>FooBarDelegate</code> for an instance of <code>FooBar</code>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/registerDynamicDataSourceNamed:">+&nbsp;registerDynamicDataSourceNamed:</a></code>
		<span class="tooltip"><p>Registers a dynamic data source replacement using the given property name
and the protocol name <code>FooBarDataSource</code> for an instance of <code>FooBar</code>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/registerDynamicDelegateNamed:">+&nbsp;registerDynamicDelegateNamed:</a></code>
		<span class="tooltip"><p>Registers a dynamic delegate replacement using the given property name and
the protocol name <code>FooBarDelegate</code> for an instance of <code>FooBar</code>.</p></span>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/registerDynamicDelegateNamed:forProtocol:">+&nbsp;registerDynamicDelegateNamed:forProtocol:</a></code>
		<span class="tooltip"><p>Registers a dynamic protocol implementation replacement
using the given property name and the given protocol.</p></span>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/linkDataSourceMethods:" title="linkDataSourceMethods:"></a>
	<h3 class="subsubtitle method-title">linkDataSourceMethods:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Synthesizes multiple properties and links them to the appropriate selector
in the data source protocol.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)linkDataSourceMethods:(NSDictionary *)<em>selectorsForPropertyNames</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>selectorsForPropertyNames</em></dt>
			<dd><p>A dictionary with property names as keys and
selector strings as objects.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p><a href="../Classes/A2DynamicDelegate.html">A2DynamicDelegate</a> assumes a protocol name <code>FooBarDataSource</code> for instances of
class <code>FooBar</code>. The method will generate appropriate <code>setHandler:</code> and
<code>handler</code> implementations for each property name and selector name string pair.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/linkDelegateMethods:" title="linkDelegateMethods:"></a>
	<h3 class="subsubtitle method-title">linkDelegateMethods:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Synthesizes multiple properties and links them to the appropriate selector
in the delegate protocol.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)linkDelegateMethods:(NSDictionary *)<em>selectorsForPropertyNames</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>selectorsForPropertyNames</em></dt>
			<dd><p>A dictionary with property names as keys and
selectors strings as objects.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p><a href="../Classes/A2DynamicDelegate.html">A2DynamicDelegate</a> assumes a protocol name <code>FooBarDelegate</code> for instances of
class <code>FooBar</code>. The method will generate appropriate <code>setHandler:</code> and
<code>handler</code> implementations for each property name and selector name string pair.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/linkProtocol:methods:" title="linkProtocol:methods:"></a>
	<h3 class="subsubtitle method-title">linkProtocol:methods:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Synthesizes multiple properties and links them to the appropriate selector
in the given protocol.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)linkProtocol:(Protocol *)<em>protocol</em> methods:(NSDictionary *)<em>selectorsForPropertyNames</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>protocol</em></dt>
			<dd><p>A protocol that declares all of the given selectors. Must not
be NULL.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>selectorsForPropertyNames</em></dt>
			<dd><p>A dictionary with property names as keys and
selector strings as objects.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>The method will generate appropriate <code>setHandler:</code> and <code>handler</code>
implementations for each property name and selector name string pair.</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/registerDynamicDataSource" title="registerDynamicDataSource"></a>
	<h3 class="subsubtitle method-title">registerDynamicDataSource</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Registers a dynamic data source replacement using the property name
<code>dataSource</code> and the protocol name <code>FooBarDataSource</code> for an instance of
<code>FooBar</code>.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)registerDynamicDataSource</code></div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/registerDynamicDataSourceNamed:" title="registerDynamicDataSourceNamed:"></a>
	<h3 class="subsubtitle method-title">registerDynamicDataSourceNamed:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Registers a dynamic data source replacement using the given property name
and the protocol name <code>FooBarDataSource</code> for an instance of <code>FooBar</code>.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)registerDynamicDataSourceNamed:(NSString *)<em>dataSourceName</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>dataSourceName</em></dt>
			<dd><p>The name of the class' data source property. Must not be
nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/registerDynamicDelegate" title="registerDynamicDelegate"></a>
	<h3 class="subsubtitle method-title">registerDynamicDelegate</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Registers a dynamic delegate replacement using the property name <code>delegate</code>
and the protocol name <code>FooBarDelegate</code> for an instance of <code>FooBar</code>.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)registerDynamicDelegate</code></div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/registerDynamicDelegateNamed:" title="registerDynamicDelegateNamed:"></a>
	<h3 class="subsubtitle method-title">registerDynamicDelegateNamed:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Registers a dynamic delegate replacement using the given property name and
the protocol name <code>FooBarDelegate</code> for an instance of <code>FooBar</code>.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)registerDynamicDelegateNamed:(NSString *)<em>delegateName</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>delegateName</em></dt>
			<dd><p>The name of the class' delegate property. Must not be nil.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/registerDynamicDelegateNamed:forProtocol:" title="registerDynamicDelegateNamed:forProtocol:"></a>
	<h3 class="subsubtitle method-title">registerDynamicDelegateNamed:forProtocol:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Registers a dynamic protocol implementation replacement
using the given property name and the given protocol.</p>
	</div>		
	
	
	<div class="method-subsection method-declaration"><code>+ (void)registerDynamicDelegateNamed:(NSString *)<em>delegateName</em> forProtocol:(Protocol *)<em>protocol</em></code></div>
	
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>delegateName</em></dt>
			<dd><p>The name of the class' delegation protocol property, such
as <code>safeDelegate</code>. Must not be nil.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>protocol</em></dt>
			<dd><p>A properly encoded protocol. Must not be NULL.</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">A2BlockDelegate.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2013 Pandamonia LLC. All rights reserved. (Last updated: 2013-02-02)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
		</script>
	</body>
</html>