<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ZenBrains &#187; ipod</title>
	<atom:link href="http://www.zenbrains.com/blog/tag/ipod/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zenbrains.com/blog</link>
	<description>IPhone Development Team</description>
	<lastBuildDate>Tue, 17 May 2011 21:06:43 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Sonido en botones</title>
		<link>http://www.zenbrains.com/blog/2010/05/sonido-en-botones/</link>
		<comments>http://www.zenbrains.com/blog/2010/05/sonido-en-botones/#comments</comments>
		<pubDate>Sun, 16 May 2010 20:10:54 +0000</pubDate>
		<dc:creator>Marcos</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[sonidos]]></category>

		<guid isPermaLink="false">http://www.zenbrains.com/blog/?p=360</guid>
		<description><![CDATA[Hoy explicaré como conseguir reproducir un sonido cuando se pulsa un botón, de hecho, lo que explicaré se puede usar para muchas más cosas y no sólo para botones, ya que lo que haré será crear un SystemSoundID que se usan, entre otras cosas, para reproducir sonidos cortos (30 segundos o menos). Pero como ejemplo, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F05%2Fsonido-en-botones%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F05%2Fsonido-en-botones%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hoy explicaré como conseguir reproducir un sonido cuando se pulsa un botón, de hecho, lo que explicaré se puede usar para muchas más cosas y no sólo para botones, ya que lo que haré será crear un <strong><em><a href="http://developer.apple.com/iphone/library/documentation/AudioToolbox/Reference/SystemSoundServicesReference/Reference/reference.html">SystemSoundID</a></em></strong> que se usan, entre otras cosas, para reproducir sonidos cortos (30 segundos o menos). Pero como ejemplo, usaré un botón.</p>
<p>Para poder reproducir sonidos necesitaremos añadir el Framework <strong>AudioToolbox</strong> a nuestro proyecto. </p>
<p>Imaginaros que contamos con un <em>UIViewController</em> y la vista que éste controla, añadamos un <em>UIButton</em> a la vista mediante Interface Builder o a base de código, como más os guste. Si aun no hemos añadido el Framework a nuestro proyecto hacedlo ahora, una vez añadido tendremos que importarlo a nuestro controlador.</p>
<p>En el archivo cabecera (.h) de nuestro controlador añadimos una variable de tipo <em>SystemSoundID</em>, y un método que será llamado cuando se pulse el botón.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;UIKit/UIKit.h&gt;</span>
<span style="color: #6e371a;">#import &lt;AudioToolbox/AudioToolbox.h&gt;</span>
&nbsp;
<span style="color: #a61390;">@interface</span> testKeyboardViewController <span style="color: #002200;">:</span> UIViewController &lt;UITextFieldDelegate&gt; <span style="color: #002200;">&#123;</span>
&nbsp;
	SystemSoundID buttonSoundID;
<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>buttonPressed;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>Ahora necesitamos un archivo de audio, con el sonido que queramos, por ejemplo ButtonSound.caf, y en el método viewDidLoad de nuestro controlador añadir las siguientes líneas para crear la referencia a nuestro sonido.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>path <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;ButtonSound&quot;</span> ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;caf&quot;</span><span style="color: #002200;">&#93;</span>;
	AudioServicesCreateSystemSoundID<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>CFURLRef<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> fileURLWithPath<span style="color: #002200;">:</span>path<span style="color: #002200;">&#93;</span>, <span style="color: #002200;">&amp;</span>buttonSoundID<span style="color: #002200;">&#41;</span>;	
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Como veis en el código, necesitamos la ruta a nuestro archivo de audio, si habéis añadido el archivo a vuestro grupo Resources en Xcode, el código anterior debería funcionar. Echad un vistazo a <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/Reference/Reference.html">NSBundle</a> en caso de que no sea así para buscar otro método que os deje encontrar el archivo.</p>
<p>Con eso ya tenemos creada la referencia al sonido, ahora solo falta reproducir éste cuando sea necesario, en este ejemplo, queremos que se reproduzca cuando pulsamos el botón. Para ello tenemos que añadir una línea a la función que llamamos cuando se pulsa el botón.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>buttonPressed <span style="color: #002200;">&#123;</span>	
	AudioServicesPlaySystemSound<span style="color: #002200;">&#40;</span>buttonSoundID<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Con esto ya deberíais oír el sonido cuando pulsáis el botón.</p>
<p>En caso de no necesitar más el sonido en cuestión, podéis usar la siguiente función para eliminar la referencia creada, por ejemplo en el viewDidUnload de nuestro controlador.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidUnload <span style="color: #002200;">&#123;</span>
	AudioServicesDisposeSystemSoundID<span style="color: #002200;">&#40;</span>buttonSoundID<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Espero que esto os sea útil para añdirle a vuestra aplicación todo tipo de sonidos cortos, para darle un poco más de vida.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenbrains.com/blog/2010/05/sonido-en-botones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>¿Cómo encontrar el UUID (o UDID) del iPhone?</title>
		<link>http://www.zenbrains.com/blog/2010/04/%c2%bfcomo-encontrar-el-uuid-o-udid-del-iphone/</link>
		<comments>http://www.zenbrains.com/blog/2010/04/%c2%bfcomo-encontrar-el-uuid-o-udid-del-iphone/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:05:54 +0000</pubDate>
		<dc:creator>Aram Julhakyan</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[udid]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://www.zenbrains.com/blog/?p=182</guid>
		<description><![CDATA[En este artículo vamos a explicar como encontrar el identificador (no confundirlo con el número de serie) del iPhone (iPod y iPad)  también conocido como &#8220;device id&#8221;. Tenemos que seguir los siguientes pasos: Conectar nuestro dispositivo al ordenador (Mac o Windows). Abrir el iTunes. Seleccionar nuestro dispositivo en la lista de dispositivos. . Seleccionar la [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F04%2F%25c2%25bfcomo-encontrar-el-uuid-o-udid-del-iphone%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F04%2F%25c2%25bfcomo-encontrar-el-uuid-o-udid-del-iphone%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>En este artículo vamos a explicar como encontrar el identificador (no confundirlo con el número de serie) del iPhone (iPod y iPad)  también conocido como &#8220;device id&#8221;.</p>
<p>Tenemos que seguir los siguientes pasos:</p>
<ol>
<li>Conectar nuestro dispositivo al ordenador (Mac o Windows).</li>
<li>Abrir el iTunes.</li>
<li>Seleccionar nuestro dispositivo en la lista de dispositivos.<br />
<a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-11.png"><img class="alignnone size-full wp-image-198" title="Imagen-1" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-11.png" alt="" width="192" height="130" /></a><br />
.</li>
<li>Seleccionar la pestaña Resumen y hacer click sobre el texto &#8220;Número de serie&#8221;. Al hacer esto el número de serie cambiará y mostrará el identificador.<br />
<a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-21.png"><img class="alignnone size-full wp-image-199" title="Imagen-2" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-21.png" alt="" width="559" height="276" /></a><br />
Después del click en &#8220;Número de serie&#8221; debería ver el identificador:</p>
<p><a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-3.png"><a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-31.png"><img class="alignnone size-full wp-image-200" title="Imagen-3" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Imagen-31.png" alt="" width="597" height="48" /></a><br />
</a></li>
</ol>
<p>Finalmente, si queremos copiar el identificador vamos al menú: Edición &gt; Copiar (mientras el identificador este visible).</p>
<p>Si estamos en un sitio donde no tenemos acceso a nuestro ordenador pero si tenemos acceso a Internet podemos conectarnos a AppStore y descar una de las aplicaciones especializadas que nos muestran nuestro device id y permiten enviarlo fácilmente. Dos de esas aplicaciones son: <a href="http://itunes.apple.com/us/app/info-udid/id348686512?mt=8">Info  – UDID</a> y <a href="http://itunes.apple.com/us/app/info-udid-sender/id366236549?mt=8">Info  – UDID Sender.</a></p>
<p>Si tiene preguntas no dude en contactar con nosotros.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenbrains.com/blog/2010/04/%c2%bfcomo-encontrar-el-uuid-o-udid-del-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find your iPhone or iPod (and iPad) device id (UDID or UUID)</title>
		<link>http://www.zenbrains.com/blog/2010/04/how-to-find-your-iphone-or-ipod-and-ipad-device-id-udid/</link>
		<comments>http://www.zenbrains.com/blog/2010/04/how-to-find-your-iphone-or-ipod-and-ipad-device-id-udid/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 14:43:09 +0000</pubDate>
		<dc:creator>Aram Julhakyan</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[udid]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://www.zenbrains.com/blog/?p=167</guid>
		<description><![CDATA[In order to find your device id you have to: Connect the device to your computer (Mac or Windows). Open the iTunes. Select your device. . Go to summary tab and click on &#8220;Serial Number&#8221;. You&#8217;ll notice that the &#8220;Serial Number&#8221; changes to &#8220;Identifier&#8221;. After clicking on the &#8220;Serial Number&#8221; we must see something like [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F04%2Fhow-to-find-your-iphone-or-ipod-and-ipad-device-id-udid%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zenbrains.com%2Fblog%2F2010%2F04%2Fhow-to-find-your-iphone-or-ipod-and-ipad-device-id-udid%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In order to find your device id you have to:</p>
<ol>
<li>Connect the device to your computer (Mac or Windows).</li>
<li>Open the iTunes.</li>
<li>Select your device.<br />
<a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-1.png"><img class="alignnone size-full wp-image-170" title="Picture 1" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-1.png" alt="" width="194" height="137" /></a><br />
.</li>
<li>Go to summary tab and click on &#8220;Serial Number&#8221;. You&#8217;ll notice that the &#8220;Serial Number&#8221; changes to &#8220;Identifier&#8221;.<br />
<a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-2.png"><a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-21.png"><img class="alignnone size-full wp-image-202" title="Picture-2" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-21.png" alt="" width="599" height="276" /></a><br />
</a></p>
<p>After clicking on the &#8220;Serial Number&#8221; we must see something like this:<br />
<a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-11.png"><a href="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-111.png"><img class="alignnone size-full wp-image-203" title="Picture-11" src="http://www.zenbrains.com/blog/wp-content/uploads/2010/04/Picture-111.png" alt="" width="589" height="45" /></a><br />
</a></li>
</ol>
<p>Finally if you want to copy the id: click on Edit &gt; Copy (while the Identifier is visible).</p>
<p>If you haven&#8217;t access to your computer but you have Internet connection you can download some free specialized apps (<a href="http://itunes.apple.com/us/app/info-udid/id348686512?mt=8">Info &#8211; UDID</a> or <a href="http://itunes.apple.com/us/app/info-udid-sender/id366236549?mt=8">Info &#8211; UDID Sender</a>) from AppStore which can provide you with your device id information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenbrains.com/blog/2010/04/how-to-find-your-iphone-or-ipod-and-ipad-device-id-udid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

