tag:blogger.com,1999:blog-15078546022534612322024-03-05T20:47:00.284-05:00Collateral DamageProgramming / Development BlogCollateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1507854602253461232.post-12601576405639224222010-10-12T13:09:00.004-04:002010-10-25T12:04:25.305-04:00Securis TutorialBy Request - A tutorial on using Securis 1.2.1<br />
<br />
<br />
<b>Main Screen</b><br />
<br />
This is what you see as soon as you open the application. If it is your first time opening the application, an alert will pop up with an instructional blurb. After you close the alert, it will not show again.<br />
<br />
There are two buttons on this screen (shown below):<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcWxEWMrt5TTWzZFi0IJm60jmm_T90ozC0Tp1mqGtMdrec9IJGOBBCfQuA7QEw5UldBo2xqxluNQnfhPAvB0zLcHbBK35T0sCvus_lbDjJ93RvUbOI3I1t37VPeBaXhZ0sUcX2Btm6UE/s1600/IMG_0060.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWcWxEWMrt5TTWzZFi0IJm60jmm_T90ozC0Tp1mqGtMdrec9IJGOBBCfQuA7QEw5UldBo2xqxluNQnfhPAvB0zLcHbBK35T0sCvus_lbDjJ93RvUbOI3I1t37VPeBaXhZ0sUcX2Btm6UE/s320/IMG_0060.PNG" width="213" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><b>Generate Passcodes</b>: This button pulls up the Password Generator View. This view allows you to create complex passwords quickly and easily.<br />
<br />
<b>Stored Passcodes:</b> This button pulls up the Stored Password View. This view allows you to view your saved passwords, as well as editing information such as the Source, Username, and/or the password itself.<br />
<br />
<br />
Let's start with the Password Generator View. Tap the "locked" padlock button. You should now see a screen similar to the one pictured below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlvfyFvFxquiv3c1J9i4TNEyfISgCQ4ft_by7dMdHyEFUj1udDdyDgLu8EAcYkB-lI8OANWnZnKkQAdBAqN2pAaLzhaHazhQMSsij-RpLEI3wvRcm-dVEYEYPWoi-YEV7NEC-jx-EpQo/s1600/IMG_0056.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlvfyFvFxquiv3c1J9i4TNEyfISgCQ4ft_by7dMdHyEFUj1udDdyDgLu8EAcYkB-lI8OANWnZnKkQAdBAqN2pAaLzhaHazhQMSsij-RpLEI3wvRcm-dVEYEYPWoi-YEV7NEC-jx-EpQo/s320/IMG_0056.PNG" width="213" /></a></div><br />
Ok, this screen is easier than it looks. There are three main components to this screen: the slider, the 4 switches, and the "Generate" button.<br />
<br />
<b>Slider: </b>The slider allows you to choose the length of your password. Sliding from left to right will increase the length of your password. The label to the right of the slider informs you of the current length you have chosen.<br />
<br />
<b>Switches: </b>There are 4 switches. Toggling these switches allows you to change the properties of your password. For Example: Toggling the switch labeled "Numbers" to "Off" will disable numbers from being used in your password.<br />
<br />
<b>"Generate" Button: </b>This button generates your password. After generating your password you will see two new things on the screen; Your password and a little "i" (Information) button. (pictured below)<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifgjcADoirggl7LRzSOZ3QFGFZFGm4PzjrRuN-uMSqzzddRgHMCNR5oixMzZPgT-RqyLkBD5YiEQNd8Hmh72_GW5TzkGjFrBKgct9bVIywVBw4Lsb3QKCnQ4TFxYULsuXqTqkJ6FeTTcc/s1600/IMG_0057.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifgjcADoirggl7LRzSOZ3QFGFZFGm4PzjrRuN-uMSqzzddRgHMCNR5oixMzZPgT-RqyLkBD5YiEQNd8Hmh72_GW5TzkGjFrBKgct9bVIywVBw4Lsb3QKCnQ4TFxYULsuXqTqkJ6FeTTcc/s320/IMG_0057.PNG" width="213" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Your Password:</b> Once you have tapped the "Generate" Button, a password will appear above the button. You can press the button again to get a new password, as well as changing the slider and switch settings. </div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;"><b>Information Button:</b> The little "i" is called an "Information Button". Pressing this button will bring up a screen similar to the one pictured below:</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUzpyF-eYPm3k32Ge5M0lAmiIZPdJLtMW_k7t1ZLckSTWzkEh2eb8nww0g53DtyDkfDStD6IbkaspusAopI9Zpvh8oqLXdYPVYKJjmC6vsUM0mxpQXH4V9tovjSioGKaMphoHjR-0406w/s1600/IMG_0055.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUzpyF-eYPm3k32Ge5M0lAmiIZPdJLtMW_k7t1ZLckSTWzkEh2eb8nww0g53DtyDkfDStD6IbkaspusAopI9Zpvh8oqLXdYPVYKJjmC6vsUM0mxpQXH4V9tovjSioGKaMphoHjR-0406w/s320/IMG_0055.PNG" width="213" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div>On this screen there are 5 buttons: Email, Copy, SMS, Save, Dismiss.<br />
<br />
<b>Email: </b>This button emails the current password. This is useful for emailing to yourself, generating a password for a friend, or sending a password for a shared account to multiple people.<br />
<br />
<b>Copy: </b>This button copies the current password to the clipboard. You can now paste the password into other applications such as Notes, Safari, or Messages.<br />
<br />
<b>SMS: </b>This button only appears on SMS-Enabled Devices on iOS 4+. It allows you to text message the current password.<br />
<br />
<b>Save: </b>This button only appears once you have created a master passcode (We will do that later), so don't freak out if you don't have it yet. This button allows you to save the password to your device in order to keep it safe and secure.<br />
<br />
<b>Dismiss:</b> This button brings you back to the Password Generating View.<br />
<br />
<br />
Tap Dismiss, and then "Done" in the top left corner. You should now be back at the main screen.<br />
<br />
Now we will take a look at the Stored Passcode View. Press the "unlocked" padlock button. You should now see a screen similar to the picture below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0yGyNtDoY4Nckxj-Rky8-SNw-HaILFp5i6k3YozxrBBVP-Etyq-rjW2YRPsatWYwIU0obbWT6ggOCsFHrue2EqGLL1AqlXhIUOBo3GqVCp8NUI6q1ULmm2Ghi42ylWzQppxzoJBBteDw/s1600/IMG_0054.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0yGyNtDoY4Nckxj-Rky8-SNw-HaILFp5i6k3YozxrBBVP-Etyq-rjW2YRPsatWYwIU0obbWT6ggOCsFHrue2EqGLL1AqlXhIUOBo3GqVCp8NUI6q1ULmm2Ghi42ylWzQppxzoJBBteDw/s320/IMG_0054.PNG" width="213" /></a></div><br />
This screen allows you to set a "Master Passcode". This Passcode allows you to store passwords, usernames, etc. on your device without being easily seen by others.<br />
<br />
At this screen, make a 4 digit password. It will ask you to confirm the password. Remember this password.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkTuuboPfK7PhZY2uVRAO5MgUjamuQjL5seBO5JHlHn-2zRlgbXXohRmwjrLs2-o4eddLgJO-QTBwG30bJjX_Y8n9jYZU3C74DRKNSPcJP4Ia6Thyt6Xm_2p4iF8JgHHVH5gKiCqFqeQQ/s1600/IMG_0058.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkTuuboPfK7PhZY2uVRAO5MgUjamuQjL5seBO5JHlHn-2zRlgbXXohRmwjrLs2-o4eddLgJO-QTBwG30bJjX_Y8n9jYZU3C74DRKNSPcJP4Ia6Thyt6Xm_2p4iF8JgHHVH5gKiCqFqeQQ/s320/IMG_0058.PNG" width="213" /></a></div><br />
This screen has 3 main components: The text boxes, the buttons, and the picker wheel. We will go through all of these.<br />
<br />
<b>Text Boxes:</b> There are three text boxes at the top. The top is the "Slot" or "Source", the middle is the "Username", and the bottom is the "Password". All three text boxes can be edited by tapping on them. When you do so, the keyboard will appear and you can enter information. Pressing "Done" on the keyboard will save your changes.<br />
<ul><li><b>Slot/Source: </b>This box is where you enter what the password is for. Example: Facebook.com, Gmail.com, etc. </li>
</ul><ul><li><b>UserName: </b>This is where you enter the username that goes with the password. </li>
</ul><ul><li><b>Password: </b>This is where you can enter the password for the account. When you save a password from the generate view, this is where it ends up. You can also enter your own password if you do not wish to generate a new one.</li>
</ul><div><br />
</div><div>Now we will go through the buttons, from left to right. </div><div><br />
</div><div><b>Options Button: </b>This button looks like a cog. When you tap this button, you are presented with two options similar to the picture below. </div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTBMKf3ds0oYD-nU2pfAPvoOY3TZjioNQYRHaNXWJut0WdbqplvPo7egxqWL3NbNA0RHcYkRH9PiOKmvle1ZBf6NO-bZIPlAmjEMrKa0jXhgn7LxpHmT1WubMzH53L2jg6fYU6-kPeISA/s1600/IMG_0059.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTBMKf3ds0oYD-nU2pfAPvoOY3TZjioNQYRHaNXWJut0WdbqplvPo7egxqWL3NbNA0RHcYkRH9PiOKmvle1ZBf6NO-bZIPlAmjEMrKa0jXhgn7LxpHmT1WubMzH53L2jg6fYU6-kPeISA/s320/IMG_0059.PNG" width="213" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><ul><li><b>Reset Master Code:</b> This option allows you to set a new master code. </li>
<li><b>Dismiss: </b>This brings you back to the Stored Passcode screen.</li>
</ul><br />
<br />
Press Dismiss.<br />
<br />
The next button is SMS,<br />
<br />
<b>SMS: </b>This button only shows up on SMS-enabled devices with iOS 4+. The button looks like a little message bubble. This button will text message the current source, username, and password.<br />
<br />
The next button is Copy.<br />
<br />
<b>Copy: </b>This button looks like two papers, similar to the copy button on a computer. It copies the current password to the clipboard. You can now paste the password into other applications such as Notes, Safari, or Messages.<br />
<br />
The final button is email.<br />
<br />
<b>Email: </b>The button on the far right is email, and looks like an envelope. The button emails the <meta charset="utf-8"></meta>current source, username, and password. This is useful for emailing to yourself, generating a password for a friend, or sending a password for a shared account to multiple people.<br />
<br />
<br />
Okay now we can move on to the bottom-most component, the picker wheel.<br />
<br />
<b>Picker Wheel: </b>You can scroll this wheel up and down, revealing 15 save slots. The blue-tinted bar across the middle tells you which slot you are currently editing/viewing. This allows you to easily view passwords you have saved on your device.<br />
<br />
Press "Done" in the top left corner. You should now be back at the main screen.<br />
<br />
<br />
That's it guys.<br />
<br />
Version 2.0.0 is on its way with a TON of new features. This tutorial will be updated upon release. If you have any questions/comments/suggestions/complaints/compliments, drop me an email at collateraldamag3@gmail.com.Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-6608900368180587072010-09-13T15:36:00.004-04:002010-10-12T13:18:25.610-04:00App Release: Securis<div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"><b><span class="Apple-style-span" style="color: black;"><span class="Apple-style-span" style="font-size: x-large;"><a href="http://itunes.apple.com/us/app/securis/id392732678?mt=8#">SECURIS</a></span></span></b></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"><b><span class="Apple-style-span" style="color: black;"><br />
</span></b></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8r0v7bvKMZrqJJIY4LLiO221ExXQbcOG8oqQcJlMtisfVjX51kJk_JMxr1CN1EkswDjs2HC_S9KpGzyLlrvhCfec2CxBehjnW9y1kdXi2Sn9zIqoNv_FPJIljd3fOpGIZMsNnMaHLVOQ/s1600/iTunesArt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8r0v7bvKMZrqJJIY4LLiO221ExXQbcOG8oqQcJlMtisfVjX51kJk_JMxr1CN1EkswDjs2HC_S9KpGzyLlrvhCfec2CxBehjnW9y1kdXi2Sn9zIqoNv_FPJIljd3fOpGIZMsNnMaHLVOQ/s320/iTunesArt.png" width="320" /></a></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 18px;"><b><span class="Apple-style-span" style="color: black;"><br />
</span></b></span></div><span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;">Have you ever forgotten a password? Used a password that was too easy to guess? Use the same password for everything?<br />
<br />
These mistakes can lead to the loss of private information and possibly financial insecurity. Don't let that happen to you.<br />
<br />
Securis is a Password Generator and Manager that can create and store passwords, keeping your accounts and personal information safe and sound.<br />
<br />
It not only generates and stores passwords but also:<br />
- Has a master passcode so that others cannot access stored passwords<br />
- Can copy passcodes to be used in other apps (ex. Safari)<br />
- Can email codes to yourself or others<br />
- Saves not only the password, but can also save username and source information<br />
- Passcodes can be from 6 - 26 characters, using letters. numbers, and symbols.<br />
- Beatutiful seamless interface which makes working with securis easy and fun.<br />
<br />
**COMING SOON**<br />
-*Saved Password Revamp*<br />
-Small Graphical and UI Changes<br />
-Performance Enhancements</span><br />
<span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span><br />
<div style="text-align: center;"><span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><span class="Apple-style-span" style="color: black; font-family: Times; font-size: medium; line-height: normal;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQjU1ceBlybKfYj7a8x8Urdm3nKnQWdtx_0w9o5Id3ZeE29fYZEcSHFQq_XY9-KoksBB8mwGSqZU_wOzY5eT9-zyuzZUfFx69dKw_nHyTGzi6Z54sQnYM84IwNhQjH83WDDMU0-VpMypg/s1600/IMG_0026.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQjU1ceBlybKfYj7a8x8Urdm3nKnQWdtx_0w9o5Id3ZeE29fYZEcSHFQq_XY9-KoksBB8mwGSqZU_wOzY5eT9-zyuzZUfFx69dKw_nHyTGzi6Z54sQnYM84IwNhQjH83WDDMU0-VpMypg/s320/IMG_0026.PNG" style="cursor: move;" width="213" /></a></span></span></div><span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL2zi0BoqOST4MIyW8eI4bJiOt082ujkrxWRtCSaKu1SUvDAie_ztxqneKQObB_RA5ULlNzklwEzHIFv34c5ZGKj2E2SidDBpYQgM9szHjmptwhbpTxwDZx4k_to8h-kj78Ssq1L8MSzc/s1600/IMG_0020.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL2zi0BoqOST4MIyW8eI4bJiOt082ujkrxWRtCSaKu1SUvDAie_ztxqneKQObB_RA5ULlNzklwEzHIFv34c5ZGKj2E2SidDBpYQgM9szHjmptwhbpTxwDZx4k_to8h-kj78Ssq1L8MSzc/s320/IMG_0020.PNG" width="213" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQ8tbvviGUippzwTOD6dLslxlYCDYZ0g51DTev8yIw1qgnR9Mq2eL9d4RPIMEyWCPMfkD1mgtL9ckf8F9qGRN1Yml_1C3TqYDkn9gC402KepxzD9G_B48IQjwBK3MWXAv6oafGsykzVM/s1600/IMG_0022.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQ8tbvviGUippzwTOD6dLslxlYCDYZ0g51DTev8yIw1qgnR9Mq2eL9d4RPIMEyWCPMfkD1mgtL9ckf8F9qGRN1Yml_1C3TqYDkn9gC402KepxzD9G_B48IQjwBK3MWXAv6oafGsykzVM/s320/IMG_0022.PNG" width="213" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdO-w9mxswYRWrULLFNH9CRApYGCaZDXMkr0U2DNwV5h36r5UPVEcfIWodQI31JC3Vojf4WdkEfe4e04cbqJ60snnhM6Skg-czMw68OcNplLl4o1YXbNbIj2RXNVQ1rr6dMY7EUNSdM28/s1600/IMG_0023.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdO-w9mxswYRWrULLFNH9CRApYGCaZDXMkr0U2DNwV5h36r5UPVEcfIWodQI31JC3Vojf4WdkEfe4e04cbqJ60snnhM6Skg-czMw68OcNplLl4o1YXbNbIj2RXNVQ1rr6dMY7EUNSdM28/s320/IMG_0023.PNG" width="213" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK63OcL1I7ViZPH6swpxYtNY56fTNYy8NMLZiZDyabywFpplHjwkUbf9OGgMBuRH4XLZ8IrP0eK9oLdizobuOakVWV2qj8v2z3mC-0WqAiGKKmWT5N0Oso86Z8oumGOT8kDlNWjZWLhXw/s1600/IMG_0024.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK63OcL1I7ViZPH6swpxYtNY56fTNYy8NMLZiZDyabywFpplHjwkUbf9OGgMBuRH4XLZ8IrP0eK9oLdizobuOakVWV2qj8v2z3mC-0WqAiGKKmWT5N0Oso86Z8oumGOT8kDlNWjZWLhXw/s320/IMG_0024.PNG" width="213" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><br />
</div><span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 18px;">http://itunes.apple.com/us/app/securis/id392732678?mt=8#</span></span><br />
<span class="Apple-style-span" style="color: #898989; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 18px;"><br />
</span>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com1tag:blogger.com,1999:blog-1507854602253461232.post-7053779677076127412009-11-19T23:19:00.001-05:002009-11-19T23:20:08.811-05:00iPhone Tutorial ~ UIButtons and Animation<div class="separator" style="clear: both; text-align: center;"><a href="http://thenextweb.com/wp-content/uploads/2009/01/apple_iphone_keyboard1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://thenextweb.com/wp-content/uploads/2009/01/apple_iphone_keyboard1.jpg" /></a><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">So you want to animate your UIButtons but don't know where to start? Well here is a guide that will have your UIButtons jumping around in no time. For this tutorial we will be using the "UIViewAnimationTransitionFlip" Animation. Basically, it flips stuff. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">If you look up most other tutorials on the web, they will say that in order to flip a button, you need 3 things: 2 buttons and a containing view. This is NOT TRUE. I will show you how to flip a single button. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">First, create your button, either in the Interface Builder or programmatically. If you don't know how to do that, go learn and come back. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">So, once you have your button (mine is named "btnMyButton") , make a method that gets called on UIControlEventTouchUpInside. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;"></span></span><br />
</div><span style="color: #333333; font-family: Arial, serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: Arial, serif; font-size: small;"><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">- (<span style="color: #d200a5;">IBAction</span>) btn1_click<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">{<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #480085; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #7e11ad;">UIView</span><span style="color: black;"> </span>beginAnimations<span style="color: black;">:</span><span style="color: #d200a5;">nil</span><span style="color: black;"> </span>context<span style="color: black;">:</span><span style="color: #d200a5;">nil</span><span style="color: black;">];</span><br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #7e11ad;">UIView</span><span style="color: black;"> </span><span style="color: #480085;">setAnimationDuration</span><span style="color: black;">:</span><span style="color: #3900de;">0.5</span><span style="color: black;">]; </span>//Sets the Animation time to .5 Seconds<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span style="white-space: pre;"> </span></span>/*The Below Sets the transition to flip the button from the right. */<br />
</div><div style="color: #480085; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #7e11ad;">UIView</span><span style="color: black;"> </span>setAnimationTransition<span style="color: black;">:</span>UIViewAnimationTransitionFlipFromRight<span style="color: black;"> </span>forView<span style="color: black;">:btnMyButton </span>cache<span style="color: black;">:</span><span style="color: #d200a5;">YES</span><span style="color: black;">];</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #7e11ad;">UIView</span><span style="color: black;"> </span><span style="color: #480085;">commitAnimations</span><span style="color: black;">];</span>//Starts the Animation<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"><span style="white-space: pre;"> </span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">}<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">That's it. Thats all you need to do to animate a button. Quite simple, really. The key that most people miss is that you can use a UIButton for the "forView:" key. Instead of assigning a UIView to this and flipping a button that is on top of the view, we are simply using the UIButton in the "forView:" key and flipping the button itself. </span></span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="font-family: Arial, serif; font-size: small;"><span style="font-size: 12px; line-height: 28px;">~Collateral</span></span><br />
</div></span>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com4tag:blogger.com,1999:blog-1507854602253461232.post-22546981803172603502009-11-14T20:19:00.000-05:002009-11-14T20:19:32.586-05:00iPhone Tutorial ~ NSZombieEnabled and EXC_BAD_ACCESS<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdBRUTVNZDXfr3kGH6iwb83CieKzNmweyK2UaNFXbAX2jNaf4Bm4EJSCZMLI7kTk4G0agD8OvTiOscRvY4pPtxAbduu7d6ssjiL2lDNhtGH22awrNDN-9HeEppX2PRiX3E9In_5QBhVnU/s1600-h/Screen+shot+2009-11-14+at+7.54.27+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdBRUTVNZDXfr3kGH6iwb83CieKzNmweyK2UaNFXbAX2jNaf4Bm4EJSCZMLI7kTk4G0agD8OvTiOscRvY4pPtxAbduu7d6ssjiL2lDNhtGH22awrNDN-9HeEppX2PRiX3E9In_5QBhVnU/s640/Screen+shot+2009-11-14+at+7.54.27+PM.png" /></a><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, serif; font-size: 12px; line-height: 28px;"> EXC_BAD_ACCESS is an error received when a command is given to an deallocated target. Basically, you've released the object that your trying to send commands. The only problem is, the error isn't very descriptive in telling you which object gave you that error, making it tricky to fix. </span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Well there is a feature that a lot of people don't know about called "NSZombieEnabled". This makes it A LOT easier to find and debug Bad-Access errors. How it works is by leaving a dummy or "zombie" of every object you release in memory and then alerts you when you have sent a command to one of the dummies. Here is a picture of "NSZombieEnabled" in action:</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUDEqlTHN-oqJYvgOfjwDiXA3m2BRSGXA1z2JIJY8PwPgwDH9wS-BbOMS7P-QBDmdRfX6Rk_wnYh8vAglUrEIN24BCdpfECU3_IdLbME3NOkKV8KNg2o4mfodLW26bkey4dBCBkcHl8Go/s1600-h/Screen+shot+2009-11-14+at+7.52.53+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUDEqlTHN-oqJYvgOfjwDiXA3m2BRSGXA1z2JIJY8PwPgwDH9wS-BbOMS7P-QBDmdRfX6Rk_wnYh8vAglUrEIN24BCdpfECU3_IdLbME3NOkKV8KNg2o4mfodLW26bkey4dBCBkcHl8Go/s640/Screen+shot+2009-11-14+at+7.52.53+PM.png" /></a><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">It shows the exact same scenario as the top picture, except with "NSZombieEnabled" enabled. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">So how do we set this up? Its actually VERY simple. First right-click on your executable, and click "Get Info"</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/z7Y" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/z7Y" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Then go to the "Arguments" tab and click on the bottommost plus sign (environmental variables). Then fill in the information as follows (REMEMBER TO CLICK THE CHECKBOX):</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><a href="http://grab.by/z8e" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/z8e" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Then build and debug your program. It should now tell you the deallocated object that you sent a command to.</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><b>Just remember to uncheck the box when your ready to release. </b></span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">~Collateral</span></span><br />
</div>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-73912624815006639732009-11-13T17:07:00.000-05:002009-11-13T17:07:53.734-05:00iPhone Tutorial ~ Reachability and Checking Network Status<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMfx9vkDn8ORcjTWTPZxwKt83-p1la-EUNz5jFxEt_1kILno5XMzvv2EjMRFD3vsq51JFsItIeEbx78fvuEFptLcKNQ4yJ2uu1ZwXuu6vWRYzJQpiJUnGKNlywrEHO7ovIa-pfFjHWzdk/s1600-h/wifi-music-store-header.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMfx9vkDn8ORcjTWTPZxwKt83-p1la-EUNz5jFxEt_1kILno5XMzvv2EjMRFD3vsq51JFsItIeEbx78fvuEFptLcKNQ4yJ2uu1ZwXuu6vWRYzJQpiJUnGKNlywrEHO7ovIa-pfFjHWzdk/s640/wifi-music-store-header.png" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">This is a tutorial on the Reachability class and checking your network status. Apple's Human Interface Guidelines for the App Store require any application that uses a network connection to check to see if that connection is active and if not, display an alert telling the user. Well, i spent a good 2 days trying to figure this one out, and hopefully with this tutorial, you'll be able to do it in 10 minutes. </span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">The first thing that is tricky about this is that the Reachability class that is used for this ISN'T EVEN INCLUDED IN THE SDK! WTF APPLE?!? The Class is actually found in one of Apple's sample code applications with the same name. I have downloaded that sample and extracted the Reachability class from it for you to download, here:</span></span><br />
</div><div style="text-align: center;"><span style="font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><b><a href="http://www.megaupload.com/?d=PDVRWBOW">DOWNLOAD</a> - REACHABILITY CLASS</b></span></span></div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">You can download Apple's original sample code application in its entirety from <a href="http://beta.devworld.apple.com/iphone/library/samplecode/Reachability/index.html">HERE</a>.</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Unzip the Reachability class and add the Reachability.h/m to your Xcode project. This class also requires use of the SystemConfiguration Framework. So right-click on the "Frameworks" folder, go to "Add" and then "Existing Frameworks". </span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><a href="http://grab.by/xO4" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="167" src="http://grab.by/xO4" width="400" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Then click on "SystemConfiguration.framework". </span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Alright, You have now successfully added the Reachability class to your project. Now how do we utilize it?</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Well what we are going to do is check for network connectivity, and if there is none, alert the user. If there is, we will use NSLog to log in the console how the user is connected. </span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">First, declare a method: <span class="Apple-style-span" style="color: black; font-family: Menlo; font-size: 11px; line-height: normal;">- (<span style="color: #d200a5;">void</span>)networkCheck; </span>in your .h file.</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Then, move to your .m file and fill in the method:</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: left;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"></span></span><br />
</div><span style="color: #333333; font-family: Arial, serif; font-size: small;"><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">-(<span style="color: #d200a5;">void</span>)networkCheck{<br />
</div><div style="color: #1b5a5e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #368288;">Reachability</span><span style="color: black;"> *curReach = [[</span><span style="color: #368288;">Reachability</span><span style="color: black;"> </span>reachabilityForInternetConnection<span style="color: black;">] </span><span style="color: #480085;">retain</span><span style="color: black;">];</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #368288;">NetworkStatus</span> netStatus = [curReach <span style="color: #1b5a5e;">currentReachabilityStatus</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #d200a5;">switch</span> (netStatus)<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
</div><div style="color: #1b5a5e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #d200a5;">case</span><span style="color: black;"> </span>NotReachable<span style="color: black;">:</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #7e11ad;">UIAlertView</span> *connectionAlert = [[<span style="color: #7e11ad;">UIAlertView</span> <span style="color: #480085;">alloc</span>] <span style="color: #480085;">init</span>]; <br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">setTitle</span>:<span style="color: #e90000;">@"Error"</span>];<br />
</div><div style="color: #e90000; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert </span><span style="color: #480085;">setMessage</span><span style="color: black;">:</span>@"myApp was not able to reach the host. Please check your network conenction."<span style="color: black;">]; </span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">setDelegate</span>:<span style="color: #d200a5;">self</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">setTag</span>:<span style="color: #3900de;">1</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">addButtonWithTitle</span>:<span style="color: #e90000;">@"Back"</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">show</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>[connectionAlert <span style="color: #480085;">release</span>];<br />
</div><div style="color: #e90000; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: black;">(</span>@"NETWORKCHECK: Not Connected"<span style="color: black;">);</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #d200a5;">break</span>;<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
</div><div style="color: #1b5a5e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #d200a5;">case</span><span style="color: black;"> </span>ReachableViaWWAN<span style="color: black;">:</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
</div><div style="color: #e90000; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: black;">(</span>@"NETWORKCHECK: Connected Via WWAN"<span style="color: black;">);</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #d200a5;">break</span>;<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
</div><div style="color: #1b5a5e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #d200a5;">case</span><span style="color: black;"> </span>ReachableViaWiFi<span style="color: black;">:</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
</div><div style="color: #e90000; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span style="color: black;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: #480085;">NSLog</span><span style="color: black;">(</span>@"NETWORKCHECK: Connected Via WiFi"<span style="color: black;">);</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #d200a5;">break</span>;<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">}<br />
</div></span><br />
<div class="separator" style="clear: both; text-align: center;"><span style="font-family: Menlo, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 11px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">First we are declaring *curReach as our current network connectivity. We are then assigning that to a NetworkStatus object (Thanks to your Reachability Class) and preforming a switch-case on it. If it is "Not Reachable", we alert the user. If it connects, we log to the console by which method the connection is being preformed. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">Thats it :) That should get you set for compliance with Apple's HIG's. See ya next time.</span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: Arial, serif; font-size: small;"><span class="Apple-style-span" style="font-size: 12px; line-height: 28px;">~Collateral</span></span><br />
</div>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-58056926838373890702009-11-12T18:19:00.001-05:002009-11-12T18:20:08.799-05:00iPhone Tutorial ~ UISwitch Colors<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfd8S0ZF-TBMTjKAIF5zkNswrh9V4cEDZCd0L-iRE_wDbR600k0kpSDog2IJ6TP5VSUqL6RPev405bedmnfLu8dnU0HKQChRj5YKHTdPhtWAGI79S23bWbu_IdyCXmkftsDt_DDSK4X5U/s1600-h/iPhoneAirplaneWiFi.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfd8S0ZF-TBMTjKAIF5zkNswrh9V4cEDZCd0L-iRE_wDbR600k0kpSDog2IJ6TP5VSUqL6RPev405bedmnfLu8dnU0HKQChRj5YKHTdPhtWAGI79S23bWbu_IdyCXmkftsDt_DDSK4X5U/s640/iPhoneAirplaneWiFi.jpg" /></a><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><a href="http://www.skylarcantu.com/blog/2009/10/14/alternate-uiswitch-colors/">I got this tip from Skylar Cantu, http://www.skylarcantu.com</a>. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Alternate UISwitch Color. If you've ever used an iPhone, you've definitely seen the orange "AirPlane Mode" switch, designed to say "Hey, I'm here, switch me!". Well here's a tutorial about how to do it yourself. But be careful, <b>this uses undocumented API's and Apple can/will reject your app for doing this. </b></span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><b><br />
</b></span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">But as for it being so naughty and getting your app rejected, its actually VERY simple and requires only one line of code:</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"></span></span><br />
</div><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">UISwitch *mySwitch = [[<span style="color: #7e11ad;">UISwitch</span> <span style="color: #480085;">alloc</span>] <span style="color: #480085;">initWithFrame</span>:<span style="color: #480085;">CGRectMake</span>(<span style="color: #3900de;">50</span>, <span style="color: #3900de;">100</span>, <span style="color: #3900de;">0</span>, <span style="color: #3900de;">0</span>)];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">[mySwitch setAlternateColors:<span style="color: #d200a5;">YES</span>]; <span style="color: #008d00;">// OrangeColor</span><br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">/* Do Stuff Here. */<br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">[<span style="color: #333333;"><span style="color: #d200a5;">self</span>.<span style="color: #7e11ad;">view</span> <span style="color: #480085;">addSubview</span>:mySwitch];</span><br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">[mySwitch <span style="color: #480085;">release</span>];<br />
</div><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="line-height: 16px;">Thats it. It's THAT simple. Thanks again to Skylar for showing me this tip.</span></span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="line-height: 16px;"><br />
</span></span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="line-height: 16px;">~Collateral</span></span><br />
</div></span>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-18942364004248873342009-11-12T14:09:00.002-05:002009-11-12T14:13:49.260-05:00Android Tutorial ~ Installing the Android SDK<div class="separator" style="clear: both; text-align: center;"><a href="http://paxmodept.com/files/android_sdk3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="http://paxmodept.com/files/android_sdk3.png" width="320" /></a><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">With the release of Verizon & Motorola's "Droid" phone series, I decided to get ready to start developing on the Android SDK. So here is a tutorial to get you started on installing Eclipse (JAVA IDE) and the Android SDK on your Windows, Linux or Mac system. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">First, what is Android? Android is Google's Open-Source mobile phone operating system. Android is based off of the linux kernel and is made to be an alternative to the iPhone OS or Windows Mobile. Android applications are developed in the JAVA programming language, allowing programs to be used on multiple different hardware configurations. This was a smart move on Google's part as JAVA is the #1 most used programming language according to<a href="http://www.developer.com/lang/article.php/3390001/Programming-Language-Popularity-The-TCP-Index-for-August-2004.htm"> developer.com</a>. Objective-C (used for iPhone development) is not even on the list. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">To install the Android SDK, you are first going to need Eclipse. Eclipse is a free and open-source IDE used for development in JAVA, C, C++, PHP, and other languages. You can install Eclipse from their website, <a href="http://www.eclipse.org/">http://www.eclipse.org/</a>. Make sure to install the "Classic" version, which is at the bottom of their "Downloads" page. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Next you need to download the Android SDK from here : <a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>. Unzip it and put it somewhere you will remember it. I unzipped it to /Users/Collateral/Android SDK/. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Now Open Eclipse and go to "Help" and then "Install new Software".</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnubr77epskHyohiB5wfZvEHA-UlzFBxsDfrTsbUSh45CaLFYFskLigEOEoRtrQeeUEFDtyiIa7CYEbF3u_VvFip4kfALs9_RyhbIAyciE0nu_xWld0hu963e1A5Qcd_BEcgcuZczSIrw/s1600-h/Screen+shot+2009-11-12+at+1.46.00+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnubr77epskHyohiB5wfZvEHA-UlzFBxsDfrTsbUSh45CaLFYFskLigEOEoRtrQeeUEFDtyiIa7CYEbF3u_VvFip4kfALs9_RyhbIAyciE0nu_xWld0hu963e1A5Qcd_BEcgcuZczSIrw/s320/Screen+shot+2009-11-12+at+1.46.00+PM.png" /></a><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">You will see a button titled "Add", click that. Under "Name", name it whatever you want, under "Location" add: "<span style="color: black; line-height: normal;"><span style="font-family: inherit;"><span style="font-size: x-small;"> </span></span><span style="font-family: 'Trebuchet MS', sans-serif;"><span style="font-size: small;">https://dl-ssl.google.com/android/eclipse/ </span></span><span style="font-family: inherit;"><span style="font-size: x-small;"><span style="font-family: 'Trebuchet MS', sans-serif;"> ". It will download some stuff. Once you are back on the "Install New Software" menu, click on the "Work With:" drop down and click on the location you just added.</span> </span></span></span></span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpoTWF_RR54uYcTQUbvpTkbD0l5Zskv9QS_S2ZIpEoyvr1l00ABTkiPQ_oNGvN9UCVUsqxOvJtWqn45k9D_P41WurikStaophXMap6GnaOskQKJtA7pbQ9luc-w5cnXEpx43sErQp1GHc/s1600-h/Screen+shot+2009-11-12+at+1.53.00+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpoTWF_RR54uYcTQUbvpTkbD0l5Zskv9QS_S2ZIpEoyvr1l00ABTkiPQ_oNGvN9UCVUsqxOvJtWqn45k9D_P41WurikStaophXMap6GnaOskQKJtA7pbQ9luc-w5cnXEpx43sErQp1GHc/s640/Screen+shot+2009-11-12+at+1.53.00+PM.png" /></a><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Check "Developer Tools" and Install them. Restart Eclipse. Go to "Preferences" and click "Android" on the right hand side. Where it says "SDK Location" browse to the location where you unzipped the SDK that we downloaded.</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Once you have done that, click "Finish" and then click the <img src="http://grab.by/vtO" />button. </span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/vu0" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="371" src="http://grab.by/vu0" width="640" /></a><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Click "Available Packages" and then check the android one. Click "Install Selected". Agree to All and wait for all of it to download and install. Restart Eclipse.</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Congratulations, you now have the Android SDK installed! But we still need to set up an emulation product.</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">So press the <img src="http://grab.by/vtO" /> button again, and then click on "Virtual Devices". Click "New" and add a new device with these settings :</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/vuW" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://grab.by/vuW" width="310" /></a><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Click "Create AVD". Then Select your new device and click "Start". You should see this:</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="text-align: center;"><a href="http://grab.by/vvh" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="445" src="http://grab.by/vvh" width="640" /></a><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/vvI" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="450" src="http://grab.by/vvI" width="640" /></a><br />
</div><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
<span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: small;"><br />
</span></span><br />
<span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: small;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Congrats! You now have the Android SDK and a working Android Emulator!</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">Go ahead and start developing! :)</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;"><br />
</span></span><br />
</div><div style="text-align: left;"><span style="font-family: 'Lucida Grande', Arial, sans-serif;"><span style="font-size: x-small;">~Collateral</span></span><br />
</div>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-35476855405475075822009-11-11T19:14:00.006-05:002009-11-12T12:07:13.319-05:00iPhone Tutorial ~ NSUserDefaults and Settings.bundle - Part II<div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF3jenfzUYL0VxZeHQwgZw-vI9Bs-Hx9C2gcF3vGC0oKajTNYQEkKLBMGf9R5uceiW4LfAXexG15VLh5qvD628cToQl2d8TD-k2YXymwm3HNij2rHFnTKOxz8bGT-xX3HDFpAgZrU5oTU/s1600-h/FinalApp.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF3jenfzUYL0VxZeHQwgZw-vI9Bs-Hx9C2gcF3vGC0oKajTNYQEkKLBMGf9R5uceiW4LfAXexG15VLh5qvD628cToQl2d8TD-k2YXymwm3HNij2rHFnTKOxz8bGT-xX3HDFpAgZrU5oTU/s640/FinalApp.jpg" /></a><br />
</div><div style="text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Ok, now that we have learned the basics of <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a>, we can now start to make a <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Settings Bundle</a>. What is a <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Settings Bundle</a> you may ask? A <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">settings bundle</a> is the application preferences that you see in the Settings.app. These are loaded automatically when you enter Settings.app and allow you to change the <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a> from outside the application itself; a very helpful feature.</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">To make a Settings Bundle we have to start off by making a folder named "Settings". Inside of that, make a new file in TextEdit and make it plain text. </span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><a href="http://grab.by/tFC" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="http://grab.by/tFC" width="320" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Then fill your plain-text document like this:</span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: left;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span></span></span><br />
</div><pre class="xml"><span style="font-family: 'Courier New', Courier, monospace;"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
Root.plist
Preference settings for MyApp
-->
<plist version="1.0">
<dict>
</dict>
</plist></span></pre><pre class="xml"></pre><pre class="xml" style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Once you are done, save it as "Root.plist". Now rename your "Settings" folder to "Settings.bundle". The settings folder should become a lego-block-like icon and the Root.plist should not be visible. Now, Open Xcode and open your project. Click "Project" and then "Add to Project".</span></span></pre><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/tGH" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/tGH" /></a><br />
</div><pre class="xml" style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre></span><br />
<div style="text-align: center;"><span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span><br />
</div><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Then choose your Settings.bundle. Click the arrow next to it in Xcode and you should see your Root.plist again. If you can, good, move on. If not, check to make sure everything is spelled correctly. "Settings.bundle" and "Root.plist" are CASE SENSITIVE.</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Now as an example, we will add a username to the preferences. So open up Root.plist in the Property List Editor (Right Click and Select "Open with Finder"). You should see a key labeled "Root", click on it and then click "Add Child." Make the new child's key "Title", make its type "String", and make its value the name of your application. Now click on Root again. Make another child, this time with a key named "PreferenceSpecifiers". Make its type "Array".</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Now click on "PreferenceSpecifiers" and then on "Add Child" (You should now be adding a child to PreferenceSpecifiers, not to Root). This items key, by default, should be "Item 0". Make its type "Dictionary".</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Almost done. Now add 4 children to "Item 0" and make them match what I have below:</span></span></pre><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/tJN" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="245" src="http://grab.by/tJN" width="640" /></a><br />
</div><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">The "Title" key for Item 0 is the title that the user will see when he/she edits this in Settings.app. The "Type" key tells Settings.app that it is a PSTextFieldSpecifier, which is basically a UITextField. The "Key" key tells the program which key we are loading from in our code. NOTE: THIS IS OUR VARIABLE NAME FOR INSIDE THE CODE. <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">See Here.</a> And the default value is pretty self-explainatory. It is the value that is loaded if none is entered.</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px; white-space: normal;">Now save Root.plist. C<span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; line-height: normal;">ompile and run your app in the simulator. Exit the app and enter Settings.app. Check to see if there is an entry for your app at the bottom. If there is, then you have done it correctly.</span></span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">For this example, the code to load the username we stored into a NSString would be:</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;"><span style="color: black; font-family: 'Lucida Grande', Arial, sans-serif; line-height: 28px;">
<div style="color: #7e11ad; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">NSUserDefaults<span style="color: black;"> *prefs = [</span>NSUserDefaults<span style="color: black;"> </span><span style="color: #480085;">standardUserDefaults</span><span style="color: black;">];</span>
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: #7e11ad;">NSString</span> *strUserName = [prefs <span style="color: #480085;">stringForKey</span>:<span style="color: #e90000;">@"userName"</span>];
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"></div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"></span>
<span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;"><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">Here are the other types for storing NSUserDefaults into your <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Settings.bundle</a>:</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;"><span style="color: #666666; font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; font-size: 12px; line-height: 19px;">
<ol><li style="text-align: left;">PSTextFieldSpecifier</li>
<li style="text-align: left;">PSTitleValueSpecifier</li>
<li style="text-align: left;">PSToggleSwitchSpecifier</li>
<li style="text-align: left;">PSSliderSpecifier</li>
<li style="text-align: left;">PSMultiValueSpecifier</li>
<li style="text-align: left;">PSGroupSpecifier</li>
<li style="text-align: left;">PSChildPaneSpecifier</li>
</ol></span></span></span>
</pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">Congratulations! You now have a working Settings Bundle and you can store and load information from NSUserDefaults!</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;"><a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">Go Back to Part I</a></span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">
</span></span></pre><pre class="xml" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: #333233; font-family: 'Lucida Grande', Helvetica, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: normal; white-space: normal;">~Collateral</span></span></pre></span>
</div></span></span></span>
</pre>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-64479251411087352502009-11-11T15:27:00.004-05:002009-11-11T19:22:46.412-05:00iPhone Tutorial ~ NSUserDefaults and Settings.bundle - Part I<div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/t6h" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/t6h" /></a><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">Alright, This is a tutorial on the <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a> feature and how to use them in conjunction with <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Settings.bundle</a>.</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">First off, What is <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a>? If you want the "Apple Definition" you can find it <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html">HERE.</a> But basically, NSUserDefaults is a way to store data for a another point in time. You can use <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a> to save a character's level, or what items he/she's carrying. Or You can use it to remember a username and password or whether the user prefers a light or dark GUI. Basically, it saves stuff. </span></span><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">So how do I use NSUserDefaults? Well, Apple has made it VERY easy actually. There are two ways to access data in NSUserDefaults, saving data and loading data. We'll start with saving.</span></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"><br />
</span></span><br />
</div><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">NSUserDefaults *prefs = [<span style="color: #7e11ad;">NSUserDefaults</span> <span style="color: #480085;">standardUserDefaults</span>];<br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;">[prefs </span>setInteger<span style="color: black;">: </span><span style="color: #3900de;">0</span><span style="color: black;"> </span>forKey<span style="color: black;">: </span><span style="color: #e90000;">@"whatever"</span><span style="color: black;">];</span><span style="color: #008d00;">//Save</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;">[prefs </span>synchronize<span style="color: black;">];</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><br />
</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: black;"> </span><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"><span style="line-height: 16px;">That ^^ is a very simple example of saving data to <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a>. I'm starting off by labeling <span style="font-family: Menlo, Arial, sans-serif; line-height: normal;">[<span style="color: #7e11ad;">NSUserDefaults</span> <span style="color: #480085;">standardUserDefaults</span>]</span><span style="line-height: normal;"><span style="font-family: inherit;"> as just simply "prefs", mostly because prefs is about 20x easier to write. I am then saving "0" as an integer to the key "whatever". Now, you may be asking, what is a key? A key is basically a save slot. whenever you have an option you have a slot. For example, if you have a game where you have to save the character's inventory, you will probably store an array of the character's objects into a key named "inventory". Basically a key is a spot in the <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a> where certain info is stored. And <span style="color: #480085; font-family: Menlo, Arial, sans-serif;"><span style="color: black;">[prefs </span>synchronize<span style="color: black;">]<span style="font-family: Verdana, sans-serif;"> just writes it to the disk.</span></span></span></span></span></span></span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"><br />
</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;">Here are the different syntaxes you can use when saving to NSUserDefaults (of course all linked to their reference :p):</span><br />
</div><span style="color: black;"></span><br />
<span style="color: black;"></span><br />
<span style="color: black;"></span><br />
<span style="color: black;"><ul class="tooltip" style="list-style-image: initial; list-style-position: outside; list-style-type: none; margin-bottom: 0px; margin-left: 30px; margin-right: 0px; margin-top: 0px; padding-bottom: 12px; padding-left: 6px; padding-right: 0px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setBool:forKey:" style="color: #3366cc; text-decoration: none;">– setBool:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setFloat:forKey:" style="color: #3366cc; text-decoration: none;">– setFloat:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setInteger:forKey:" style="color: #3366cc; text-decoration: none;">– setInteger:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setObject:forKey:" style="color: #3366cc; text-decoration: none;">– setObject:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setDouble:forKey:" style="color: #3366cc; text-decoration: none;">– setDouble:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/setURL:forKey:" style="color: #3366cc; text-decoration: none;">– setURL:forKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><span style="font-family: Monaco, Courier, Consolas, monospace; font-size: small;"><span style="font-size: 11px;"><br />
</span></span></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><span style="font-size: small;"><span style="font-size: 11px;">Now after looking over the class references, saving to<a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html"> NSUserDefault</a><a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">s</a> should be cake. Now for loading. Its basically the same concept, just in the reverse. Instead of saving the information located at a key, you are retrieving it.</span></span></li>
</ul><div><span style="font-size: small;"><span style="font-size: 11px;"></span></span><br />
<span style="font-size: small;"><span style="font-size: 11px;"></span></span><br />
<span style="font-size: small;"><span style="font-size: 11px;"><div style="color: #7e11ad; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">NSUserDefaults<span style="color: black;"> *prefs = [</span>NSUserDefaults<span style="color: black;"> </span><span style="color: #480085;">standardUserDefaults</span><span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: #7e11ad;">NSString</span> *strUserName = [prefs <span style="color: #480085;">stringForKey</span>:<span style="color: #e90000;">@"userName"</span>];<br />
<br />
</div></span></span><br />
</div></span><br />
<br />
<div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;">Here I am loading a String from the key "userName" and storing it into a NSString titled "strUserName". Easy Peasy. Here are the syntax's and references for what you can use while loading data. Be careful it IS different from the first list.</span><br />
</div><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif;"><ul class="tooltip" style="list-style-image: initial; list-style-position: outside; list-style-type: none; margin-bottom: 0px; margin-left: 30px; margin-right: 0px; margin-top: 0px; padding-bottom: 12px; padding-left: 6px; padding-right: 0px; padding-top: 0px;"><li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/arrayForKey:" style="color: #3366cc; text-decoration: none;">– arrayForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/boolForKey:" style="color: #3366cc; text-decoration: none;">– boolForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/dataForKey:" style="color: #3366cc; text-decoration: none;">– dataForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/dictionaryForKey:" style="color: #3366cc; text-decoration: none;">– dictionaryForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/floatForKey:" style="color: #3366cc; text-decoration: none;">– floatForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/integerForKey:" style="color: #3366cc; text-decoration: none;">– integerForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/objectForKey:" style="color: #3366cc; text-decoration: none;">– objectForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/stringArrayForKey:" style="color: #3366cc; text-decoration: none;">– stringArrayForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/stringForKey:" style="color: #3366cc; text-decoration: none;">– stringForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/doubleForKey:" style="color: #3366cc; text-decoration: none;">– doubleForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/occ/instm/NSUserDefaults/URLForKey:" style="color: #3366cc; text-decoration: none;">– URLForKey:</a></code></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px;"><span style="font-family: Monaco, Courier, Consolas, monospace; font-size: small;"><span style="font-size: 11px;"><br />
</span></span></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: center;"><span style="font-size: small;"><span style="font-size: 11px;"><span style="font-family: inherit;">Thats it for the basics of <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and.html">NSUserDefaults</a>. Once you are ready to move on to <a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Settings.bundle</a> click below:</span></span></span></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: center;"><span style="font-size: small;"><span style="font-size: 11px;"><a href="http://collateraldamag3.blogspot.com/2009/11/iphone-tutorial-nsuserdefaults-and_11.html">Move forward to Part II</a></span></span></li>
<li style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 2px; text-align: left;"><span style="font-size: small;"><span style="font-size: 11px;">~Collateral</span></span></li>
</ul><div style="text-align: center;"><span style="font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div></span></span><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><br />
</span>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0tag:blogger.com,1999:blog-1507854602253461232.post-9830845094750848092009-11-11T05:48:00.006-05:002009-11-11T09:58:32.631-05:00iPhone Tutorial ~ Inserting UITextFields into UIAlertViews Automatically<div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/shG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://grab.by/shG" width="319" /></a><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;">So I noticed a lot of people are trying to get UITextFields into UIAlertViews by manually generating one and fixing the coordinates, etc. But What a lot of people don't know is that Apple has an easier (non-documented) way that they do this, in apps like iTunes, etc. </span></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span class="Apple-style-span" style="font-size: 11px; line-height: 16px;"><code></code></span><code></code></span><code></code><br />
<code></code></div><code><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><code><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">// First Let's Make a UIAlertView Like Normal..<br />
</div></span><br />
<div style="text-align: center;"><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><span style="font-size: 11px; line-height: 16px;"> </span></span><br />
</div><span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"></span><br />
<span style="color: #333333; font-family: 'Lucida Grande', Arial, sans-serif; font-size: small;"><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">UIAlertView</span> *myAlert = [[<span style="color: #7e11ad;">UIAlertView</span> <span style="color: #480085;">alloc</span>] <span style="color: #480085;">init</span>];<span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">setTitle</span>:<span style="color: #e90000;">@"ALERT TITLE"</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">setMessage</span>:<span style="color: #e90000;">@"HELLO WORLD"</span>];<span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">setDelegate</span>:<span style="color: #d200a5;">self</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">setTag</span>:<span style="color: #3900de;">1</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert addTextFieldWithValue:<span style="color: #e90000;">@""</span> label:<span style="color: #e90000;">@"ADD LABEL HERE"</span>];<br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[myAlert </span>addButtonWithTitle<span style="color: black;">:</span><span style="color: #e90000;">@"OK"</span><span style="color: black;">];</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[myAlert </span>addButtonWithTitle<span style="color: black;">:</span><span style="color: #e90000;">@"Cancel"</span><span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><br />
</div><div style="color: #008d00; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;">// Now Let's Use Apple's Special Way of Adding a UITextField with little to no work<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #368288;">txtInput</span> = [myAlert textFieldAtIndex:<span style="color: #3900de;">0</span>];<br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">txtInput</span><span style="color: black;">.</span><span style="color: #7e11ad;">clearButtonMode</span><span style="color: black;"> = </span>UITextFieldViewModeWhileEditing<span style="color: black;">;</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">txtInput</span><span style="color: black;">.</span><span style="color: #7e11ad;">keyboardType</span><span style="color: black;"> = </span>UIKeyboardTypeDefault<span style="color: black; font-family: Monaco, Courier, Consolas, monospace;"><span style="font-family: Menlo, Arial, sans-serif;">;</span></span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">txtInput</span><span style="color: black;">.</span><span style="color: #7e11ad;">keyboardAppearance</span><span style="color: black;"> = </span>UIKeyboardAppearanceAlert<span style="color: black;">;</span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">txtInput</span><span style="color: black;">.</span><span style="color: #7e11ad;">autocorrectionType</span><span style="color: black;"> = </span>UITextAutocorrectionTypeNo<span style="color: black;">;</span><br />
</div><div style="color: #7e11ad; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #368288;">txtInput</span><span style="color: black;">.</span>secureTextEntry<span style="color: black;"> = </span><span style="color: #d200a5;">NO</span><span style="color: black;">;</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">show</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[myAlert <span style="color: #480085;">release</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"></div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;">Clear Button Mode adds the little "X" while typing to clear the UITextField. Keyboardtype obviously sets the type of keyboard. Here are your options for that:<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"><span style="color: black; font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 12px;"></span><br />
</div><br />
<br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_18" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeDefault</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use the default keyboard for the current input method.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeASCIICapable" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeASCIICapable"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeASCIICapable" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeASCIICapable"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW23" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeASCIICapable"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_23" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_19" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeASCIICapabl</b>e</code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a keyboard that displays standard ASCII characters.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeNumbersAndPunctuation" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumbersAndPunctuation"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeNumbersAndPunctuation" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumbersAndPunctuation"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW24" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumbersAndPunctuation"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_24" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_20" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeNumbersAndPunctuation</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use the numbers and punctuation keyboard.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeURL" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeURL"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeURL" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeURL"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW25" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeURL"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_25" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_21" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeURL</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a keyboard optimized for URL entry. This type features “.”, “/”, and “.com” prominently.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeNumberPad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumberPad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeNumberPad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumberPad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW26" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNumberPad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_26" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_22" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeNumberPad</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a numeric keypad designed for PIN entry. This type features the numbers 0 through 9 prominently. This keyboard type does not support auto-capitalization.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypePhonePad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypePhonePad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW27" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_27" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_23" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypePhonePad</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a keypad designed for entering telephone numbers. This type features the numbers 0 through 9 and the “*” and “#” characters prominently. This keyboard type does not support auto-capitalization.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeNamePhonePad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNamePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeNamePhonePad" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNamePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW28" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeNamePhonePad"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_28" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_24" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeNamePhonePad</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a keypad designed for entering a person’s name or phone number. This keyboard type does not support auto-capitalization.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div></dd><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/c/econst/UIKeyboardTypeEmailAddress" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeEmailAddress"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/c_ref/UIKeyboardTypeEmailAddress" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeEmailAddress"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-SW29" style="color: #3366cc; text-decoration: none;" title="UIKeyboardTypeEmailAddress"></a><a href="http://www.blogger.com/post-edit.g?blogID=1507854602253461232&postID=983084509475084809" name="//apple_ref/doc/uid/TP40006896-CH3-DontLinkElementID_29" style="color: #3366cc; text-decoration: none;"></a><br />
<dt style="clear: both; margin-top: 0px; text-align: left;"><code class="jump constantName" id="jumpTo_25" style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;"><b>UIKeyboardTypeEmailAddress</b></code></dt><br />
<dd style="margin-bottom: 6px; margin-left: 15px; margin-top: 1px;"><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Use a keyboard optimized for specifying email addresses. This type features the “@”, “.” and space characters prominently.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Available in iPhone OS 2.0 and later.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">Declared in <code style="font-family: Monaco, Courier, Consolas, monospace; font-size: 11px;">UITextInputTraits.h</code>.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;"><br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: center;">and Finally, secureTextEntry allows you to change the characters to dots if you are entering a password.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: center;"><br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: center;">And of course, you can add more than one UITextField to a UIAlertView, so this should please all of your username/password needs.<br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: center;"><br />
</div><div style="font: normal normal normal 12px/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 6px; margin-top: -1px; text-align: left;">~Collateral<br />
</div></dd><br />
</span><br />
</code>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com1tag:blogger.com,1999:blog-1507854602253461232.post-37975474083786891522009-11-10T18:33:00.029-05:002009-11-11T10:00:35.235-05:00iPhone Tutorial ~ In-App Email<div class="separator" style="clear: both; text-align: center;"><a href="http://artoftheiphone.com/wp-content/uploads/2009/07/iphone-mail-app-attaching-mulitple-photos.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://artoftheiphone.com/wp-content/uploads/2009/07/iphone-mail-app-attaching-mulitple-photos.jpg" width="277" /></a><br />
</div><div style="text-align: center;"><br />
</div><blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><span style="font-family: Times;"><span style="font-size: medium;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">Ok, so here is a tutorial for getting the Mail.app modal view in your application for OS 3.0+ and to launch Mail.app from your application if your on 2.X.X.</span></span></span></span></span></span><br />
</blockquote><div style="text-align: center;"><i>*Heads up: Clicking on the images will zoom them ;) </i><br />
</div><blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">99% of the time, this is going to be run as an event, or a response to user input (pressing a UIButton, responding to a UIAlertView, etc.), so right off the bat, you know its going to be a<span style="background-color: white;"> <span style="color: magenta;">-(IBAction</span></span><span style="background-color: white;"><span style="color: magenta;">) </span>or<span style="color: magenta;"> - (void)</span></span>.<span style="font-family: Times; font-size: medium;"> </span></span></span><br />
</blockquote><blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">First, however, we are going to want to import the mail framework, titled "MessageUI.framework". So right click on the "Frameworks" folder, then click "Add" then "Existing Frameworks" then "MessageUI.framework". Now you should see this: </span></span><br />
</blockquote><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/rmD" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/rmD" /></a><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: 11px;">Then you are going to want to add this to your import statements: </span><br />
</div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/rsb" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/rsb" /></a><br />
</div><span style="color: #e90000; font-family: Menlo; font-size: small;"><span style="font-size: 11px;"><span style="color: black; font-family: 'Lucida Grande';"><br />
</span></span></span><br />
</div><div style="text-align: center;"><span style="color: #e90000; font-family: Menlo; font-size: small;"><span style="font-size: 11px;"><span style="color: black; font-family: 'Lucida Grande';">This will allow you to access those oh-so-special frameworks you just added. We now just have to add the methods to call the Mail.app modal view. So add these to your .h file under your </span><span style="font-family: 'Lucida Grande';"><span style="color: magenta;">@propert</span></span><span style="font-family: 'Lucida Grande';"><span style="color: magenta;">y</span></span><span style="color: black; font-family: 'Lucida Grande';"> calls.</span></span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"></span></span><br />
</div><span style="font-family: 'Lucida Grande'; font-size: small;"><div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"><div style="text-align: center;"><span style="font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px; white-space: pre;">- <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>displayComposerSheet;<br />
- <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>showPicker;<br />
- <span style="color: #002200;">(</span><span style="color: #a61390;">void</span><span style="color: #002200;">)</span>launchMailAppOnDevice;<br />
- <span style="color: #002200;">(</span><span style="color: #a61390;">IBAction</span><span style="color: #002200;">)</span>callMail;</span><br />
</div></div></span><br />
<blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-family: Times;"> <span style="font-family: 'Lucida Grande'; font-size: 11px;">This is the call for the methods that we are going to define in your .m file. Speaking of which, turn to your .m file now, and I will break down what is necessary to call to make this puppy work.<span style="font-family: Times; font-size: medium;"> </span></span></span></span><br />
</blockquote><blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-family: Times;"><span style="font-family: 'Lucida Grande'; font-size: 11px;">First, we need an <span style="color: magenta;">-(IBAction</span><span style="color: magenta;">)</span> to call our method. This is what <i>callMail { }</i> is for. So make a UIButton and assign <i>callMail { }</i> to it. If don't know how to do this, then the easiest way in in the Interface Builder. In the IB, click on "File's Owner" and then on the "Connections" tab in the inspector. You should see "Received Actions" and under that, "callMail". Click on the "+" sign next to callMail, and drag it to your UIButton. It will give you a drop-down menu. Choose "Touch Up Inside." As shown: </span></span></span><br />
</blockquote><div class="separator" style="clear: both; text-align: center;"><a href="http://grab.by/roL" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://grab.by/roL" /></a><br />
</div><div style="text-align: center;"><br />
</div><blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><span style="font-family: Times;"><span style="font-size: medium;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><span style="font-family: Times; font-size: medium;"><span style="font-family: 'Lucida Grande'; font-size: 11px;">Save your .XIB and go back to your .m file. Type: </span></span></span></span></span></span></span></span><br />
</blockquote><div class="separator" style="clear: both; text-align: center;"><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="font-size: 13px; white-space: pre;"><span style="color: black; font-family: Times;"><span style="font-size: medium; white-space: normal;"></span></span></span></span><br />
</div><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="color: black; font-family: Times;"></span></span><br />
<span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="color: black; font-family: Times;"><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">- (<span style="color: #d200a5;">IBAction</span>) callMail{<br />
</div><div style="color: #1b5a5e; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>showPicker<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">}<br />
</div></span></span><br />
<div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"></span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><div style="text-align: left;"><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="font-size: 13px; white-space: pre;"> </span></span><br />
</div></span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: 11px;">Ok, now your <span style="background-color: white;"><span style="color: magenta;">- (IBAction)</span></span> is done. Wasn't that easy? Now here comes the method definitions. Just type them in exactly as i write them:</span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"></span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">-(<span style="color: #d200a5;">void</span>)showPicker<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">{<span style="white-space: pre;"> </span><br />
</div><div style="color: #e90000; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #7e11ad;">Class</span><span style="color: black;"> mailClass = (</span><span style="color: #480085;">NSClassFromString</span><span style="color: black;">(</span>@"MFMailComposeViewController"<span style="color: black;">));</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #d200a5;">if</span> (mailClass != <span style="color: #d200a5;">nil</span>)<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>{<br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>// We must always check whether the current device is configured for sending emails<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #d200a5;">if</span> ([mailClass <span style="color: #480085;">canSendMail</span>])<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>{<br />
</div><div style="color: #1b5a5e; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>displayComposerSheet<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>}<br />
</div><div style="color: #d200a5; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>else<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>{<br />
</div><div style="color: #1b5a5e; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>launchMailAppOnDevice<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>}<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>}<br />
</div><div style="color: #d200a5; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>else<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>{<br />
</div><div style="color: #1b5a5e; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>launchMailAppOnDevice<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>}<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">}<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><br />
</div></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">This is the method we just called. This method checks if the device can bring up the modal view. If it can, it calls the method to do so. If it can't, it tells the divice to open Mail.app. Now we need to call the modal view itself:</span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div><div class="separator" style="clear: both; text-align: center;"><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="font-size: 13px; white-space: pre;"><span style="color: black; font-family: Times;"><span style="font-size: medium; white-space: normal;"></span></span></span></span><br />
</div><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="color: black; font-family: Times;"></span></span><br />
<span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="color: black; font-family: Times;"><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">// Displays an email composition interface inside the application. Populates all the Mail fields.<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">-(<span style="color: #d200a5;">void</span>)displayComposerSheet<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">{<br />
</div><div style="color: #7e11ad; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>MFMailComposeViewController<span style="color: black;"> *picker = [[</span>MFMailComposeViewController<span style="color: black;"> </span><span style="color: #480085;">alloc</span><span style="color: black;">] </span><span style="color: #480085;">init</span><span style="color: black;">];</span><br />
</div><div style="color: #7e11ad; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>picker.</span>mailComposeDelegate<span style="color: black;"> = </span><span style="color: #d200a5;">self</span><span style="color: black;">;</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #e90000; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[picker </span><span style="color: #480085;">setSubject</span><span style="color: black;">:</span>@"SUBJECT HERE"<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>// Set up recipients<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSArray</span> *toRecipients = [<span style="color: #7e11ad;">NSArray</span> <span style="color: #480085;">arrayWithObject</span>:<span style="color: #e90000;">@"bob@john.com"</span>];<br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>//NSArray *ccRecipients = [NSArray arrayWithObjects:@"", nil];<br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>//NSArray *bccRecipients = [NSArray arrayWithObject:@""];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[picker <span style="color: #480085;">setToRecipients</span>:toRecipients];<br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>//[picker setCcRecipients:ccRecipients];<span style="white-space: pre;"> </span><br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>//[picker setBccRecipients:bccRecipients];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span>// Fill out the email body text<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSString</span> *emailBody = (<span style="color: #e90000;">@"BODY TEXT HERE"</span>);<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span>[picker <span style="color: #480085;">setMessageBody</span>:emailBody <span style="color: #480085;">isHTML</span>:<span style="color: #d200a5;">NO</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>presentModalViewController<span style="color: black;">:picker </span>animated<span style="color: black;">:</span><span style="color: #d200a5;">YES</span><span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"> [picker <span style="color: #480085;">release</span>];<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">}<br />
</div></span></span><br />
<div style="text-align: center;"><span style="color: #002200; font-family: monospace, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: small;"><span style="font-size: 13px; white-space: pre;"> </span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">The above will call the mail composition GUI as a modal view inside your application. From here, you can set the subject, recipients, cc's, bcc's and the body text. (This, of course, ends up being totally editable by the end user, however). </span></span><br />
</div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><br />
</div><br />
<div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">// Dismisses the email composition interface when users tap Cancel or Send.<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">- (<span style="color: #d200a5;">void</span>)mailComposeController:(<span style="color: #7e11ad;">MFMailComposeViewController</span>*)controller didFinishWithResult:(<span style="color: #480085;">MFMailComposeResult</span>)result error:(<span style="color: #7e11ad;">NSError</span>*)error<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">{<span style="white-space: pre;"> </span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[</span><span style="color: #d200a5;">self</span><span style="color: black;"> </span>dismissModalViewControllerAnimated<span style="color: black;">:</span><span style="color: #d200a5;">YES</span><span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">}<br />
</div><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">This, as the comment says, dismissed the composition view when the user sends or cancels the email. </span></span><br />
</div><div style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;">And finally we must type the method to allow the 2.X.X users to call their Mail.app. </span></span><br />
<span style="font-family: 'Lucida Grande'; font-size: small;"><span style="font-size: 11px;"><br />
</span></span><br />
</div><div style="text-align: center;"><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">// Launches the Mail application on the device.<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">-(<span style="color: #d200a5;">void</span>)launchMailAppOnDevice<br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;">{<br />
</div><div style="color: #008d00; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSString</span> *recipients = <span style="color: #e90000;">@"bob@john.com"</span>;</span><br />
</div><div style="color: #e90000; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span></span><span style="color: #7e11ad;">NSString</span><span style="color: black;"> *body = (</span>@"BODY TEXT HERE"<span style="color: black;">);</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="white-space: pre;"> </span><span style="color: #7e11ad;">NSString</span> *email = [<span style="color: #7e11ad;">NSString</span> <span style="color: #480085;">stringWithFormat</span>:<span style="color: #e90000;">@"%@%@"</span>,recipients,body];<br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>email = [email </span>stringByAddingPercentEscapesUsingEncoding<span style="color: black;">:</span>NSUTF8StringEncoding<span style="color: black;">];</span><br />
</div><div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-align: left;"><span style="white-space: pre;"> </span><br />
</div><div style="color: #480085; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left;"><span style="color: black;"><span style="white-space: pre;"> </span>[[</span><span style="color: #7e11ad;">UIApplication</span><span style="color: black;"> </span>sharedApplication<span style="color: black;">] </span>openURL<span style="color: black;">:[</span><span style="color: #7e11ad;">NSURL</span><span style="color: black;"> </span>URLWithString<span style="color: black;">:email]];</span><br />
</div><div style="text-align: left;"><span style="font-family: Menlo; font-size: 11px;">}</span><br />
</div><div style="text-align: center;"><span style="font-size: large;"><span style="font-family: 'Lucida Grande'; font-size: 11px;">And there you have it. When you click your UIButton, In-app mail should now work :)</span></span><br />
</div></div><br />
<br />
~Collateral<br />
<blockquote style="text-align: center;"><span style="font-family: 'Lucida Grande'; font-size: 11px;">Code based on Apple's examples. **</span><br />
</blockquote><br />
<blockquote style="text-align: center;"><br />
</blockquote>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com1tag:blogger.com,1999:blog-1507854602253461232.post-42466444885586553712009-11-10T15:05:00.000-05:002009-11-10T15:05:14.134-05:00Hello World!<div class="separator" style="clear: both; text-align: center;"><a href="http://farm1.static.flickr.com/194/472097903_b781a0f4f8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://farm1.static.flickr.com/194/472097903_b781a0f4f8.jpg" width="320" /></a><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;">Hello everybody. This is my new blog. I will type here about.. well pretty much anything. So yea. Welcome.<br />
</div><div style="text-align: center;"><br />
</div><div style="text-align: center;">Ps. Be sure to click on the ads to give me free money :p<br />
</div><div style="text-align: center;"><br />
</div>Collateralhttp://www.blogger.com/profile/05812618453010863222noreply@blogger.com0