tag:blogger.com,1999:blog-17775768231621381962024-03-05T09:55:54.538+00:00Keep These In MindAnonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-1777576823162138196.post-78171086386938045892016-04-24T11:43:00.001+01:002016-04-24T23:53:08.640+01:00A Possible Solution For [Leetcode 238. Product of Array Except Self]<br />
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="-webkit-font-kerning: none;">For those who feels interested to give it a try, the coding puzzle can be found <span style="-webkit-font-kerning: none;"><a href="https://leetcode.com/problems/product-of-array-except-self/" target="_blank">here</a></span><span id="goog_1164341112"></span><span id="goog_1164341113"></span><a href="https://www.blogger.com/"></a>.</span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="-webkit-font-kerning: none;"><br />
The puzzle is as follows:</span></div>
<div style="color: #323333; font-family: Times; font-size: 16px; line-height: normal;">
<span style="color: #232323; font-kerning: none;"><b>G</b></span><span style="font-kerning: none;"><b>iven an array of <i>n</i> integers where <i>n</i> > 1, </b></span><span style="color: #c7254e; font-family: "courier"; font-size: 13px; line-height: normal;"><b>nums</b></span><span style="font-kerning: none;"><b>, return an array </b></span><span style="color: #c7254e; font-family: "courier"; font-size: 13px; line-height: normal;"><b>output</b></span><span style="font-kerning: none;"><b> such that </b></span><span style="color: #c7254e; font-family: "courier"; font-size: 13px; line-height: normal;"><b>output[i]</b></span><span style="font-kerning: none;"><b> is equal to the product of all the elements of </b></span><span style="color: #c7254e; font-family: "courier"; font-size: 13px; line-height: normal;"><b>nums</b></span><span style="font-kerning: none;"><b> except </b></span><span style="color: #c7254e; font-family: "courier"; font-size: 13px; line-height: normal;"><b>nums[i]</b></span><span style="font-kerning: none;"><b>.</b></span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="color: #323333; font-kerning: none;"><br />
</span><span style="font-kerning: none;">And the </span><span style="font-kerning: none; text-decoration: underline;">requirements or challenges</span><span style="font-kerning: none;"> are:</span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="font-kerning: none;">1. Solve it <b>without division</b> and in O(<i>n</i>).</span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="font-kerning: none;">2. Solve it with constant space complexity.</span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="font-kerning: none;"><br />
<br />
The following is the solution that I came up with (in Swift). I thought it was the best because it only loops the array once while all other solutions that I found around the web loops the array at least twice. But it doesn't conform to the second requirement about the space complexity because of the recursive call, unfortunately. </span><br />
<span style="font-kerning: none;"><br /></span>
<span style="font-kerning: none;">Besides, for some odd reason, this solution will generate a runtime error when the array holds more than 34892 elements. I can't seem to find any logic issues in the code so far (</span><span style="font-kerning: none; text-decoration: underline;">If you happen to read this article, please do get in touch if you found any issues within the code</span><span style="font-kerning: none;">). Fyi, I'm using Xcode 7.3 which comes with Swift 2.2. Not sure if it is a compiler issue.</span></div>
<div style="font-family: Times; font-size: 16px; line-height: normal; min-height: 19px;">
<span style="font-kerning: none;"></span><br /></div>
<br />
<div style="font-family: Times; font-size: 16px; line-height: normal;">
<span style="-webkit-font-kerning: none;">Here is the code:</span></div>
<div style="font-style: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div style="font-style: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: white; border: 1px dotted rgb(204, 204, 204); font-style: normal; line-height: 1.21; margin: 1em 0px 10px; overflow: auto; padding: 10px; position: relative; width: auto;">
<div class="p1">
<div style="color: #703daa; font-family: menlo; font-size: 15px; line-height: normal;">
</div>
<div style="line-height: normal;">
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #bb2ca2;">func</span> productExceptSelf(nums: [</span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span>]) -> [</span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span>]</span><span style="color: #4f8187;"> </span><span style="font-variant-ligatures: no-common-ligatures;">{</span></span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187;"> </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #bb2ca2;">func</span> product(<span style="color: #bb2ca2;">inout</span></span><span style="color: #4f8187;"> </span><span style="font-variant-ligatures: no-common-ligatures;">nums: [</span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span>], </span><span style="color: #bb2ca2;">_</span><span style="font-variant-ligatures: no-common-ligatures;"> index: </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span>, </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #bb2ca2;">_</span> leftProduct: </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span>) -> </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #703daa;">Int</span> {</span></span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187;"> </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> number = nums[index]</span></span></div>
<div style="color: #4f8187; line-height: normal; min-height: 13px;">
<span style="font-family: Verdana, sans-serif; font-size: x-small; font-variant-ligatures: no-common-ligatures;"> </span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187;"> </span><span style="color: #bb2ca2; font-family: "menlo";">if</span><span style="font-variant-ligatures: no-common-ligatures;"> index == nums.</span><span style="color: #4f8187;"></span><span style="color: #703daa; font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">count</span><span style="font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">-</span><span style="color: #272ad8; font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">1 </span>{</span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #4f8187;"> </span>nums[index] = </span>leftProduct</span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187;"> </span><span style="font-variant-ligatures: no-common-ligatures;"></span><span style="color: #bb2ca2; font-family: "menlo";">return </span>number</span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small; font-variant-ligatures: no-common-ligatures;"><span style="color: #4f8187;"> </span>}</span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187; font-family: "menlo";"> </span><span style="color: #bb2ca2; font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">else</span><span style="font-family: "menlo";"> {</span></span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187; font-family: "menlo";"> </span><span style="color: #bb2ca2; font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">let</span><span style="font-family: "menlo";"><span style="color: #4f8187;"> </span>rightProduct = </span><span style="font-family: "menlo";"></span><span style="color: #31595d; font-family: "menlo";">product</span><span style="font-family: "menlo";">(&nums, index + </span><span style="color: #272ad8; font-family: "menlo";">1</span><span style="font-family: "menlo";">, </span></span><span style="font-family: Verdana, sans-serif; font-size: x-small;">number</span><span style="font-family: Verdana, sans-serif; font-size: x-small;"> * leftProduct)</span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"> <span style="color: black;">nums</span><span style="color: black;">[index]</span> <span style="color: black;">=</span> <span style="color: black;">leftProduct</span> </span><span style="color: black;">* </span><span style="color: black;">rightProduct</span></span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">return</span><span style="font-variant-ligatures: no-common-ligatures;"> <span style="color: black;">rightProduct</span> </span><span style="color: black;">*</span> </span><span style="color: black; font-family: Verdana, sans-serif; font-size: x-small;">number</span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: black;">}</span></span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: black;">}</span></span></div>
<div style="color: #4f8187; line-height: normal; min-height: 13px;">
<span style="font-family: Verdana, sans-serif; font-size: x-small; font-variant-ligatures: no-common-ligatures;"> </span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187; font-family: "menlo";"> </span><span style="color: #bb2ca2; font-family: "menlo"; font-variant-ligatures: no-common-ligatures;">var</span><span style="font-family: "menlo";"> numbers = nums</span></span></div>
<div style="line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="color: #4f8187; font-family: "menlo";"> </span><span style="color: #bb2ca2; font-family: "menlo";">_</span><span style="font-family: "menlo";"> = </span><span style="font-variant-ligatures: no-common-ligatures;"><span style="color: #31595d; font-family: "menlo";">product</span><span style="font-family: "menlo";">(&numbers, </span><span style="color: #272ad8; font-family: "menlo";">0</span></span><span style="font-family: "menlo";">, </span><span style="color: #272ad8; font-family: "menlo";">1</span><span style="font-family: "menlo";">)</span></span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">return</span><span style="font-variant-ligatures: no-common-ligatures;"> </span><span style="color: black;">numbers</span></span></div>
<div style="color: #4f8187; line-height: normal;">
<span style="color: black; font-family: Verdana, sans-serif; font-size: x-small;">}</span></div>
</div>
</div>
</div>
</div>
</div>
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com0tag:blogger.com,1999:blog-1777576823162138196.post-51799099937586382192015-01-13T00:34:00.002+00:002016-07-26T13:15:18.773+01:00Custom SegmentedControl In Swift<span style="font-family: "times" , "times new roman" , serif;">In this tutorial, we will use a third party framework named </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">SMSegmentView</span><span style="font-family: "times" , "times new roman" , serif;"> to implement a unique and good looking segmented control for your Swift project. You will also learn how easy it is to expand this framework a little bit. ;)</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<br />
<h3>
<span style="font-family: "times" , "times new roman" , serif;">A Short Introduction Of SMSegmentView</span></h3>
<div>
<span style="font-family: "times" , "times new roman" , serif;">I know many of you may not be interested in the background, so please feel free to skip this part :)</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Due to the standard look and the relatively low customisability of UISegmentedControl, the author of SMSegmentView wrote this framework for both developers and designer to make their apps more outstanding, which in another way, might also improve the user experience.</span></div>
<div>
<br /></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">The framework supports both image and text in a single segment. Besides of the traditional horizontal look, it also allows you to arrange your segments in a vertical way. You can change the attributes of the text and segment as well. It </span><span style="font-family: "times" , "times new roman" , serif;">is written in Swift and very easy to expand with new features, which is perfect to be used in your next project.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Now let start building something.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<h2>
<span style="font-family: "times" , "times new roman" , serif;">Build A Custom SegmentedView</span></h2>
<div>
<span style="font-family: "times" , "times new roman" , serif;">First of all, you will need to find the framework <a href="https://github.com/allenbryan11/SMSegmentView" target="_blank">here</a>.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Then, create a new Xcode project with the Single View Application template. Name the project whatever you like, but in this tutorial, let's use SegmentedControlSample. Choose Swift as the language and iPhone as the devices.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Now drag the SMSegmentView folder inside the framework to your project and tick "Copy items if needed". And we are now ready to create our very customised segmented control. Pretty easy, huh? :D</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Now let's create a property of the instance of SMSegmentView in ViewController.swift:</span><br />
<span style="background-color: #fff9ee; color: #222222; display: inline; float: none; font-family: "georgia" , "utopia" , "palatino linotype" , "palatino" , serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><br />
<div style="-webkit-text-stroke-width: 0px; color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<span style="color: #bb2ca2; font-family: "menlo"; line-height: normal;">var</span><span style="font-family: "menlo"; font-size: x-small; line-height: normal;"> segmentedControl: </span><span style="color: #4f8187; font-family: "menlo"; line-height: normal;">SMSegmentView</span><span style="font-family: "menlo"; font-size: x-small; line-height: normal;">!</span></div>
</div>
</div>
</div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">ViewController.swift: Using the exclamation symbol is to tell the compiler: "Don't worry. I'll assign it a value later".</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">In </span><span style="font-family: "menlo";"><span style="font-size: x-small;">viewDidLoad()</span></span><span style="font-family: "times" , "times new roman" , serif;"> we initialise the segmentedControl by using its </span><span style="font-size: x-small;"><span style="font-family: "menlo";">frame:divider</span><span style="font-family: "menlo";">Colour:divider</span><span style="font-family: "menlo";">Width: </span><span style="font-family: "menlo";">segmentAppearance:</span></span><span style="font-family: "times" , "times new roman" , serif;"> method. Add the following code after </span><span style="font-size: x-small;"><span style="color: #bb2ca2; font-family: "menlo"; font-size: 11px;">super</span><span style="font-family: "menlo"; font-size: 11px;">.</span><span style="color: #3d1d81; font-family: "menlo"; font-size: 11px;">viewDidLoad</span><span style="font-family: "menlo"; font-size: 11px;">()</span></span><span style="font-family: "times" , "times new roman" , serif;">:</span><br />
<br />
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
</div>
<br />
<div style="font-family: times; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div style="font-family: georgia, utopia, 'palatino linotype', palatino, serif; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: white; border: 1px dotted rgb(204, 204, 204); font-family: menlo, consolas, 'bitstream vera sans mono', 'courier new', courier, monospace, important; font-style: normal; line-height: 1.21; margin: 1em 0px 10px; overflow: auto; padding: 10px; position: relative; width: auto;">
<div class="p1">
<div style="color: #703daa; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>view<span style="color: black;">.</span>backgroundColor<span style="color: black;"> = </span>UIColor<span style="color: black;">(white: </span><span style="color: #272ad8;">0.95</span><span style="color: black;">, alpha: </span><span style="color: #272ad8;">1.0</span><span style="color: black;">)</span></span></div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="color: #008400; font-size: 11px;"><br /></span></div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="color: #008400; font-size: 11px;">// 1</span><br />
<div style="color: #4f8187; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">let</span><span style="color: black; font-variant-ligatures: no-common-ligatures;"> appearance = </span><span style="font-variant-ligatures: no-common-ligatures;">SMSegmentAppearance</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">()</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;">appearance.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentOnSelectionColour</span><span style="font-variant-ligatures: no-common-ligatures;"> = </span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIColor</span><span style="font-variant-ligatures: no-common-ligatures;">(red: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">245.0</span><span style="font-variant-ligatures: no-common-ligatures;">/</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">255.0</span><span style="font-variant-ligatures: no-common-ligatures;">, green: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">174.0</span><span style="font-variant-ligatures: no-common-ligatures;">/</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">255.0</span><span style="font-variant-ligatures: no-common-ligatures;">, blue: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">63.0</span><span style="font-variant-ligatures: no-common-ligatures;">/</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">255.0</span><span style="font-variant-ligatures: no-common-ligatures;">, alpha: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">1.0</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;">appearance.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentOffSelectionColour</span><span style="font-variant-ligatures: no-common-ligatures;"> = </span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIColor</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">whiteColor</span><span style="font-variant-ligatures: no-common-ligatures;">()</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;">appearance.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">titleOnSelectionFont</span><span style="font-variant-ligatures: no-common-ligatures;"> = </span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIFont</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">systemFontOfSize</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">12.0</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;">appearance.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">titleOffSelectionFont</span><span style="font-variant-ligatures: no-common-ligatures;"> = </span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIFont</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">systemFontOfSize</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">12.0</span><span style="font-variant-ligatures: no-common-ligatures;">)</span></span></div>
<span style="color: #008400; font-size: x-small;">
</span><br />
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="font-variant-ligatures: no-common-ligatures;">appearance.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">contentVerticalMargin</span><span style="font-variant-ligatures: no-common-ligatures;"> = </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">10.0</span></span></div>
</div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="color: #008400; font-size: 11px;">// 2</span></div>
<div style="font-family: menlo; line-height: normal;">
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> segmentFrame<span style="color: #4f8187;"> </span>=<span style="color: #4f8187;"> </span></span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">CGRect</span><span style="font-variant-ligatures: no-common-ligatures;">(x: </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">margin</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">, </span><span style="font-variant-ligatures: no-common-ligatures;">y: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">120.0</span><span style="font-variant-ligatures: no-common-ligatures;">,</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">width: </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">view</span></span><span style="font-size: x-small;">.</span><span style="font-size: x-small;"><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">frame</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">size</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">width</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">-</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">margin</span><span style="font-variant-ligatures: no-common-ligatures;">*</span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">2</span><span style="font-variant-ligatures: no-common-ligatures;">,</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">height:</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">40.0</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">)</span></span></div>
<div style="color: #4f8187;">
</div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentView</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;">=</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">SMSegmentView</span><span style="font-variant-ligatures: no-common-ligatures;">(frame: </span><span style="font-variant-ligatures: no-common-ligatures;">segmentFrame</span><span style="font-variant-ligatures: no-common-ligatures;">, dividerColour:</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIColor</span><span style="font-variant-ligatures: no-common-ligatures;">(white:</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">0.95</span><span style="font-variant-ligatures: no-common-ligatures;">, alpha:</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">0.3</span><span style="font-variant-ligatures: no-common-ligatures;">), dividerWidth: </span><span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">1.0</span><span style="font-variant-ligatures: no-common-ligatures;">, segmentAppearance: appearance)</span></span></div>
</div>
<div style="color: #222222; font-family: menlo; line-height: normal; min-height: 13px;">
<br /></div>
<div style="color: #008400; font-family: menlo; font-size: 11px; line-height: normal;">
// 3</div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentedControl</span>.<span style="color: #31595d; font-variant-ligatures: no-common-ligatures;">addSegmentWithTitle</span>(<span style="color: #d12f1b; font-variant-ligatures: no-common-ligatures;">"Segment 1"</span>, onSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>, offSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>)</span></div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentedControl</span>.<span style="color: #31595d; font-variant-ligatures: no-common-ligatures;">addSegmentWithTitle</span>(<span style="color: #d12f1b; font-variant-ligatures: no-common-ligatures;">"Segment 2"</span>, onSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>, offSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>)</span></div>
<div style="color: #222222; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentedControl</span>.<span style="color: #31595d; font-variant-ligatures: no-common-ligatures;">addSegmentWithTitle</span>(<span style="color: #d12f1b; font-variant-ligatures: no-common-ligatures;">"Segment 3"</span>, onSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>, offSelectionImage: <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">nil</span>)</span></div>
<div style="color: #222222; font-family: menlo; line-height: normal; min-height: 13px;">
<br />
<span style="color: #008400; font-size: 11px;">// 4</span><br />
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentView</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">addTarget</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span><span style="font-variant-ligatures: no-common-ligatures;">, action: </span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">#selector</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">ViewController</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: #31595d; font-variant-ligatures: no-common-ligatures;">selectSegmentInSegmentView</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">_</span><span style="font-variant-ligatures: no-common-ligatures;">:)), forControlEvents: .ValueChanged)</span></span></div>
<div style="font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
</div>
<div style="color: #4f8187; font-family: menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #703daa;">view</span><span style="color: black;">.</span><span style="color: #3d1d81;">addSubview</span><span style="color: black;">(</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>segmentedControl<span style="color: black;">)</span></span></div>
</div>
</div>
</div>
</div>
<span style="font-family: "times" , "times new roman" , serif;">(1) Create an instance of SMSegmentAppearance, where you can specify some UI attributes.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">(2) Call the initialiser of </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">SMSegmentView.</span><span style="font-family: "times" , "times new roman" , serif;"> The parameter s</span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">egmentAppearance</span><span style="font-family: "times" , "times new roman" , serif;"> reads the</span><span style="font-family: "verdana" , sans-serif; font-size: x-small;"> SMSegmentAppearance</span><span style="font-family: "times" , "times new roman" , serif;"> instance we created in step 1.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="font-family: "times" , "times new roman" , serif;">(3)We add three segments to our </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">segmentedControler</span><span style="font-family: "times" , "times new roman" , serif;">. In this demo, we do not need to assign </span><span style="font-family: "times" , "times new roman" , serif;">images to our segment. But in real practice, you can add them if you want.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">(4)We set an action to react to UIControlEvents.ValueChanged. After this step, don't forget to add the selector </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">selectSegmentInSegmentView(_:)</span><span style="font-family: "times" , "times new roman" , serif;"> in the ViewController class:</span><br />
<div>
<div style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<div style="font-family: Menlo; line-height: normal;">
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">func</span><span style="font-variant-ligatures: no-common-ligatures;"> selectSegmentInSegmentView(segmentView: </span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">SMSegmentView</span><span style="font-variant-ligatures: no-common-ligatures;">) {</span></span></div>
<div style="color: #d12f1b; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: black; font-variant-ligatures: no-common-ligatures;"> </span><span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">print</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">(</span><span style="font-variant-ligatures: no-common-ligatures;">"Select segment at index: </span><span style="color: black; font-variant-ligatures: no-common-ligatures;">\</span><span style="font-variant-ligatures: no-common-ligatures;">(</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">segmentView.</span><span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">selectedSegmentIndex</span><span style="font-variant-ligatures: no-common-ligatures;">)"</span><span style="color: black; font-variant-ligatures: no-common-ligatures;">)</span></span></div>
<br />
<div style="font-family: Menlo; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-size: x-small;">}</span></span></div>
</div>
</div>
</div>
</div>
</div>
<br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Now you can give it a try. If everything goes well, you will see the simulator show this when you select a segment:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkWup62Asan6kkv452DIlkgccVC2Pb9s7qime5IRgaqxBFomdusN8-MNwNOyChuihoJiNbHJTyERQGhGau9p6i57edotczQFEsW6mI1fRLwYshxw5bERciWd5th6C1MV_0l50qDK5UWEiM/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkWup62Asan6kkv452DIlkgccVC2Pb9s7qime5IRgaqxBFomdusN8-MNwNOyChuihoJiNbHJTyERQGhGau9p6i57edotczQFEsW6mI1fRLwYshxw5bERciWd5th6C1MV_0l50qDK5UWEiM/s1600/1.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Hmm... It looks not too bad, but not as good as it is expected, either :(</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Don't worry. We haven't finished, yet.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Add the following code right above you added new segment to the segmentedControl:</span><br />
<div>
<div style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<div style="color: #703daa; font-family: Menlo; line-height: normal;">
</div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">segmentedControl</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">layer</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">borderColor</span> = <span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIColor</span>(white: <span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">0.9</span>, alpha: <span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">1.0</span>).<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">CGColor</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
</div>
<div style="color: #4f8187; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>segmentedControl<span style="color: black;">.</span><span style="color: #703daa;">layer</span><span style="color: black;">.</span><span style="color: #703daa;">borderWidth</span><span style="color: black;"> = </span><span style="color: #272ad8;">1.0</span></span></div>
</div>
</div>
</div>
</div>
<span style="font-family: "times" , "times new roman" , serif;">As </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">SMSegmentView</span><span style="font-family: "times" , "times new roman" , serif;"> is a subclass of </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">UIView</span><span style="font-family: "times" , "times new roman" , serif;">, we can use </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">UIView</span><span style="font-family: "times" , "times new roman" , serif;">'s methods to give it</span><span style="font-family: "times" , "times new roman" , serif;"> a border.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<br />
<h2>
<span style="font-family: "times" , "times new roman" , serif;">Expanding The Framework A Little...</span></h2>
<span style="font-family: "times" , "times new roman" , serif;">Now let's expand it a little bit to give it some animation when we select at a segment. First of all, let add another property to our </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">ViewController</span><span style="font-family: "times" , "times new roman" , serif;">:</span><br />
<div>
<div style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">var</span> seletionBar: <span style="color: #703daa;">UIView</span> = <span style="color: #703daa;">UIView</span>()</span></div>
</div>
</div>
</div>
</div>
<div style="-webkit-text-stroke-width: 0px; color: black; font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
</div>
<span style="font-family: "times" , "times new roman" , serif;">And add the following code at the bottom of </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">viewDidLoad()</span><span style="font-family: "times" , "times new roman" , serif;">.</span><br />
<div>
<div style="color: #222222; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<div style="color: #4f8187; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>seletionBar<span style="color: black;">.</span><span style="color: #703daa;">frame</span><span style="color: black;"> = </span><span style="color: #703daa;">CGRect</span><span style="color: black;">(x: </span><span style="color: #272ad8;">0.0</span><span style="color: black;">, y: </span><span style="color: #272ad8;">0.0</span><span style="color: black;">, width: </span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>segmentedControl<span style="color: black;">.</span>frame<span style="color: black;">.</span><span style="color: #703daa;">size</span><span style="color: black;">.</span><span style="color: #703daa;">width</span><span style="color: #3d1d81;">/</span><span style="color: #703daa;">CGFloat</span><span style="color: black;">(</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span>segmentedControl<span style="color: black;">.</span>numberOfSegments<span style="color: black;">), height: </span><span style="color: #272ad8;">5.0</span><span style="color: black;">)</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
</div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">self</span>.<span style="color: #4f8187;">seletionBar</span>.<span style="color: #703daa;">backgroundColor</span> = <span style="color: #703daa;">UIColor</span>(white: <span style="color: #272ad8;">0.5</span>, alpha: <span style="color: #272ad8;">0.6</span>)</span></div>
</div>
</div>
</div>
</div>
<div>
</div>
<span style="font-family: "times" , "times new roman" , serif;">You'll know how we are gonna use this view right as follows. Change the </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">SMSegmentView</span><span style="font-family: "times" , "times new roman" , serif;"> delegate method to:</span><br />
<div>
<div style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border: 1px dotted rgb(204, 204, 204) !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; line-height: 1.21 !important; margin: 1em 0px 10px !important; overflow: auto !important; padding: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #bb2ca2;">func</span> segmentView(segmentView: </span><span style="color: #4f8187; font-size: x-small;">SegmentView</span><span style="font-size: x-small;"> didSelectSegmentAtIndex index: <span style="color: #703daa;">Int</span>)</span><span style="font-size: x-small;"> {</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> </span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> </span><span style="color: #008400; font-size: 11px;">//</span><span style="color: #008400; font-size: 11px;"> 1</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #bb2ca2;">let</span> placeSelectionBar = { () -> () <span style="color: #bb2ca2;">in</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">var</span> barFrame = <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">seletionBar</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">frame</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> barFrame.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">origin</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">x</span> = barFrame.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">size</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">width</span> <span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">*</span> <span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">CGFloat</span>(segmentIndex)</span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">self</span>.<span style="color: #4f8187; font-variant-ligatures: no-common-ligatures;">seletionBar</span>.<span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">frame</span> = barFrame</span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> }</span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> </span><span style="color: #008400; font-size: 11px;">//</span><span style="color: #008400; font-size: 11px;"> 2</span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"><span style="color: #222222;"> </span><span style="color: #bb2ca2;">if</span> <span style="color: #bb2ca2;">self</span><span style="color: #222222;">.</span><span style="color: #4f8187;">seletionBar</span><span style="color: #222222;">.</span><span style="color: #703daa;">superview</span><span style="color: #222222;"> == </span><span style="color: #bb2ca2;">nil</span><span style="color: #222222;"> {</span></span></div>
<div style="font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">segmentedControl</span><span style="color: black;">.</span><span style="color: #3d1d81;">addSubview</span><span style="color: black;">(</span><span style="color: #bb2ca2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">seletionBar</span><span style="color: black;">)</span></span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> </span><span style="font-size: x-small;">placeSelectionBar()</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> }</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #bb2ca2; font-variant-ligatures: no-common-ligatures;">else</span> {</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> <span style="color: #703daa; font-variant-ligatures: no-common-ligatures;">UIView</span>.<span style="color: #3d1d81; font-variant-ligatures: no-common-ligatures;">animateWithDuration</span>(<span style="color: #272ad8; font-variant-ligatures: no-common-ligatures;">0.3</span>, animations: {</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> </span><span style="font-size: x-small;">placeSelectionBar()</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> })</span></div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;"> }</span></div>
<div style="color: #4f8187; font-family: Menlo; line-height: normal;">
</div>
<div style="color: #222222; font-family: Menlo; line-height: normal;">
<span style="font-size: x-small;">}</span></div>
</div>
</div>
</div>
</div>
<div>
</div>
<span style="font-family: "times" , "times new roman" , serif;">(1) We are using a closure to calculate where our bar should be placed.</span><br />
<span style="font-family: "times" , "times new roman" , serif;">(2) If no segment has been selected, yet, we will need to add the </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">selectionBar</span><span style="font-family: "times" , "times new roman" , serif;"> view to our </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">segmentedControl</span><span style="font-family: "times" , "times new roman" , serif;"> before put the bar on the right place. Otherwise, we animatedly reposition the bar view.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Let's run the app and see how it goes now.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ_nZEQCEvQguoQa_snZxk916fNILbtfM0mkO0dbiUR6yv60F2Fu-8VU43ombIzEZMVAK4jCV3FLz4kbksRbHMDndkchHob8Uxh2IDIh-yE3MacNJbYBbzPEi1DATTSYmTwS2qcxVysYTa/s1600/2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ_nZEQCEvQguoQa_snZxk916fNILbtfM0mkO0dbiUR6yv60F2Fu-8VU43ombIzEZMVAK4jCV3FLz4kbksRbHMDndkchHob8Uxh2IDIh-yE3MacNJbYBbzPEi1DATTSYmTwS2qcxVysYTa/s1600/2.gif" width="320" /></a></div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">It looks more dynamic now. Pretty easy stuff to make the change, right? ;)</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<br />
<h2>
<span style="font-family: "times" , "times new roman" , serif;">A Little Bit More Words At The End</span></h2>
<div>
<span style="font-family: "times" , "times new roman" , serif;">If you feel sick of the traditional horizontal arrangement of the segments, this framework also provides you a vertical way. All you need to do is to assign its </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">organiseMode</span><span style="font-family: "times" , "times new roman" , serif;"> with </span><span style="font-family: "verdana" , sans-serif; font-size: x-small;">.SegmentOrganiseVertical</span><span style="font-family: "times" , "times new roman" , serif;"> value after the view gets initialised.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Find the sample comes with the framework and you will know more about it.</span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div>
<span style="font-family: "times" , "times new roman" , serif;">Happy Coding :D</span></div>
<span style="color: #222222; font-family: "georgia" , "utopia" , "palatino linotype" , "palatino" , serif;"><span style="background-color: #fff9ee;"><span style="font-size: 15px; line-height: 21px;"><br /></span></span></span></div>
<div>
<span style="color: #222222; font-family: "georgia" , "utopia" , "palatino linotype" , "palatino" , serif;"><span style="background-color: #fff9ee;"><span style="font-size: 15px; line-height: 21px;"><br /></span></span></span></div>
<div>
</div>
Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com19tag:blogger.com,1999:blog-1777576823162138196.post-46103374482878839062012-03-18T23:00:00.001+00:002012-03-18T23:00:00.212+00:00Understanding of 'self' in Objective-C<br />
<div style="background-color: white; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
<span style="color: #999999;">From: http://useyourloaf.com/blog/2011/2/8/understanding-your-objective-c-self.html</span></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
A frequent question I see from people new to iOS programming is why access to an objects instance variables (ivars) sometime<span style="font-size: 16px;">s goes via the self object (but not always). For example consider a simple table view controller that contains an NSDate object defined as follows:</span></div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;">@interface</span> RootViewController : <span style="color: #7332a8;">UITableViewController</span> {</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #7332a8;"> NSDate</span> *timestamp;</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;">@property<span style="color: black;"> (</span>nonatomic<span style="color: black;">, </span>retain<span style="color: black;">) </span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> *timestamp;</span></pre>
<pre style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The view controller typically then contains code similar to the following:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;">@implementation</span> RootViewController<span style="font-family: Helvetica; font-size: small; white-space: normal;"> </span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;">@synthesize</span> timestamp;</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)viewDidLoad</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #410d80; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span><span style="color: #b80ca1;">super</span><span style="color: black;"> </span>viewDidLoad<span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> self</span>.<span style="color: #538187;">timestamp</span> = [<span style="color: #7332a8;">NSDate</span> <span style="color: #410d80;">date</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)viewWillAppear:(<span style="color: #b80ca1;">BOOL</span>)animated</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> self</span>.<span style="color: #538187;">timestamp</span> = [<span style="color: #7332a8;">NSDate</span> <span style="color: #410d80;">date</span>];</pre>
<pre style="background-color: white; color: #410d80; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span><span style="color: #b80ca1;">self</span><span style="color: black;">.</span><span style="color: #7332a8;">tableView</span><span style="color: black;"> </span>reloadData<span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)viewDidUnload</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #410d80; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span><span style="color: #b80ca1;">super</span><span style="color: black;"> </span>viewDidUnload<span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> self</span>.<span style="color: #538187;">timestamp</span> = <span style="color: #b80ca1;">nil</span>;</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)dealloc</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span>timestamp<span style="color: black;"> </span><span style="color: #410d80;">release</span><span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> [<span style="color: #b80ca1;">super</span> <span style="color: #410d80;">dealloc</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
So why does this code use self.timestamp everywhere except the dealloc method? To understand what is going on you need to understand something about Objective 2.0 properties, accessors and the dot syntax. That is quite a big topic in itself so I will to summarise the key points.</div>
<h3 style="background-color: white; color: #525252; font-family: Tahoma, Arial, Helvetica, Geneva, sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 4px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Objective-C Properties</h3>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The property declaration for the timestamp object is as follows:</div>
<div style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;">
@property<span style="color: black;"> (</span>nonatomic<span style="color: black;">, </span>retain<span style="color: black;">) </span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> *timestamp;</span></div>
<div style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The important point to notice is that we have specified retain to indicate that when we set the ivar we should retain the object we are assigning (and of course release any old object we were previously retaining). The implementation of RootViewController includes an @synthesize statement so the compiler will automatically generate getter and setter methods for us that will respect this requirement. Typical getter and setter methods would look like this:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #7332a8;">NSDate</span> *)timestamp</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> </span><span style="color: #b80ca1;">return</span><span style="color: black;"> </span>timestamp<span style="color: black;">;</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)setTimestamp:(<span style="color: #7332a8;">NSDate</span> *)newValue</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> if</span> (<span style="color: #538187;">timestamp</span> != newValue)</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> {</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> [<span style="color: #538187;">timestamp</span> <span style="color: #410d80;">release</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #538187;"> timestamp</span> = [newValue <span style="color: #410d80;">retain</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> }</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
</pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The getter is not interesting since it just returns the value of the ivar. The setter method is more interesting since it needs to practise safe memory management. This means whenever we assign a new object we first release the old object and then ensure we retain the new object so that it does not get deallocated before we are finished with it.</div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
To use the setter to store a new NSDate object in our view controller we could write something like this:</div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
[<span style="color: #b80ca1;">self</span> <span style="color: #35595d;">setTimestamp</span>:myNewDate];</div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
This is sending the message setTimestamp to the self object where the self object refers to the RootViewController object. This ends up calling our setter method to safely assign and retain the new object. However there is an alternative to this setter method syntax.</div>
<h3 style="background-color: white; color: #525252; font-family: Tahoma, Arial, Helvetica, Geneva, sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 4px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Objective-C Dot Syntax</h3>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The dot syntax was introduced with Objective-C 2.0 and generates a lot of debate. A number of experienced and long time Cocoa programmers <a href="http://weblog.bignerdranch.com/?p=83" style="color: #779ab3; text-decoration: none;">recommend</a> avoiding it completely. Others such as Chris Hanson have a different view about <a href="http://eschatologist.net/blog/?p=160" style="color: #779ab3; text-decoration: none;">when to use properties and dot notation</a>. Whichever side of the argument you fall I guess the main thing is to be consistent.</div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
Anyway the main thing to understand about the dot syntax is that the following two statements are doing the same thing:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> self</span>.<span style="color: #538187;">timestamp</span> = [<span style="color: #7332a8;">NSDate</span> <span style="color: #410d80;">date</span>];</pre>
<pre style="background-color: white; color: #35595d; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span><span style="color: #b80ca1;">self</span><span style="color: black;"> </span>setTimestamp<span style="color: black;">:[</span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> </span><span style="color: #410d80;">date</span><span style="color: black;">]];</span></pre>
<pre style="background-color: white; color: #35595d; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The dot is just a shortcut for the more traditional Objective-C method call. Any time you see a dot you can replace it with the equivalent square bracket method call syntax. It is important to understand however that this is not the same as writing the following:</div>
<div style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;">
timestamp<span style="color: black;"> = [</span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> </span><span style="color: #410d80;">date</span><span style="color: black;">];</span></div>
<div style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;">
<span style="color: black;"><br /></span></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
Without the self object and the dot we are no longer sending an object a message but directly accessing the ivar named timestamp. Since this bypasses the setter method we will overwrite the timestamp ivar without first releasing the old NSDate object. We will also not retain the new object that we are assigning. Both of these situations are bad!</div>
<h3 style="background-color: white; color: #525252; font-family: Tahoma, Arial, Helvetica, Geneva, sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 4px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Putting it all together</h3>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
If we walk through each of the view controller methods we saw at the start of this post it should now be clear why each access to timestamp is written the way it is:</div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
Firstly the viewDidLoad and viewWillAppear methods both allocate a new date object and need to store a reference to this new object in the ivar of the view controller. Since we may already have an existing object allocated this first needs to be released before assigning the new value. In other words we need the setter method which we can invoke using the timestamp property:</div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
<span style="font-family: Menlo; font-size: 11px; white-space: pre;"><span style="color: #b80ca1;"> self</span></span><span style="font-family: Menlo; font-size: 11px; white-space: pre;">.</span><span style="font-family: Menlo; font-size: 11px; white-space: pre;"><span style="color: #538187;">timestamp</span></span><span style="font-family: Menlo; font-size: 11px; white-space: pre;"> = [</span><span style="font-family: Menlo; font-size: 11px; white-space: pre;"><span style="color: #7332a8;">NSDate</span></span><span style="font-family: Menlo; font-size: 11px; white-space: pre;"> </span><span style="font-family: Menlo; font-size: 11px; white-space: pre;"><span style="color: #410d80;">date</span></span><span style="font-family: Menlo; font-size: 11px; white-space: pre;">];</span></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
If we were to omit the self object in the first of those two statements (timestamp = [NSDate date];) we would be accessing the ivar directly which bypasses the setter and ends up leaking memory.</div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The viewDidUnload method is somewhat different in that it uses a shortcut to both release the NSDate object and then zero the ivar. If you refer back to the setter method you will see that it takes care of the release for us. This is of course true as long as we use the property, if we access the ivar directly we would need to also release the object as follows:</div>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span>timestamp<span style="color: black;"> </span><span style="color: #410d80;">release</span><span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> </span>timestamp<span style="color: black;"> = </span><span style="color: #b80ca1;">nil</span><span style="color: black;">;</span></pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
which is somewhat longer than simply writing this:</div>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> </span><span style="color: #b80ca1;"> self</span><span style="color: black;">.</span>timestamp<span style="color: black;"> = </span><span style="color: #b80ca1;">nil</span><span style="color: black;">;</span></pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
Finally the dealloc method which simply releases the NSDate object needs to access the ivar directly which is what [timestamp release] does.</div>
<h2 style="background-color: white; color: #8d6f58; font-family: Tahoma, Arial, Helvetica, Geneva, sans-serif; font-size: 20px; font-weight: normal; line-height: 28px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Separating ivars from properties</h2>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
There is a further option that I think is also worth mentioning at this point. By default when you synthesize the getter and setter accessor methods it is assumed that the property and ivar have the same name. This can make it confusing at first glance as to when you are using the getter/setter methods and when you are accessing the ivar directly. The alternative is name the ivar differently from the property. A common approach is to use an underscore to prefix the ivars names:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;">@interface</span> RootViewController : <span style="color: #7332a8;">UITableViewController</span> {</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #7332a8;"> NSDate</span> *_timestamp;</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;">@property<span style="color: black;"> (</span>nonatomic<span style="color: black;">, </span>retain<span style="color: black;">) </span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> *timestamp;</span></pre>
<pre style="background-color: white; color: #b80ca1; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
To connect the property (whose name has not changed) the sythensize statement gets an extra option:</div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
<span style="color: #b80ca1;">@implementation</span> RootViewController</div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px; min-height: 13px;">
<br /></div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
<span style="color: #b80ca1;">@synthesize</span> timestamp = <span style="color: #538187;">_timestamp</span>;</div>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
If instead of having the compiler automatically synthesize the getter and setter we were to write them ourselves they would now look something like this:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #7332a8;">NSDate</span> *)timestamp</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> </span><span style="color: #b80ca1;">return</span><span style="color: black;"> </span>_timestamp<span style="color: black;">;</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)setTimestamp:(<span style="color: #7332a8;">NSDate</span> *)newValue</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #b80ca1;"> if</span> (<span style="color: #538187;">_timestamp</span> != newValue)</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> {</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> [<span style="color: #538187;">_timestamp</span> <span style="color: #410d80;">release</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"><span style="color: #538187;"> _timestamp</span> = [newValue <span style="color: #410d80;">retain</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> }</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The getter and setter both directly access the ivar which is now much clearer from the use of the _timestamp name. The rest of the code does not change very much since we do mostly want to always use the getter/setter methods with the exception of the dealloc method which needs to access the ivar directly:</div>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">- (<span style="color: #b80ca1;">void</span>)dealloc</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">{</pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;"> [</span>_timestamp<span style="color: black;"> </span><span style="color: #410d80;">release</span><span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;"> [<span style="color: #b80ca1;">super</span> <span style="color: #410d80;">dealloc</span>];</pre>
<pre style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">}</pre>
<div style="background-color: white; color: #525252; font-family: Menlo; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
The main advantage to this approach is if you forget and accidentally write something like this:</div>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"> timestamp<span style="color: black;"> = [</span><span style="color: #7332a8;">NSDate</span><span style="color: black;"> </span><span style="color: #410d80;">date</span><span style="color: black;">];</span></pre>
<pre style="background-color: white; color: #538187; font-family: Menlo; font-size: 11px;"><span style="color: black;">
</span></pre>
<div style="background-color: white; color: #525252; font-family: Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px; line-height: 28px; margin-bottom: 1em; margin-top: 0em;">
This will generate a compiler error telling you that timestamp is undeclared. This is clearly better than directly assigning to the ivar and leaking memory. What I like about this approach is that it provides some additional compile time checking without requiring much in the way of additional code other than a slightly longer synthesize statement for each property.</div>Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com0tag:blogger.com,1999:blog-1777576823162138196.post-34151718320031273872011-11-14T20:03:00.001+00:002011-11-19T20:16:07.230+00:00UIWebView and EXC_BAD_ACCESSWhen using a UIWebView, if it is released before loading the full content, an EXC_BAD_ACCESS will be aroused. The following article gives a solution to the problem.<br />
<br />
From: http://www.touch-code-magazine.com/uiwebview-and-exc_bad_access/<br />
<br />
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
It is great that in Cocoa Touch you can embed a UIWebView in your app and show web content. It’s basically the same view which safari uses to render web pages, so you get years of web rendering development for free.<br />
<br /></div>
<h2 style="color: #53798b; font-family: Arial, Helvetica, sans-serif; font: normal normal bold 2em/normal Arial, Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-size: large;">
UIWebViewDelegate</span></h2>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
If you want to use UIWebView the first thing to do is have a look at UIWebViewDelegate protocol:<br />
<br /></div>
<div class="wp_syntax" style="background-color: #fdfefe; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: hidden; width: auto;">
<div class="code" style="padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;">
<pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: #f8fbfc; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(237, 239, 240); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(237, 239, 240); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(237, 239, 240); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(237, 239, 240); border-top-style: solid; border-top-width: 1px; clear: none; float: none; font-size: 12px; font: normal normal normal 0.9em/normal Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New'; height: auto; line-height: 1.333; overflow-x: visible; overflow-y: visible; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: auto;"><span style="color: #a61390;">@protocol</span> UIWebViewDelegate
<span style="color: #a61390;">@optional</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">(</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">)</span>webView<span style="color: #002200;">:</span><span style="color: #002200;">(</span>UIWebView <span style="color: #002200;">*</span><span style="color: #002200;">)</span>webView shouldStartLoadWithRequest<span style="color: #002200;">:</span><span style="color: #002200;">(</span><span style="color: #400080;">NSURLRequest</span> <span style="color: #002200;">*</span><span style="color: #002200;">)</span>request navigationType<span style="color: #002200;">:</span><span style="color: #002200;">(</span>UIWebViewNavigationType<span style="color: #002200;">)</span>navigationType;
<span style="color: #002200;">-</span> <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>webViewDidStartLoad<span style="color: #002200;">:</span><span style="color: #002200;">(</span>UIWebView <span style="color: #002200;">*</span><span style="color: #002200;">)</span>webView;
<span style="color: #002200;">-</span> <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>webViewDidFinishLoad<span style="color: #002200;">:</span><span style="color: #002200;">(</span>UIWebView <span style="color: #002200;">*</span><span style="color: #002200;">)</span>webView;
<span style="color: #002200;">-</span> <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>webView<span style="color: #002200;">:</span><span style="color: #002200;">(</span>UIWebView <span style="color: #002200;">*</span><span style="color: #002200;">)</span>webView didFailLoadWithError<span style="color: #002200;">:</span><span style="color: #002200;">(</span><span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span><span style="color: #002200;">)</span>error;
<span style="color: #a61390;">@end</span></pre>
</div>
</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
Quite straightforward to use : you set your viewcontroller (or any other object) to be the delegate for the UIWebView and you can optionally implement</div>
<ul style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
<li style="margin-bottom: 5px;">shouldStartLoadWithRequest – you can check the NSURLRequest to see which is the url being request, what parameters, etc. This one is useful to actually check the links the user is clicking inside a page. For example if the user has clicked a link “javascript:window.close()” it does not make sense to execute it inside the UIWebView, but you can react in some other way in your app UI</li>
<li style="margin-bottom: 5px;">webViewDidStartLoad – an HTTP request has been started – great place/time to show an activity indicator</li>
<li style="margin-bottom: 5px;">webViewDidFinishLoad – a page has been loaded (including all resources like images, etc) – that’s a great moment to hide your activity indicator</li>
<li style="margin-bottom: 5px;">didFailLoadWithError – error handling</li>
</ul>
<span class="Apple-style-span" style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 19px;"><br /></span></span><br />
<ul style="color: #fdfefe; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
</ul>
<h2 style="color: #53798b; font-family: Arial, Helvetica, sans-serif; font: normal normal bold 2em/normal Arial, Helvetica, sans-serif; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span class="Apple-style-span" style="font-size: large;">
Threading and EXC_BAD_ACCESS</span></h2>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
As you can imagine there are several layers of workers in a component as complicated as a web browser – even if you don’t see everything happening behind the curtain – it’s all there, html needs to be parsed, images need to be loaded, css to be applied, etc. etc.</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
Apple lets you set your UIWebView delegate and be notified when all the work has been done, but if you have some UIWebView controllers inside a navigation controller 0r just more complicated UI you can bump into some sporadic EXC_BAD_ACCESS errors.</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
The delegate property of UIWebView is non- owning, i.e. it has the assign accessor, thus when the working thread is finished to load all html, css, images, etc. is sends the webViewDidFinishLoad message to the whatever it finds in the delegate property, but it has no way to tell whether the delegate hasn’t been released yet. There you go, if your delegate has been already released (for example you went away from the screen where the web page was supposed to be displayed) – you get a message sent to a released object.</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
The solution is to set UIWebView’s delegate to nil. The webViewDidFinishLoad message is still sent to it, but since you can send messages to nil it’s actually no problem.</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
For example in your ViewController class :<br />
<br /></div>
<div class="wp_syntax" style="background-color: #fdfefe; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: hidden; width: auto;">
<div class="code" style="padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;">
<pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: #f8fbfc; background-image: none; background-origin: initial; background-position: 0% 0%; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(237, 239, 240); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(237, 239, 240); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(237, 239, 240); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(237, 239, 240); border-top-style: solid; border-top-width: 1px; clear: none; float: none; font-size: 12px; font: normal normal normal 0.9em/normal Consolas, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New'; height: auto; line-height: 1.333; overflow-x: visible; overflow-y: visible; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: auto;"><span style="color: #002200;">-</span> <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>dealloc <span style="color: #002200;">{</span>
<span style="color: #11740a; font-style: italic;">//very important</span>
webView.delegate <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
<span style="color: #002200;">[</span>super dealloc<span style="color: #002200;">]</span>;
<span style="color: #002200;">}</span></pre>
</div>
</div>
<div style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;">
That’s it.</div>Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com0tag:blogger.com,1999:blog-1777576823162138196.post-65864619157190731722011-10-30T21:10:00.000+00:002011-10-30T21:13:41.254+00:00The Death of Global VariablesFrom: http://www.cocoanetics.com/2009/05/the-death-of-global-variables/<br />
<br />
<span class="Apple-style-span" style="background-color: #ececec; color: #111111; font-family: Arial, Verdana, sans-serif; font-size: 14px;"></span><br />
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The topic of global variables is a highly philosophical and emotional one as I should later see. Programming teachers usually try to dissuade their students from using them wherever possible, but newcomers still insist on using them. And then there is the rebel amongst seasoned programmers who rides to the rescue of global variables. “No! Globals are not evil! It’s evil people that abuse them and kill programs with them.”</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
My usual approach is quickly steer the topic to something completely different. Did I mention that I am getting married in just 1 week?</div>
<h3 style="font-family: Arial, Helvetica, sans-serif; font-size: 20px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Real Global Variables</h3>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Ok, but seriously, yes, you can create global variables if you absolutely insist. You can do this in C like this:</div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p8787" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code7" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;"><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">int</span> myGlobalVar; <span style="color: #11740a; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// local declaration</span></pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
And in all other classes/modules that you want to be able to access it you go:</div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p8788" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code8" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;"><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">extern</span> <span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">int</span> myGlobalVar; <span style="color: #11740a; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// externally linked</span></pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
This external declaration you could pack into a header and #import this header everywhere you want to access this global variable. Only the declaration really reserves the memory for the variable. The “extern” keyword tells the linker (which runs after the compiler) to resolve all external references to point to the real declaration.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Ok, now, my son, I have shown you the pack of cigarettes. Will you please promise me not to smoke them in secret?</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
I generally call global variables evil because they tempt you with ease of use and seduce you away from encapsulated and easy to maintain code. The main reason being that only you – the original programmer – know what all those variables mean and where the declaration is buried.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Generally you don’t want to be dependent on such knowledge, you want clear cut pieces where you group together stuff that belongs together logically and bundle in the functions to work on this data. This concept is called “encapsulation” and is core to the principle of OOP (Object Oriented Programming)</div>
<h3 style="font-family: Arial, Helvetica, sans-serif; font-size: 20px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
“All in” Application Delegate</h3>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
When I started out with trying to adhere to the Model-View-Controller paradigm I though this means that you put all data operations into the app delegate. Getting to the app delegate is simple enough, you only need to do it like this:</div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p8789" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code9" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;">MyAppDelegateClass <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span>appDelegate <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>UIApplication sharedApplication<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span> delegate<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>appDelegate someMethod<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span>..<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;</pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Again, very tempting. You feel much smarter because you don’t need global variables, but then you find yourself constantly copy-pasting the first line of the example because from everywhere you are needing to call methods and access data that you put in the app delegate. My first released apps are still full of these until I can find time to go back in and fix that.</div>
<h3 style="font-family: Arial, Helvetica, sans-serif; font-size: 20px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Shared Instances</h3>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The cleanest, most professional method I have found on my travels is to use so-called shared instances. You basically create a class method that instantiates a single instance of the class (aka a “singleton”) on the first call and returns this instance on subsequent calls.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Here is an example showing an Engine class you might find in a board game. Note that you still can use c-style arrays if you so choose, but it’s all nicely packaged into a class.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Engine.h</strong></div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p87810" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code10" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;"><span style="color: #6e371a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#import </span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@interface</span> Engine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/" style="color: #404794; cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"><span style="color: #400080; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">NSObject</span></a> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
NSUInteger board<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span><span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">100</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>; <span style="color: #11740a; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// c-style array</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">+</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>Engine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> sharedInstance;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> getFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>x;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">void</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> setFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>x ToValue<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>newVal;
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@end</span></pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Engine.m</strong></div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p87811" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code11" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;"><span style="color: #6e371a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#import "Engine.h"</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@implementation</span> Engine
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">static</span> Engine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span>_sharedInstance;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">id</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> init
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">if</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>self <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>super init<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
<span style="color: #11740a; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// custom initialization</span>
<a href="http://www.opengroup.org/onlinepubs/009695399/functions/memset.html" style="color: #404794; cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">memset</span></a><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>board, <span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">0</span>, <a href="http://www.opengroup.org/onlinepubs/009695399/functions/sizeof.html" style="color: #404794; cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">sizeof</span></a><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>board<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">return</span> self;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">+</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>Engine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> sharedInstance
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">if</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">!</span>_sharedInstance<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
_sharedInstance <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>Engine alloc<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span> init<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">return</span> _sharedInstance;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> getFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>x
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">return</span> board<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>x<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">-</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">void</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span> setFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>x ToValue<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span>NSUInteger<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>newVal
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{</span>
board<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>x<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span> newVal;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">}</span>
<span style="color: #a61390; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@end</span></pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
To test this new class we simple put the #import into our app delegate and a couple of lines:</div>
<div class="wp_codebox" style="background-color: #f9f9f9; border-bottom-color: silver; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: silver; border-left-style: solid; border-left-width: 1px; border-right-color: silver; border-right-style: solid; border-right-width: 1px; border-top-color: silver; border-top-style: solid; border-top-width: 1px; color: #110000; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: auto;">
<table style="border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 600px;"><tbody style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr id="p87812" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td class="code" id="p878code12" style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 2px; padding-left: 4px; padding-right: 4px; padding-top: 2px; vertical-align: top;"><pre class="objc" style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; clear: none; display: block; float: none; font-family: monospace; font-size: 12px; line-height: 1.333; outline-color: initial; outline-style: none; outline-width: initial; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto;"><span style="color: #11740a; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">// at the top: #import "Engine.h"</span>
Engine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">*</span>myEngine <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">=</span> <span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>Engine sharedInstance<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;
<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>myEngine setFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">3</span> ToValue<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">1</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span>;
NSLog<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #bf1d1a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@</span><span style="color: #bf1d1a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"pos 3: %d"</span>,<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>myEngine getFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">3</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>;
NSLog<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">(</span><span style="color: #bf1d1a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">@</span><span style="color: #bf1d1a; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">"pos 2: %d"</span>,<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">[</span>myEngine getFieldValueAtPos<span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">:</span><span style="color: #2400d9; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">2</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">]</span><span style="color: #002200; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">)</span>;</pre>
</td></tr>
</tbody></table>
</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
You can see that you don’t need to alloc-init the class, just always retrieve the sharedInstance pointer. Behind the scenes this class method will create the instance on the first call and save it in a static variable. Static variables retain their value indefinitely.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
I am told that you don’t need to worry about the release because all of the app’s memory will be cleaned up when it quits anyway. But if you want to be extra-nice you can put a release for the sharedInstance into the dealloc of your appDelegate. Though I found that the appDelegate’s dealloc never actually gets called anyway. I suspect that is because the iPhone OS considers it quicker to just kill the app and free up all of it’s memory in one go.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
You can also pack all other engine-related methods and data variables into this Engine class. Just not anything that has to do with displaying it. This makes the engine reusable. You might create variants of your app with totally different display paradigms but because the Engine class stands by itself you can reuse it.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
In summary I am recommending that you don’t use any technique that will cause you more work in the future. You can mix and match techniques as you choose once you are a “grown up developer” and understand what you are doing.</div>
<div style="font-size: 14px; line-height: 19px; margin-bottom: 15px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Until you do, please refrain from using global variables and putting it all into the poor app delegate, but instead make shared instances your method of choice for globally accessible data.</div>Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com0tag:blogger.com,1999:blog-1777576823162138196.post-4452087269745023172011-10-11T18:39:00.000+01:002011-10-12T00:01:11.908+01:00NSKeyedArchiver TutorialSometimes we may want our app to save some data before it terminates and load the data after it is opened again. There are usually two ways to achieve that:<br />
<br />
1. using NSUserDefaults.<br />
2. using NSKeyedArchiver.<br />
<br />
Both are very standard methods provided by Cocoa, but as NSUserDefaults is designed for storing default settings rather than data inside the app, in most of the cases, you want to use NSKeyedArchiver instead.<br />
<br />
To use NSKeyedArchiver, first of all you need to add a protocol called <span class="Apple-style-span" style="color: #351c75;">NSCoding</span> to the class whose properties are supposed to be saved and then loaded in the app.<br />
<br />
For example, you have a class called <span class="Apple-style-span" style="color: #45818e;">Student</span> which is used to store some information about a student. Its header may look like this:<br />
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<div class="p1">
<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">@interface</span></span> Student : <span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSObject</span></span> <<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSCoding</span></span>> {</div>
<div class="p1">
<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *studentID;</div>
<div class="p1">
<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *studentName;</div>
<div class="p1">
}</div>
<div class="p2">
<br /></div>
<div class="p1">
<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">@property</span></span> (<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">copy</span></span>) <span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *studentID;</div>
<div class="p1">
<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">@property</span></span> (<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">copy</span></span>) <span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *studentName;</div>
<div class="p2">
<br /></div>
<div class="p1">
+ (<span class="s3"><span class="Apple-style-span" style="color: #45818e;">Student</span></span> *)initWithStudentID:(<span class="Apple-style-span" style="color: #351c75;">NSString</span> *)ID andStudentName:(<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *)name;</div>
<div class="p2">
<br /></div>
<div class="p3">
<span class="Apple-style-span" style="color: #a64d79;">@end</span></div>
</div>
</div>
You also need to implement two delegate methods <b>initWithCoder:</b> and <b>encodeWithCoder:</b> in the .m file of this class. It may look like this:<br />
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<div class="p1">
+ (<span class="s3"><span class="Apple-style-span" style="color: #45818e;">Student</span></span> *)initWithStudentID:(<span class="Apple-style-span" style="color: #351c75;">NSString</span> *)ID andStudentName:(<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *)name {</div>
<div class="p1">
</div>
<div class="p2">
</div>
<div class="p1">
<span class="Apple-style-span" style="color: #45818e;">Student</span> *student = [[<span class="Apple-style-span" style="color: #45818e;">Student</span> <span class="s4"><span class="Apple-style-span" style="color: #20124d;">alloc</span></span>] <span class="s4"><span class="Apple-style-span" style="color: #20124d;">init</span></span>];</div>
<div class="p2">
</div>
<div class="p1">
student.<span class="Apple-style-span" style="color: #45818e;">studentID</span> = [<span class="Apple-style-span" style="color: #351c75;">NSString</span> <span class="s4"><span class="Apple-style-span" style="color: #20124d;">stringWithString</span></span><span class="Apple-style-span" style="color: #20124d;">:</span>ID];</div>
<div class="p1">
student.<span class="Apple-style-span" style="color: #45818e;">st</span><span class="Apple-style-span" style="color: #45818e;">udentName</span> = [<span class="Apple-style-span" style="color: #351c75;">NSString</span> <span class="Apple-style-span" style="color: #20124d;"><span class="s4">stringWithString</span>:</span>name];</div>
<div class="p2">
</div>
<div class="p1">
<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">return</span></span> [student <span class="s4"><span class="Apple-style-span" style="color: #20124d;">autorelease</span></span>];</div>
<div class="p1">
}</div>
<div class="p2">
<br /></div>
<div class="p1">
- (<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">id</span></span>)initWithCoder:(<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSCoder</span></span> *)aDecoder {</div>
<div class="p1">
<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">if</span></span> (<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">self</span></span> = [<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">super</span></span> <span class="s4">init</span>]) {</div>
<div class="p1">
[<span class="Apple-style-span" style="color: #a64d79;">self</span> <span class="s5"><span class="Apple-style-span" style="color: #134f5c;">setStudentID</span></span>:[aDecoder <span class="s4" style="color: #20124d;">decodeObjectForKey</span>:<span class="s6"><span class="Apple-style-span" style="color: #cc0000;">@"studentID</span></span>]];</div>
<div class="p1">
[<span class="Apple-style-span" style="color: #a64d79;">self</span> <span class="s5"><span class="Apple-style-span" style="color: #134f5c;">setStudentName</span></span>:[aDecoder <span class="s4" style="color: #20124d;">decodeObjectForKey</span>:<span class="s6"><span class="Apple-style-span" style="color: #cc0000;">@"studentName"</span></span>]];</div>
<div class="p1">
}</div>
<div class="p3">
<span class="s7"> </span><span class="Apple-style-span" style="color: #a64d79;">return<span class="s7"> </span>self</span><span class="s7">;</span></div>
<div class="p1">
}</div>
<div class="p2">
<br /></div>
<div class="p1">
- (<span class="s3"><span class="Apple-style-span" style="color: #a64d79;">void</span></span>)encodeWithCoder:(<span class="Apple-style-span" style="color: #351c75;">NSCoder</span> *)aCoder {</div>
<div class="p4">
<span class="s7"> </span><span class="s7">[aCoder </span><span class="Apple-style-span" style="color: #20124d;">encodeObject<span class="s7">:</span></span><span class="s1"><span class="Apple-style-span" style="color: #45818e;">studentID</span></span><span class="s7"> </span><span class="Apple-style-span" style="color: #20124d;">forKey<span class="s7">:</span></span><span class="s6"><span class="Apple-style-span" style="color: #cc0000;">@"studentID"</span></span><span class="s7">];</span></div>
<div class="p5">
<span class="s7"> [aCoder </span><span class="Apple-style-span" style="color: #20124d;">encodeObject</span><span class="s7">:<span class="Apple-style-span" style="color: #45818e;">student</span></span><span class="s1"><span class="Apple-style-span" style="color: #45818e;">Name</span></span><span class="s7"> </span><span class="Apple-style-span" style="color: #20124d;">forKey</span><span class="s7">:</span><span class="s6"><span class="Apple-style-span" style="color: #cc0000;">@"studentName"</span></span><span class="s7">];</span></div>
<div class="p1">
}</div>
</div>
</div>
Note that you must use the same key for one object in method initWithCode: and encodeWithCoder:, or the app will not be able to find the saved object when decoding. The key is the only identifier of its corresponding object. The encoded data will be stored in a binary formatted file on your disk.<br />
<br />
Now we are on the halfway. What we need to do then is to tell the app that we want to save some data before it is terminated. Find the <b>applicationWillTerminate:</b> method in YourProjectAppDelegate.m file, and add the following code:<br />
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<div class="p1">
- (<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">void</span></span>)applicationWillTerminate:(<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSNotification</span></span> *)notification {</div>
<div class="p1">
</div>
<div class="p2">
</div>
<div class="p3">
<span class="s7"> [</span><span class="s1"><span class="Apple-style-span" style="color: #a64d79;">self</span></span><span class="s7"> </span><span class="Apple-style-span" style="color: #134f5c;">saveDataToDisk</span><span class="s7">];</span></div>
<div class="p1">
}</div>
</div>
</div>
The code will call the method <b>saveDataToDisk</b> when user closes the app. So we're gonna implement that method to tell the app the we want to save some data. The code may look like this:<br />
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<div class="p1">
</div>
<div class="p1">
- (<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">void</span></span>)saveDataToDisk {</div>
<div class="p1">
<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *path = <span class="Apple-style-span" style="color: #cc0000;">@"~/Documents/data"</span>;</div>
<div class="p1">
<span class="s1">path = [path </span><span class="Apple-style-span" style="color: #20124d;">stringByExpandingTildeInPath</span><span class="s1">];</span></div>
<div class="p2">
</div>
<div class="p3">
<span class="s4"> </span><span class="Apple-style-span" style="color: #351c75;">NSMutableDictionary</span><span class="s4"> *rootObject;</span></div>
<div class="p1">
rootObject = [<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSMutableDictionary</span></span> <span class="s5"><span class="Apple-style-span" style="color: #20124d;">dictionary</span></span>];</div>
<div class="p1">
<br /></div>
<div class="p1">
[rootObject <span class="s5"><span class="Apple-style-span" style="color: #20124d;">setValue</span></span>:<span class="s6"><span class="Apple-style-span" style="color: #45818e;">student</span></span> <span class="s5"><span class="Apple-style-span" style="color: #20124d;">forKey</span></span>:<span class="s7"><span class="Apple-style-span" style="color: #cc0000;">@"student"</span></span>];</div>
<div class="p1">
</div>
<div class="p1">
[<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSKeyedArchiver</span></span> <span class="s5"><span class="Apple-style-span" style="color: #20124d;">archiveRootObject</span></span>:rootObject <span class="s5"><span class="Apple-style-span" style="color: #20124d;">toFile</span></span>:path];</div>
<div class="p1">
}</div>
</div>
</div>
<br />
The object <span class="Apple-style-span" style="color: #45818e;">student</span> is an instance of Class <span class="Apple-style-span" style="color: #45818e;">Student</span>. In this example, we save it in a file named <i>data</i> under the the Documents folder.<br />
<br />
Alright, now we should be able to save our data into the disk. Now the only thing left is to load the data. The method may look like this:<br />
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<div class="p1">
</div>
<div class="p1">
- (<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">void</span></span>)loadDataFromDisk {</div>
<div class="p1">
<span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSString</span></span> *path = <span class="Apple-style-span" style="color: #cc0000;">@"~/Documents/data"</span>;</div>
<div class="p1">
<span class="s1">path = [path </span><span class="Apple-style-span" style="color: #20124d;">stringByExpandingTildeInPath</span><span class="s1">];</span></div>
<div class="p2">
</div>
<div class="p3">
<span class="s4"> </span><span class="Apple-style-span" style="color: #351c75;">NSMutableDictionary</span><span class="s4"> *rootObject;</span></div>
<div class="p1">
<span class="s1">rootObject = [</span><span class="s2"><span class="Apple-style-span" style="color: #351c75;">NSKeyedUnarchiver</span></span><span class="s1"> </span><span class="Apple-style-span" style="color: #20124d;">unarchiveObjectWithFile</span><span class="s1">:path];</span></div>
<div class="p1">
<br /></div>
<div class="p1">
<span class="s1"><span class="Apple-style-span" style="color: #a64d79;">if</span></span> ([rootObject <span class="s2"><span class="Apple-style-span" style="color: #20124d;">valueForKey</span></span>:<span class="s3"><span class="Apple-style-span" style="color: #cc0000;">@"student"</span></span>]) {</div>
<div class="p1">
<span class="s4"><span class="Apple-style-span" style="color: #45818e;">student</span></span> = [rootObject <span class="s2"><span class="Apple-style-span" style="color: #20124d;">valueForKey</span></span>:<span class="s3"><span class="Apple-style-span" style="color: #cc0000;">@"student"</span></span>];</div>
<div class="p1">
}</div>
<div class="p1">
}</div>
</div>
</div>
The method does two things: 1. Tell the app where the saved file can be found; 2. Assign object with the corresponding key to the <span class="Apple-style-span" style="color: #45818e;">student</span> instance.<br />
<br />
You can call this method whenever you believe is necessary to load the data from local disk to your app.<br />
<br />
Happy Coding :)Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com7tag:blogger.com,1999:blog-1777576823162138196.post-76035176371515549562011-10-10T20:13:00.000+01:002011-10-12T00:14:31.984+01:00Using Blocks in Objective-CFrom: <a href="http://pragmaticstudio.com/blog/2010/7/28/ios4-blocks-1">http://pragmaticstudio.com/blog/2010/7/28/ios4-blocks-1</a><br />
<br />
<span class="Apple-style-span" style="background-color: white; color: #444444; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 14px;"></span><br />
<div style="line-height: 1.3em;">
iOS 4 introduces one new feature that will fundamentally change the way you program in general: blocks. Blocks are an extension to the C language and thus fully supported in Objective-C. If you’re coming from a programming language such as Ruby, Python, or Lisp, then you know the power of blocks. Simply put, blocks let you encapsulate chunks of code and pass them around like any other object. It’s a different style of programming that you’ll want to become familiar with to take advantage of new APIs in iOS 4.<br />
<br /></div>
<div style="line-height: 1.3em;">
Let’s start by taking a look at two examples of where you might use blocks in iOS 4: view animations and enumeration.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Blocks By Example</h3>
<div style="line-height: 1.3em;">
As our first example, suppose we’re creating a card game and we want to animate sliding a card from the dealer’s hand to a player’s position. Fortunately, the UIKit framework does all the heavy lifting when it comes to performing animations. What gets animated, however, is specific to your application. You specify what will be animated in a block, and toss it over to the<code>animateWithDuration:animations:</code> method, like so:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_567171" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">[</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">UIView</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">animateWithDuration</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:2.0</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">animations</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:^ {</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">self</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #45818e;">cardView</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">alpha</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> = 1.0;</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">self</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="background-color: #f8f8f8; color: #45818e;">cardView</span>.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">frame</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> = CGRectMake(176.0, 258.0, 72.0, 96.0);</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">self</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #45818e;">cardView</span>.</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">transform</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> = CGAffineTransformMakeRotation(</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #783f04;">M_PI</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">);</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}</code></div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">];</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
When this animation block is run, our card view will animate in three ways: change its alpha to fade in the card, change its position to the lower-right of the frame (the player’s position), and rotate itself 180 degrees (to give the dealer style points).<br />
<br /></div>
<div style="line-height: 1.3em;">
Our second example of blocks is to enumerate over a collection of cards and print the name and index of each card. You could use a <code>for</code> loop for this, but in iOS 4 the <code>NSArray</code> class has a handy <code>enumerateObjectsUsingBlock:</code> method that takes a block. Here’s how to use it:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_386706" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSArray</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*cards = </code><span class="Apple-style-span" style="background-color: white;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">[</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSArray</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">arrayWithObjects</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Jack"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Queen"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"King"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Ace"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">nil</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">];</code></span></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
</div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">[cards </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">enumerateObjectsUsingBlock</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:^(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">id</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">object, </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSUInteger</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">index, </code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">BOOL</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*stop) {</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">NSLog</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"%@ card at index %d"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, object, index);</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}];</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
As we’ll explore a bit more later, this block takes three parameters: the current element in the array, its index, and a flag to signal whether enumeration should stop (which we’ve ignored). The <code>enumerateObjectsUsingBlock:</code> method calls the block once for each element in the array and supplies the parameters.<br />
<br /></div>
<div style="line-height: 1.3em;">
So the upshot of using blocks in your Mac and iOS apps is that they allow you to attach arbitrary code to Apple-provided methods. Although similar in concept to delegation, passing short inline blocks of code to methods is often more convenient and elegant.<br />
<br /></div>
<div style="line-height: 1.3em;">
That’s a good start, but it’s important to understand what’s going on. Whenever I’m learning anything new, I like to break it down into its simplest elements, get comfortable with how they work, and then (hopefully) put everything back together again. That way I feel confident with the code I write and can quickly debug any problems. So let’s step back for a minute and learn how to declare and call basic blocks.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Block Basics</h3>
<div style="line-height: 1.3em;">
A block is simply a chunk of executable code. For example, here’s a block that prints the current date and time:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_931904" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">^ {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*date = [</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">date];</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSLog</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"The date and time is %@"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, date);</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
The caret (<code>^</code>) introduces a block literal and the curly braces enclose statements that make up the body of the block. You can think of a block as being similar to an anonymous function.<br />
<br /></div>
<div style="line-height: 1.3em;">
So if it’s anonymous, how exactly do we use this block? The most common way to use a block is to pass it to a method that in turn calls the block. We saw how to do that earlier with animations and enumeration. The other way to use a block is to assign it to a block variable and call the block directly. Here’s how to assign our block to a block variable called <code>now</code>:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_897317" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">void</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(^now)(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">void</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">) = ^ {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*date = [</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">date];</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">NSLog</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"The date and time is %@"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, date);</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Here’s where things get funky. The syntax for declaring a block variable takes some getting used to. If you’ve used function pointers, block variables will look familiar. On the right-hand side of the assignment we have our block literal (nothing new there). On the left-hand side of the assignment we’ve declared a block variable called <code>now</code>.<br />
<br /></div>
<div class="graphic" style="text-align: center;">
<img alt="Block Syntax" height="89" src="http://pragmaticstudio.com/images/blog/block-syntax-1.png" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(204, 204, 204); border-left-style: none; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: none; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: none; border-top-width: 1px; border-width: initial; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;" width="225" /></div>
<div style="line-height: 1.3em;">
<br />
The name of the block variable is always preceded by a <code>^</code> and in parentheses. Block variables have an associated type. In this case, the <code>now</code>variable can reference any block that returns no value (the first <code>void</code>) and takes no parameters (the <code>void</code> in parentheses). Our block conforms to this type, so we can safely assign it to the <code>now</code> variable.<br />
<br /></div>
<div style="line-height: 1.3em;">
Once we have a block variable in scope, calling the block is just like calling a function. Here’s how we call our block:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_910071" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">now();</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
You could declare the block variable in a C function or Objective-C method, for example, and then call it in the same scope. When the block executes, it prints the current date and time. So far, so good.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Blocks Are Closures</h3>
<div style="line-height: 1.3em;">
If that’s all there was to blocks, they’d be just like functions. But it turns out that blocks are more than just chunks of executable code. Blocks also capture their surrounding state. That is, blocks are closures: they <em>close around</em> variables that are in scope at the time the block is declared. To illustrate, let’s change the previous example around a bit by moving the initialization of the date outside the block:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_927418" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*date = [</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">date];</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">void</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(^now)(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">void</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">) = ^ {</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">NSLog</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"The date and time is %@"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, date);</code></div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
<div class="line number6 index5 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
</div>
<div class="line number7 index6 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">now();</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
When you call this block the first time, it behaves exactly like the previous version: it prints the current date and time. But there’s a significant difference here. It becomes evident when we change the date and then call the block again:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_441630" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">sleep</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(5);</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
</div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">date = [</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDate</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">date];</code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code> </div>
<div class="line number5 index4 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">now();</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Even though we’ve changed the <code>date</code> variable referenced by the block, when the block is called it still prints the original date and time. It’s as if time stood still when the block was declared. And that’s effectively what happens. As execution passes over the point where the block is declared, the block takes a (read-only) snapshot of all the variables in scope that the block uses. You can think of the value of the <code>date</code>variable as being frozen inside the block. Therefore, whenever the block is called—immediately, 5 seconds later, or just before the app quits—it always prints the original date and time.<br />
<br /></div>
<div style="line-height: 1.3em;">
Now, the fact that blocks are closures is not particularly interesting in this example. After all, you could have just passed the date as a parameter to the block (more on that next). But closures become really useful when you start passing blocks around to methods because the captured state goes along for the ride.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Block Parameters</h3>
<div style="line-height: 1.3em;">
Just like functions, blocks can take parameters and return values. Say, for example, we want a block that takes a given number and returns the result of tripling that number. Here’s the block literal:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_240611" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">^(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number) {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">return</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number * 3;</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Assigning this block to a block variable called <code>triple</code> looks like this:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_60027" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(^triple)(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">) = ^(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number) {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">return</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number * 3;</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Again, the tricky part is getting comfortable with the block variable syntax on the left-hand side of the assignment. Let’s break it down from left to right.<br />
<br /></div>
<div class="graphic" style="text-align: center;">
<img alt="Block Syntax" height="82" src="http://pragmaticstudio.com/images/blog/block-syntax-2.png" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(204, 204, 204); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(204, 204, 204); border-left-style: none; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: none; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: none; border-top-width: 1px; border-width: initial; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px;" width="225" /></div>
<div style="line-height: 1.3em;">
<br />
The first <code>int</code> is the return type. Then in parentheses comes the caret introducing the block variable called <code>triple</code>. Finally we have a list of parameter types in parentheses (one <code>int</code> in this case). The block literal on the right-hand side of the assignment conforms to this type. Note, however, that as a matter of convenience there’s no need to declare the return type of the block literal. The compiler can infer it from the return statement.<br />
<br /></div>
<div style="line-height: 1.3em;">
To call the block, you need to pass the number to be tripled and (ideally) do something with the return value, like so:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_193382" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">result = triple(2);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
By way of comparison, here’s how you would declare and create a block that takes two <code>int</code> parameters, multiplies them together, and returns the result as an <code>int</code> value:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_63503" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">(^multiply)(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">) = ^(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">x, </code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">y) {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">return</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">x * y;</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">};</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
And here’s how you’d call this block:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_752021" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">result = multiply(2, 3);</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Declaring block variables gave us an opportunity to explore block types and how to call blocks. The block variable looks like a function pointer and calling the block is similar to calling a function. But unlike function pointers, blocks are actually Objective-C objects. And that means we can pass them around like other objects.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Methods Can Take Blocks</h3>
<div style="line-height: 1.3em;">
Now, in practice blocks are most useful when you pass them as parameters to methods that in turn call the block. And when you’re passing a block to a method, it’s usually more convenient to use inline blocks rather than assigning the block to a typed variable and then passing it to the method. For instance, we used inline blocks in the animation and enumeration examples we saw earlier.<br />
<br /></div>
<div style="line-height: 1.3em;">
Apple has added methods to their frameworks that take blocks, and you can write APIs that take blocks, too. For example, suppose we want to create a <code>Worker</code> class method that takes a block and repeatedly calls it a given number of times, passing in the repeat count each time. Here’s how we might call that method with an inline block that triples each number (1 through 10):</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_892154" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">[</code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #45818e;">Worker</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">repeat</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:10 </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #20124d;">withBlock</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">:^(</code><code class="objc datatypes" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">int</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number) {</code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">return</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">number * 3;</code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">}];</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
The method could handle any block that takes a single <code>int</code> parameter and returns an <code>int</code> result. Want to double all the numbers? Just give the method a different block.<br />
<br /></div>
<h3 style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; clear: both; color: #333333; font-family: 'Trebuchet MS', Arial, Helvitica, sans-serif; font-size: 18px; letter-spacing: -0.05em; margin-bottom: 0.35em; margin-top: 0.5em;">
Your Turn</h3>
<div style="line-height: 1.3em;">
OK, so how would you implement the <code>repeat:withBlock:</code> method above to accept and call a passed block? Give it some thought, and we’ll tackle it in the <a href="http://pragmaticstudio.com/blog/2010/9/15/ios4-blocks-2" style="color: #678b3c;">next installment</a>. In the meantime, practice using blocks by calling the <code>enumerateKeysAndObjectsUsingBlock:</code> method with a block that prints the keys and values of this <code>NSDictionary</code>:</div>
<div>
<div class="syntaxhighlighter nogutter objc" id="highlighter_523573" style="background-color: rgb(255, 255, 255) !important; border-bottom-color: rgb(204, 204, 204) !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; border-left-color: rgb(204, 204, 204) !important; border-left-style: dotted !important; border-left-width: 1px !important; border-right-color: rgb(204, 204, 204) !important; border-right-style: dotted !important; border-right-width: 1px !important; border-top-color: rgb(204, 204, 204) !important; border-top-style: dotted !important; border-top-width: 1px !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 13px; font-style: normal !important; line-height: 1.21 !important; margin-bottom: 10px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; overflow-x: auto !important; overflow-y: auto !important; padding-bottom: 10px !important; padding-left: 10px !important; padding-right: 10px !important; padding-top: 10px !important; position: relative !important; width: auto;">
<table border="0" cellpadding="0" cellspacing="0" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><tbody style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<tr style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><td class="code" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto;"><div class="container" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<div class="line number1 index0 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDictionary</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">*cards = </code></div>
<div class="line number2 index1 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">[</code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #351c75;">NSDictionary</span></code> <code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">dictionaryWithObjectsAndKeys:</code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Queen"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"card"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code></div>
<div class="line number3 index2 alt2" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(248, 248, 248) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"Hearts"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"suit"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code></div>
<div class="line number4 index3 alt1" style="background-attachment: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255) !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0em !important; padding-right: 1em !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
<code class="objc spaces" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"> </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"10"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><span class="Apple-style-span" style="color: #cc0000;"><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">@</code><code class="objc string" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: italic !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">"value"</code></span><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">, </code><code class="objc keyword" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;"><span class="Apple-style-span" style="color: #a64d79;">nil</span></code><code class="objc plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; border-bottom-left-radius: 0px 0px !important; border-bottom-right-radius: 0px 0px !important; border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-left-radius: 0px 0px !important; border-top-right-radius: 0px 0px !important; border-top-width: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 0, 0) !important; float: none !important; font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; font-style: normal !important; height: auto !important; left: auto !important; line-height: 1.21 !important; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; min-height: inherit !important; outline-color: initial !important; outline-style: initial !important; outline-width: 0px !important; overflow-x: visible !important; overflow-y: visible !important; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">];</code></div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
<div style="line-height: 1.3em;">
Have fun.</div>
Anonymoushttp://www.blogger.com/profile/12129731867152667221noreply@blogger.com0