This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
class_n_i_table_view_model.html
404 lines (355 loc) · 20.3 KB
/
class_n_i_table_view_model.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Nimbus: NITableViewModel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24278774-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="page">
<div style="position:relative">
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<a style="float: right;margin-right:20px;margin-top:20px" href='http://www.pledgie.com/campaigns/15519'><img alt='Click here to support Nimbus development and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/15519.png?skin_name=chrome' border='0' /></a>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Nimbus
 <span id="projectnumber">0.9.1 - <a href="http://github.com/jverkoey/nimbus">Nimbus is proudly hosted on Github</a></span>
</div>
<div id="projectbrief">An iOS framework whose growth is bounded by O(documentation).</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.4-20110629 -->
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('class_n_i_table_view_model.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">NITableViewModel Class Reference<div class="ingroups"><a class="el" href="group___table_view_models.html">Table View Models</a></div></div> </div>
</div>
<div class="contents">
<!-- doxytag: class="NITableViewModel" --><hr/><a name="details" id="details"></a><h2>Overview</h2>
<div class="textblock"><p>A non-mutable table view model that complies to the UITableViewDataSource protocol. </p>
<p>This model allows you to easily create a data source for a UITableView without having to implement the UITableViewDataSource methods in your UITableViewController.</p>
<p>This base class is non-mutable, much like an NSArray. You must initialize this model with the contents when you create it. </p>
<dl><dt><b>Examples: </b></dt><dd>
<p><a class="el" href="_example_static_table_model_8m-example.html#_a1">ExampleStaticTableModel.m</a>.</p>
</dd>
</dl>
<p>Definition at line <a class="el" href="_n_i_form_cell_catalog_8m_source.html#l00451">451</a> of file <a class="el" href="_n_i_form_cell_catalog_8m_source.html">NIFormCellCatalog.m</a>.</p>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Methods</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Configuration</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NITableViewModelSectionIndex </td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_i_table_view_model.html#adcc35e36d9bc1e47a9f084e504d8ebda">sectionIndexType</a> <span class="suffix">property</span></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_i_table_view_model.html#ad1991fde667958dafc9158684795a6b9">sectionIndexShowsSearch</a> <span class="suffix">property</span></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">BOOL </td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_i_table_view_model.html#a48850ea92b2a9ffe69a153bcfe9416e0">sectionIndexShowsSummary</a> <span class="suffix">property</span></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void) </td><td class="memItemRight" valign="bottom">- <a class="el" href="class_n_i_table_view_model.html#a4f3dee76487f50876b9d7e536eb0b15f">setSectionIndexType:showsSearch:showsSummary:</a></td></tr>
<tr><td colspan="2"><div class="groupHeader">Creating Table View Cells</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">id< <a class="el" href="protocol_n_i_table_view_model_delegate-p.html">NITableViewModelDelegate</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_i_table_view_model.html#a78c3eba3b94e5e0e25f3bb867fd23e47">delegate</a> <span class="suffix">property</span></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NITableViewModelCellForIndexPathBlock </td><td class="memItemRight" valign="bottom"><a class="el" href="class_n_i_table_view_model.html#a1c47c87deb807cb1e9f557521c87394e">createCellBlock</a> <span class="suffix">property</span></td></tr>
<tr><td colspan="2"><div class="groupHeader">Creating Table View Models</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="class_n_i_table_view_model.html#a56fb73175cd2c39b9a7143fef985ef98">initWithDelegate:</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="class_n_i_table_view_model.html#af6d1f01a2f02141750fcdc5fa497dbf0">initWithListArray:delegate:</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="class_n_i_table_view_model.html#a5a21fcce8dc43a4f779712f8132b214b">initWithSectionedArray:delegate:</a></td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessing Objects</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id) </td><td class="memItemRight" valign="bottom">- <a class="el" href="class_n_i_table_view_model.html#a477424b2610ee36d82ef09ecd1624b86">objectAtIndexPath:</a></td></tr>
</table>
<hr/><h2>Method Documentation</h2>
<a class="anchor" id="adcc35e36d9bc1e47a9f084e504d8ebda"></a><!-- doxytag: member="NITableViewModel::sectionIndexType" ref="adcc35e36d9bc1e47a9f084e504d8ebda" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- NITableViewModel:<code> [read, assign]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The section index type. </p>
<p>You will likely use NITableViewModelSectionIndexAlphabetical in practice.</p>
<p>NITableViewModelSectionIndexNone by default. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8h_source.html#l00074">74</a> of file <a class="el" href="_n_i_table_view_model_8h_source.html">NITableViewModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad1991fde667958dafc9158684795a6b9"></a><!-- doxytag: member="NITableViewModel::sectionIndexShowsSearch" ref="ad1991fde667958dafc9158684795a6b9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- NITableViewModel:<code> [read, assign]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Whether or not the search symbol will be shown in the section index. </p>
<p>NO by default. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8h_source.html#l00075">75</a> of file <a class="el" href="_n_i_table_view_model_8h_source.html">NITableViewModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a48850ea92b2a9ffe69a153bcfe9416e0"></a><!-- doxytag: member="NITableViewModel::sectionIndexShowsSummary" ref="a48850ea92b2a9ffe69a153bcfe9416e0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- NITableViewModel:<code> [read, assign]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Whether or not the summary symbol will be shown in the section index. </p>
<p>NO by default. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8h_source.html#l00076">76</a> of file <a class="el" href="_n_i_table_view_model_8h_source.html">NITableViewModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a78c3eba3b94e5e0e25f3bb867fd23e47"></a><!-- doxytag: member="NITableViewModel::delegate" ref="a78c3eba3b94e5e0e25f3bb867fd23e47" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- NITableViewModel:<code> [read, write, assign]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A delegate used to fetch table view cells for the data source. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8h_source.html#l00080">80</a> of file <a class="el" href="_n_i_table_view_model_8h_source.html">NITableViewModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1c47c87deb807cb1e9f557521c87394e"></a><!-- doxytag: member="NITableViewModel::createCellBlock" ref="a1c47c87deb807cb1e9f557521c87394e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- NITableViewModel:<code> [read, write, copy]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A block used to create a UITableViewCell for a given object. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8h_source.html#l00085">85</a> of file <a class="el" href="_n_i_table_view_model_8h_source.html">NITableViewModel.h</a>.</p>
</div>
</div>
<a class="anchor" id="a56fb73175cd2c39b9a7143fef985ef98"></a><!-- doxytag: member="NITableViewModel::initWithDelegate:" ref="a56fb73175cd2c39b9a7143fef985ef98" args="(id< NITableViewModelDelegate > delegate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) initWithDelegate: </td>
<td></td>
<td class="paramtype">(id<<a class="el" href="protocol_n_i_table_view_model_delegate-p.html">NITableViewModelDelegate</a>>) </td>
<td class="paramname"><em>delegate</em></td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a newly allocated static model with the given delegate and empty contents. </p>
<p>This method can be used to create an empty model. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8m_source.html#l00080">80</a> of file <a class="el" href="_n_i_table_view_model_8m_source.html">NITableViewModel.m</a>.</p>
</div>
</div>
<a class="anchor" id="af6d1f01a2f02141750fcdc5fa497dbf0"></a><!-- doxytag: member="NITableViewModel::initWithListArray:delegate:" ref="af6d1f01a2f02141750fcdc5fa497dbf0" args="(NSArray *sectionedArray,[delegate] id< NITableViewModelDelegate > delegate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) initWithListArray: </td>
<td></td>
<td class="paramtype">(NSArray *) </td>
<td class="paramname"><em>sectionedArray</em></td>
</tr>
<tr>
<td class="paramkey">delegate:</td>
<td></td>
<td class="paramtype">(id<<a class="el" href="protocol_n_i_table_view_model_delegate-p.html">NITableViewModelDelegate</a>>) </td>
<td class="paramname"><em>delegate</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a newly allocated static model with the contents of a list array. </p>
<p>A list array is a one-dimensional array that defines a flat list of rows. There will be no sectioning of contents in any way.</p>
<h3>Example</h3>
<div class="fragment"><pre class="fragment"> NSArray* contents =
[NSArray arrayWithObjects:
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 1"</span> forKey:<span class="stringliteral">@"title"</span>],
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 2"</span> forKey:<span class="stringliteral">@"title"</span>],
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 3"</span> forKey:<span class="stringliteral">@"title"</span>],
nil];
[[NIStaticTableViewModel alloc] initWithListArray:contents <a class="code" href="class_n_i_table_view_model.html#a78c3eba3b94e5e0e25f3bb867fd23e47" title="A delegate used to fetch table view cells for the data source.">delegate</a>:<span class="keyword">self</span>];
</pre></div>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8m_source.html#l00095">95</a> of file <a class="el" href="_n_i_table_view_model_8m_source.html">NITableViewModel.m</a>.</p>
</div>
</div>
<a class="anchor" id="a5a21fcce8dc43a4f779712f8132b214b"></a><!-- doxytag: member="NITableViewModel::initWithSectionedArray:delegate:" ref="a5a21fcce8dc43a4f779712f8132b214b" args="(NSArray *sectionedArray,[delegate] id< NITableViewModelDelegate > delegate)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) initWithSectionedArray: </td>
<td></td>
<td class="paramtype">(NSArray *) </td>
<td class="paramname"><em>sectionedArray</em></td>
</tr>
<tr>
<td class="paramkey">delegate:</td>
<td></td>
<td class="paramtype">(id<<a class="el" href="protocol_n_i_table_view_model_delegate-p.html">NITableViewModelDelegate</a>>) </td>
<td class="paramname"><em>delegate</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a newly allocated static model with the contents of a sectioned array. </p>
<p>A sectioned array is a one-dimensional array that defines a list of sections and each section's contents. Each <a class="el" href="class_n_s_string.html" title="For manipulating NSStrings.">NSString</a> begins a new section and any other object defines a row for the current section.</p>
<h3>Example</h3>
<div class="fragment"><pre class="fragment"> NSArray* contents =
[NSArray arrayWithObjects:
<span class="stringliteral">@"Section 1"</span>,
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 1"</span> forKey:<span class="stringliteral">@"title"</span>],
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 2"</span> forKey:<span class="stringliteral">@"title"</span>],
<span class="stringliteral">@"Section 2"</span>,
<span class="comment">// This section is empty.</span>
<span class="stringliteral">@"Section 3"</span>,
[NSDictionary dictionaryWithObject:<span class="stringliteral">@"Row 3"</span> forKey:<span class="stringliteral">@"title"</span>],
[<a class="code" href="interface_n_i_table_view_model_footer.html" title="An object used in sectioned arrays to denote a section footer title.">NITableViewModelFooter</a> footerWithTitle:<span class="stringliteral">@"Footer"</span>],
nil];
[[NIStaticTableViewModel alloc] initWithSectionedArray:contents <a class="code" href="class_n_i_table_view_model.html#a78c3eba3b94e5e0e25f3bb867fd23e47" title="A delegate used to fetch table view cells for the data source.">delegate</a>:<span class="keyword">self</span>];
</pre></div>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8m_source.html#l00104">104</a> of file <a class="el" href="_n_i_table_view_model_8m_source.html">NITableViewModel.m</a>.</p>
</div>
</div>
<a class="anchor" id="a477424b2610ee36d82ef09ecd1624b86"></a><!-- doxytag: member="NITableViewModel::objectAtIndexPath:" ref="a477424b2610ee36d82ef09ecd1624b86" args="(NSIndexPath *indexPath)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (id) objectAtIndexPath: </td>
<td></td>
<td class="paramtype">(NSIndexPath *) </td>
<td class="paramname"><em>indexPath</em></td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the object at the given index path. </p>
<p>If no object exists at the given index path (an invalid index path, for example) then nil will be returned. </p>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8m_source.html#l00395">395</a> of file <a class="el" href="_n_i_table_view_model_8m_source.html">NITableViewModel.m</a>.</p>
</div>
</div>
<a class="anchor" id="a4f3dee76487f50876b9d7e536eb0b15f"></a><!-- doxytag: member="NITableViewModel::setSectionIndexType:showsSearch:showsSummary:" ref="a4f3dee76487f50876b9d7e536eb0b15f" args="(NITableViewModelSectionIndex sectionIndexType,[showsSearch] BOOL showsSearch,[showsSummary] BOOL showsSummary)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (void) setSectionIndexType: </td>
<td></td>
<td class="paramtype">(NITableViewModelSectionIndex) </td>
<td class="paramname"><em>sectionIndexType</em></td>
</tr>
<tr>
<td class="paramkey">showsSearch:</td>
<td></td>
<td class="paramtype">(BOOL) </td>
<td class="paramname"><em>showsSearch</em></td>
</tr>
<tr>
<td class="paramkey">showsSummary:</td>
<td></td>
<td class="paramtype">(BOOL) </td>
<td class="paramname"><em>showsSummary</em> </td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Configures the model's section index properties. </p>
<p>Calling this method will compile the section index depending on the index type chosen.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">sectionIndexType</td><td>The type of section index to display. </td></tr>
<tr><td class="paramname">showsSearch</td><td>Whether or not to show the search icon at the top of the index. </td></tr>
<tr><td class="paramname">showsSummary</td><td>Whether or not to show the summary icon at the bottom of the index. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_n_i_table_view_model_8m_source.html#l00420">420</a> of file <a class="el" href="_n_i_table_view_model_8m_source.html">NITableViewModel.m</a>.</p>
</div>
</div>
<div id="disqus_thread"></div></div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="class_n_i_table_view_model.html">NITableViewModel</a> </li>
</div><!-- .fixedwidth -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'nimbusdocumentation'; // required: replace example with your forum shortname
// The following are highly recommended additional parameters. Remove the slashes in front to use.
// var disqus_identifier = 'unique_dynamic_id_1234';
// var disqus_url = 'http://example.com/permalink-to-page.html';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<span class="footer">Generated for Nimbus by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4-20110629 </span>
</ul>
</div>
</div> <!-- page -->
</body>
</html>