<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.visuaweb.com/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>VisuaBlog</title>
  <link>http://blog.visuaweb.com/index.php/</link>
  <description></description>
  <language>fr</language>
  <pubDate>Mon, 10 Nov 2008 13:23:59 +0100</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>iDial 1.0 : l'alternative vintage au dialer de l'iphone</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/03/02/iDial-10-%3A-lalternative-vintage-au-dialer-de-liphone</link>
    <guid isPermaLink="false">urn:md5:b7a2b41a78af2da47cdcd503ecbeab95</guid>
    <pubDate>Sun, 02 Mar 2008 21:33:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iDial</category>
        <category>Développement iPhone</category><category>iDial</category><category>Multi touch</category><category>VisuaMobile</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://blog.visuaweb.com/public/iDial/iDial.png&quot; alt=&quot;iDial.png&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; /&gt;
VisuaMobile, ma nouvelle société, a le plaisir de vous présenter iDial&amp;nbsp;!
Ce n'est rien d'autre qu'une démo qui pourra peut-être faire sourire ceux qui ont connu les téléphones à cadrans rotatifs.
L'idée est de plus d'utiliser les capacités du multi-touch des iMachines.&lt;/p&gt;


&lt;p&gt;Pour l'installer, veuillez utiliser le repository rep.visuaweb.com&lt;/p&gt;


&lt;p&gt;Voilà, vos retours sont les bienvenus.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/03/02/iDial-10-%3A-lalternative-vintage-au-dialer-de-liphone#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/03/02/iDial-10-%3A-lalternative-vintage-au-dialer-de-liphone#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/20</wfw:commentRss>
      </item>
    
  <item>
    <title>Nouvelles chaînes (be, de) dans iGuideTV</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/31/Nouvelles-chaines-be-de-dans-iGuideTV</link>
    <guid isPermaLink="false">urn:md5:426ab9dfe275ef2d3c4aa8df1d351a03</guid>
    <pubDate>Thu, 31 Jan 2008 08:06:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
            
    <description>    &lt;p&gt;J'ai le plaisir de vous annoncer que la mise à jour de ce matin intègre de nouvelles chaînes.&lt;/p&gt;


&lt;p&gt;rtbf2, swf, tsr2, tsi, drs, becine2, becine1, plugtv, rtbf, tsr, zdf, tvei, rtltvi, rtpi, ard, betv, clubrtl, vrt1, rtltelevision, ketnet&lt;/p&gt;


&lt;p&gt;voilà, a priori tout se charge automatiquement, nouvelles images notamment :)&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/31/Nouvelles-chaines-be-de-dans-iGuideTV#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/31/Nouvelles-chaines-be-de-dans-iGuideTV#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/19</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV 1.1.3 compatible firmware 1.1.3 :)</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/29/iGuideTV-113-compatible-firmware-113-%3A</link>
    <guid isPermaLink="false">urn:md5:9eeaf74b0f10607116ffa79dbdee018c</guid>
    <pubDate>Tue, 29 Jan 2008 22:43:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>Développement iPhone</category><category>iGuideTV</category>    
    <description>    &lt;p&gt;Vous le savez peut-être, la mise à jour 1.1.3 des firmware des iPods et iPhones suggère quelques changements dans les structures de fichiers afin de palier à l'ENORME problème de sécurité des précédentes versions. Dorénavant, les applications ont un peu moins de superRootPouvoirs, c'est tant mieux&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Toujours est il que les applications comme iGuideTV qui gèrent des fichiers se sont retrouvées... bloquées&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Voici donc une version 1.1.3 ready de iGuideTV.&lt;/p&gt;


&lt;p&gt;Le temps que les repository officiels... ou presque se mettent à jour, cette version reste disponible sur mon repository de test&amp;nbsp;: http://rep.visuaweb.com&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/29/iGuideTV-113-compatible-firmware-113-%3A#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/29/iGuideTV-113-compatible-firmware-113-%3A#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/18</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV : nouvelle version 1.1 disponible :)</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/20/iGuideTV-11-est-dispo</link>
    <guid isPermaLink="false">urn:md5:7881b2d9f212b98bd27d1af1707117f0</guid>
    <pubDate>Sun, 20 Jan 2008 21:20:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>Développement iPhone</category><category>iGuideTV</category>    
    <description>    &lt;p&gt;&lt;a href=&quot;http://blog.visuaweb.com/public/iguidetvfr-releases/screenshots/snap_000132.jpg&quot;&gt;&lt;img src=&quot;http://blog.visuaweb.com/public/iguidetvfr-releases/screenshots/.snap_000132_s.jpg&quot; alt=&quot;iGuideTV 1.1&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; /&gt;&lt;/a&gt;Bonjour à tous,&lt;/p&gt;


&lt;p&gt;Bon, j'ai tardé, traîné et pris mon temps... mais voici la version 1.1 de iGuideTV.&lt;/p&gt;


&lt;p&gt;En attendant que le paquet soit mis à jour sur FrenchiPhone et sur iPhon.fr, vous pouvez installer l'application via Installer.app.
&lt;em&gt;Mon repository est&amp;nbsp;: rep.visuaweb.com&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;(il faut ajouter cette source à Installer.app)&lt;/p&gt;


&lt;p&gt;Sinon pour les nouveautés, il y a donc&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;programmes détaillés&lt;/li&gt;
&lt;li&gt;verificateur de version&lt;/li&gt;
&lt;li&gt;sponsoring en splashscreen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Si vous rencontrez des problèmes, n'hésitez pas à me contacter.
et tous vos retours sont les bienvenus...&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/20/iGuideTV-11-est-dispo#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/20/iGuideTV-11-est-dispo#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/17</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV : Appel à partenariat pour les versions CH, DE, BE et UK</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/07/iGuideTV-%3A-Appel-a-partenariat-pour-les-versions-CH-DE-BE-et-UK</link>
    <guid isPermaLink="false">urn:md5:60971583a5b48e746a5c687b2e581200</guid>
    <pubDate>Mon, 07 Jan 2008 22:54:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
            
    <description>    &lt;p&gt;De nombreux utilisateurs regrettent de n'avoir que les chaînes françaises et aimeraient avoir une version spécifique à leur pays de l'iGuideTV.&lt;/p&gt;


&lt;p&gt;Le iGuideTV en développement est presque près à être personnalisé par Pays. Il manque néanmoins une donnée importante&amp;nbsp;: les programmes TV&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Je recherche activement un ou des partenaires qui pourrait alimenter les applications en programmes TV. Un simple flux XML fera largement l'affaire.&lt;/p&gt;


&lt;p&gt;Voilà voilà, si vous avez des informations qui pourraient aider à avancer sur ce point, n'hésitez pas à nous les communiquer :) &lt;/p&gt;


&lt;p&gt;Merci merci
Jeremie&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/07/iGuideTV-%3A-Appel-a-partenariat-pour-les-versions-CH-DE-BE-et-UK#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/07/iGuideTV-%3A-Appel-a-partenariat-pour-les-versions-CH-DE-BE-et-UK#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/16</wfw:commentRss>
      </item>
    
  <item>
    <title>Preview iGuideTV 1.1 : un volet volant en prime :)</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/06/Preview-iGuideTV-11-%3A-un-volet-volat-en-prime-%3A</link>
    <guid isPermaLink="false">urn:md5:69f02773467b9baed75e184b6af48031</guid>
    <pubDate>Sun, 06 Jan 2008 15:11:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>Développement iPhone</category><category>iGuideTV</category><category>iPhone</category>    
    <description>    &lt;div&gt;
&lt;p&gt;Benjamin nous a concocté une petite video sur la prochaine version... Merci Benjamin.&lt;/p&gt;
&lt;p&gt;Cette version sera disponible dans quelques jours...&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;object width=&quot;420&quot; height=&quot;296&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/x3yvmk&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href=&quot;http://www.dailymotion.com/video/x3yvmk_iguidetv-11_tech&quot;&gt;IGuideTV 1.1&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;envoyé par &lt;a href=&quot;http://www.dailymotion.com/bmerklen&quot;&gt;bmerklen&lt;/a&gt;&lt;/em&gt;&lt;/div&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/06/Preview-iGuideTV-11-%3A-un-volet-volat-en-prime-%3A#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/06/Preview-iGuideTV-11-%3A-un-volet-volat-en-prime-%3A#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/15</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV : 23000 hits et 5100 installations en 24h !</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/02/iGuideTV-%3A-23000-hits-et-5100-installations-en-24h</link>
    <guid isPermaLink="false">urn:md5:180cb858b0777a07a908d84b3bbb1f09</guid>
    <pubDate>Wed, 02 Jan 2008 22:10:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>Développement iPhone</category><category>iGuideTV</category><category>IPhone</category>    
    <description>    &lt;p&gt;Wow !! je n'imaginais pas qu'il y avait autant d'iPhone/iPod débloqués en France :)&lt;/p&gt;
&lt;p&gt;J'ai reçu 23 000 demandes de mise à jour en moins de 24h pour à peu près 5100 iGuideTV installés.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://blog.visuaweb.com/public/Images/5100guidetv.gif&quot; alt=&quot;&quot; style=&quot;margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; display: block; &quot; /&gt;
&lt;/p&gt;
&lt;p&gt;Je tiens à remercier chaleureusement toutes les personnes qui m'ont adressé leurs encouragements, ça fait chaud au coeur ! &lt;/p&gt;
&lt;p&gt;Je remercie égalements toutes celles qui l'ont installé et celles qui ont pris le temps de me communiquer leurs remarques et suggestions d'améliorations dont je peux noter les plus importantes :&lt;/p&gt;
&lt;p&gt;- affichage des résumés des programmes,&lt;br /&gt;
- choix des plages horaires et/ou affichage de l'intégralité des programmes des chaînes et pas uniquement les programmes de la soirée&lt;br /&gt;
- localisation de l'application pour la suisse, la belgique et l'allemagne&lt;br /&gt;
- gestion des fuseaux horaires dans l'affichage des heures.&lt;/p&gt;
&lt;p&gt;Concernant les bugs, je note peu de problèmes (: quel bonheur :) :&lt;br /&gt;
- difficulté à sélectionner les chaînes dans l'écran &quot;Vos chaînes&quot;&lt;br /&gt;
- effacement des prefs utilisateurs après un quittage forcé de l'application (5 sec de pression sur le bouton Home).&lt;/p&gt;
&lt;p&gt;Ensuite, je dois une petite explication quand à la mise à jour des programmes. La collecte et le traitement des programmes TV sont réalisés chaque nuit à 3 heures du matin. Il s'avère que toutes les chaînes n'ont pas encore publié à cette heure les programmes du lendemain (ou du jour en cours puisqu'il est 3 heures), bref. Ceci peut donc produire un affichage incohérent des programmes car certaines chaînes sont à jour et d'autres non, l'information de mise à jour en bas de l'écran étant elle correcte. Tout ça pour dire que je décalle la mise à jour des programme du jour à 7 heure du matin et que ceci devrait offrir un affichage plus stable. J'ai identifé une autre solution avoir un affichage correcte à tout heure, je m'y pencherai dans un second temps.&lt;/p&gt;
&lt;p&gt;Enfin, pour répondre à la principale attente, je prévois pour la semaine prochaine une mise à jour qui intègrera les résumés.&lt;/p&gt;
&lt;p&gt;... et bonne année 2008 :)&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/02/iGuideTV-%3A-23000-hits-et-5100-installations-en-24h#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/02/iGuideTV-%3A-23000-hits-et-5100-installations-en-24h#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/14</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV en vidéo !!!</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-en-video</link>
    <guid isPermaLink="false">urn:md5:fbbaa521f661c6106af29a3de27f5a3d</guid>
    <pubDate>Tue, 01 Jan 2008 19:38:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>Guide TV</category><category>iGuideTV</category><category>iPhone</category>    
    <description>    &lt;h3&gt;Un grand merci à Benjamin Merklen d'avoir fait cette vidéo.&amp;nbsp;&lt;/h3&gt;
&lt;p&gt;ça fait super plaisir :)&lt;/p&gt;

&lt;div&gt;&lt;object width=&quot;420&quot; height=&quot;296&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/x3x2lq&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.dailymotion.com/swf/x3x2lq&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;420&quot; height=&quot;296&quot; allowFullScreen=&quot;true&quot; allowScriptAccess=&quot;always&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;b&gt;&lt;a href=&quot;http://www.dailymotion.com/video/x3x2lq_iguidetv-pour-iphone_news&quot;&gt;iGuideTV pour iPhone&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;envoy&amp;eacute; par &lt;a href=&quot;http://www.dailymotion.com/bmerklen&quot;&gt;bmerklen&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;


&lt;div&gt;Je rappelle que l'appli est disponible dans le repository de frenchiphone.com&lt;/div&gt;
&lt;div&gt;http://rep.frenchiphone.com via Installer.app&lt;/div&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-en-video#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-en-video#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/13</wfw:commentRss>
      </item>
    
  <item>
    <title>iGuideTV 1.0b pour iPhone, version française.</title>
    <link>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-10b-pour-iPhone-version-francaise</link>
    <guid isPermaLink="false">urn:md5:2670794402a87e77ef9a4486552b480c</guid>
    <pubDate>Tue, 01 Jan 2008 15:30:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>iGuideTV</category>
        <category>iGuideTV</category><category>iPhone</category><category>Programmes TV</category>    
    <description>    &lt;img src=&quot;http://blog.visuaweb.com/public/iguidetvfr-releases/screenshots/.snap_151145_s.jpg&quot; align=&quot;left&quot; border=&quot;0&quot; style=&quot;margin-right:10px;&quot; /&gt;
&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;iGuideTV 1.0b pour iPhone, version française.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;J'ai le plaisir de vous présenter la première release de iGuideTV pour iPhone et iPodTouch !&lt;/p&gt;
&lt;p&gt;- Affichage des programmes du soir,&lt;br /&gt;
- Mise à jour automatique à partir d'Internet (les données sont mises à jours tous les matins vers 8h00),&lt;br /&gt;
- Personnalisation des chaînes par l'utilisateur.&lt;/p&gt;
&lt;p&gt;Il s'agit d'une beta car il n'a a ce jour été testé que par peu de personnes. Je remercie notamment Benjamin Merklen.&lt;/p&gt;
&lt;p&gt;Si vous remarquez des bugs ou des dysfonctionnements, n'hésitez pas à me les remonter :)&lt;/p&gt;
&lt;p&gt;Vous pouvez télécharger le programme à installer pour le moment à la main, le temps de terminer la phase Beta.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.visuaweb.com/public/iguidetvfr-releases/iGuideTV.zip&quot; hreflang=&quot;fr&quot;&gt;iGuideTV Version 1.0b&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Il est également dispo dans le &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;Repository de frenchiphone&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;PS : ne pas oublier de faire un &quot;chmod +x /Applications/iGuideTV.app/iGuideTV&quot; pour que le programme se lance.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-10b-pour-iPhone-version-francaise#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2008/01/01/iGuideTV-10b-pour-iPhone-version-francaise#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/12</wfw:commentRss>
      </item>
    
  <item>
    <title>Iphone : VSDownloadManager, gestion des codes des réponses HTTP</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/30/Iphone-%3A-VSDownloadManager-gestion-des-codes-des-reponses-HTTP</link>
    <guid isPermaLink="false">urn:md5:9afc75a623e3fbe22b534064a65cbbd1</guid>
    <pubDate>Sun, 30 Dec 2007 13:10:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>file download</category><category>IPhone</category><category>Iphone Source</category>    
    <description>    &lt;p&gt;NSURLConnection ne permet pas par défaut de gérer les codes retours des requêtes HTTP. Lorsqu'un 404 Not found se présente il faut le gérer à la main.&lt;/p&gt;


&lt;p&gt;Cette &lt;a href=&quot;http://blog.visuaweb.com/public/Files/VSDownloadManager_V1.1.zip&quot;&gt;version 1.1&lt;/a&gt; intègre la gestion des erreurs HTTP.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/30/Iphone-%3A-VSDownloadManager-gestion-des-codes-des-reponses-HTTP#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/30/Iphone-%3A-VSDownloadManager-gestion-des-codes-des-reponses-HTTP#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/11</wfw:commentRss>
      </item>
    
  <item>
    <title>iPhone : Télécharger des fichiers avec NSURLConnection (asynchrone)</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/29/Telecharger-des-fichiers-sous-iPhone</link>
    <guid isPermaLink="false">urn:md5:d12a51459b0a3cdb1cc9f969fc93eec3</guid>
    <pubDate>Sat, 29 Dec 2007 12:34:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>file download</category><category>IPhone</category><category>Iphone Source</category><category>NSURLConnection iPhone</category>    
    <description>    &lt;p&gt;Voici un composant qui permet de télécharger des fichiers de manières asynchrone. L'avantage de cette méthode est, hormis une gestion plus précise des événements de téléchargement, de libérer du temps/machine pour faire autre chose pendant la session de téléchargement. Typiquement, l'ajout d'un progressView à ce composant est assez facile.&lt;/p&gt;
&lt;p&gt;VSDownloadManager utilise NSURLConnection en mode asynchrone (et non NSURLDownload qui n'est pas implémenté sur l'iPhone).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.visuaweb.com/public/Files/VSDownloadManager.zip&quot;&gt;Téléchargement des sources !&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;Exemple d'utilisation de VSDownloadManager&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#import &lt;/span&gt;&quot;VSDownloadManager.h&quot;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;....&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;....&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) downloadManagerDemo {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;VSDownloadManager *downloadManager = [VSDownloadManager getInstance];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;// set the delegate that will receive the &quot;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[downloadManager setDelegate:&lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;// Empty the current queue&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[downloadManager clearItems];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;// Adding an element to download&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;VSDownloadManagerItem *dwlItem = [[VSDownloadManagerItem alloc] initWithURL:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;http://blog.visuaweb.com/public/Images/springboard.jpeg&quot;&lt;/span&gt; AndFile:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;/var/root/springboard.jpeg&quot;&lt;/span&gt; AndText:&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[downloadManager addItem:dwlItem];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[dwlItem release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;// Addning an element to download&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;VSDownloadManagerItem *dwlItem = [[VSDownloadManagerItem alloc] initWithURL:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;http://blog.visuaweb.com/public/Files/snap_joe.jpg&quot;&lt;/span&gt; AndFile:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;/var/root/joe.jpeg&quot;&lt;/span&gt; AndText:&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[downloadManager addItem:dwlItem];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[dwlItem release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;// Start the download session&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[downloadManager start];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) VSDownloadManagerDidFinishedDownloadSession:(VSDownloadManager *) sender {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;NSLog(&lt;/span&gt;@&quot;Download session finiched!&quot;&lt;span style=&quot;color: #000000&quot;&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;} &lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;VSDownloadManager.h&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  VSDownloadManager.h&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  Created by Jeremie Engel on 28/12/07.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  Copyright 2007 VISUAWEB - &lt;a href=&quot;http://blog.visuaweb.com.&quot;&gt;&lt;span style=&quot;color: #0e0eff&quot;&gt;http://blog.visuaweb.com.&lt;/span&gt;&lt;/a&gt; All rights reserved.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#import &lt;/span&gt;&amp;lt;CoreFoundation/CoreFoundation.h&amp;gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#import &lt;/span&gt;&amp;lt;Foundation/Foundation.h&amp;gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;@interface&lt;/span&gt; VSDownloadManagerItem : NSObject {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSString*url;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSString*filename;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSString*text;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) initWithURL:(NSString*) inURL AndFile:(NSString *) inFilename AndText:(NSString *) inText;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString *) url;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString *) filename;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString *) text;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;@interface&lt;/span&gt; VSDownloadManager : NSObject {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSMutableArray*items;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;VSDownloadManagerItem&lt;span style=&quot;color: #000000&quot;&gt; * currentItem;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;delegate;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSURLConnection*urlConnection;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSMutableData*receivedData;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;int&lt;/span&gt;state;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) initialize;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) getInstance;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) allocWithZone:(NSZone *)zone;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) init;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) addItem:(&lt;span style=&quot;color: #3f6e74&quot;&gt;VSDownloadManagerItem&lt;/span&gt; *) inItem ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) clearItems ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) setDelegate:(&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) inDelegate ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) start ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;VSDownloadManager.m&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  VSDownloadManager.m&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  Created by Jeremie Engel on 28/12/07.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//  Copyright 2007 VISUAWEB - &lt;a href=&quot;http://blog.visuaweb.com.&quot;&gt;&lt;span style=&quot;color: #0e0eff&quot;&gt;http://blog.visuaweb.com.&lt;/span&gt;&lt;/a&gt; All rights reserved.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#import &lt;/span&gt;&quot;VSLog.h&quot;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#import &lt;/span&gt;&quot;VSDownloadManager.h&quot;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;@implementation&lt;/span&gt; VSDownloadManagerItem&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) initWithURL:(NSString*) inURL AndFile:(NSString *) inFilename AndText:(NSString *) inText {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; ((&lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;=[&lt;span style=&quot;color: #aa0d91&quot;&gt;super&lt;/span&gt; &lt;span style=&quot;color: #26474b&quot;&gt;init&lt;/span&gt;])) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[inURL retain];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;url = inURL;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[inFilename retain];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;filename = inFilename;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (inText) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[inText retain] ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;text = inText;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;return self&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;return nil&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString*) url { &lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt; url; }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString*) filename { &lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt; filename; }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString*) text { &lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt; text; }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (NSString *) description {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt; url;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;/*****************************************************************************/&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;static&lt;/span&gt; VSDownloadManager  *defaultVSDownloadManager = &lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;@implementation&lt;/span&gt; VSDownloadManager&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) initialize { }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) getInstance {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;    &lt;/span&gt;@synchronized&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;self&lt;span style=&quot;color: #000000&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; (&lt;/span&gt;defaultVSDownloadManager&lt;span style=&quot;color: #000000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;            [[&lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; alloc] &lt;/span&gt;&lt;span style=&quot;color: #26474b&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;]; &lt;/span&gt;// assignment not done here&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;        }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;    }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt;defaultVSDownloadManager&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;)allocWithZone:(NSZone *)zone&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;{&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;    &lt;/span&gt;@synchronized&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;self&lt;span style=&quot;color: #000000&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; (&lt;/span&gt;defaultVSDownloadManager&lt;span style=&quot;color: #000000&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;            &lt;span style=&quot;color: #3f6e74&quot;&gt;defaultVSDownloadManager&lt;/span&gt; = [&lt;span style=&quot;color: #aa0d91&quot;&gt;super&lt;/span&gt; &lt;span style=&quot;color: #26474b&quot;&gt;allocWithZone&lt;/span&gt;:zone];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;defaultVSDownloadManager&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;;  &lt;/span&gt;// assignment and return on first allocation&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;        }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;    }&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;; &lt;/span&gt;//on subsequent allocation attempts return nil&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) init {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;NSLog&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;@&quot;VSDownloadManager initialize&quot;&lt;span style=&quot;color: #000000&quot;&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; ((&lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;=[&lt;span style=&quot;color: #aa0d91&quot;&gt;super&lt;/span&gt; &lt;span style=&quot;color: #26474b&quot;&gt;init&lt;/span&gt;])) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;items = [[NSMutableArray alloc] &lt;span style=&quot;color: #26474b&quot;&gt;init&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;//receivedData = [[NSMutableData data] retain];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;returnself&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) setDelegate:(&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt;) inDelegate {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (delegate) [delegate release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[inDelegate retain];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;delegate = inDelegate;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) addItem:(&lt;span style=&quot;color: #3f6e74&quot;&gt;VSDownloadManagerItem&lt;/span&gt; *) inItem {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (![items containsObject:inItem]) [items addObject:inItem];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) clearItems {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[items removeAllObjects];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) start {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;NSLog&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;@&quot;Starting download&quot;&lt;span style=&quot;color: #000000&quot;&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;int&lt;/span&gt; i;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;for&lt;/span&gt; (i=&lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt;; i&amp;lt;[items &lt;span style=&quot;color: #26474b&quot;&gt;count&lt;/span&gt;]; i++) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;state = &lt;span style=&quot;color: #1c00cf&quot;&gt;1&lt;/span&gt;;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;receivedData = [[NSMutableData alloc] initWithLength: &lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;currentItem = [items objectAtIndex:i];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[currentItem &lt;span style=&quot;color: #26474b&quot;&gt;url&lt;/span&gt;]] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:&lt;span style=&quot;color: #1c00cf&quot;&gt;5&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:&lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;while&lt;/span&gt;(state == &lt;span style=&quot;color: #1c00cf&quot;&gt;1&lt;/span&gt;) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: &lt;span style=&quot;color: #1c00cf&quot;&gt;0.1f&lt;/span&gt;] ];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (delegate &amp;amp;&amp;amp; [delegate respondsToSelector:&lt;span style=&quot;color: #aa0d91&quot;&gt;@selector&lt;/span&gt;(&lt;span style=&quot;color: #26474b&quot;&gt;VSDownloadManagerDidFinishedDownloadSession&lt;/span&gt;:)]) {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[delegate performSelector:&lt;span style=&quot;color: #aa0d91&quot;&gt;@selector&lt;/span&gt;(&lt;span style=&quot;color: #26474b&quot;&gt;VSDownloadManagerDidFinishedDownloadSession&lt;/span&gt;:) withObject: &lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;/************** NSURLConnection Delegates *****************/&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[receivedData setLength:&lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;    [receivedData appendData:data];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)connection:(NSURLConnection *)connection  didFailWithError:(NSError *)error {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;    [receivedData release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[connection release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;state = -&lt;span style=&quot;color: #1c00cf&quot;&gt;1&lt;/span&gt;;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #643820&quot;&gt;NSLog&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;@&quot;Connection failed! Error - %@ %@&quot;&lt;span style=&quot;color: #000000&quot;&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;          [error localizedDescription],&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;          [[error userInfo] objectForKey:NSErrorFailingURLStringKey]);&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)connectionDidFinishLoading:(NSURLConnection *)connection {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; ([currentItem &lt;span style=&quot;color: #26474b&quot;&gt;filename&lt;/span&gt;]) [[NSFileManager defaultManager] createFileAtPath:[currentItem &lt;span style=&quot;color: #26474b&quot;&gt;filename&lt;/span&gt;]  contents:receivedData attributes:&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;] ;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[connection release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;    [receivedData release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;state = &lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt;;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;NSLog&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;(&lt;/span&gt;@&quot;Download finished for %@&quot;&lt;span style=&quot;color: #000000&quot;&gt;, [currentItem &lt;/span&gt;&lt;span style=&quot;color: #26474b&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;]);&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;/***********************************************************/&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;) dealloc {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (receivedData) [receivedData release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; (urlConnection) [urlConnection release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[items release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #26474b&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;super&lt;/span&gt;dealloc&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/29/Telecharger-des-fichiers-sous-iPhone#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/29/Telecharger-des-fichiers-sous-iPhone#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/10</wfw:commentRss>
      </item>
    
  <item>
    <title>Débuggage Iphone : pas facile ! Une solution autour de NSLog.</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/12/Debuggage-Iphone-%3A-pas-facile-Reorienter-NSLog-vers-un-fichier</link>
    <guid isPermaLink="false">urn:md5:2acc1c5af53db5a78f0390e1cf54d853</guid>
    <pubDate>Wed, 12 Dec 2007 18:48:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>Debug</category><category>Iphone Source</category><category>NSLog</category>    
    <description>    &lt;div&gt;En attendant des solution pour tracer et debugger correctement une appli Iphone, voici un moyen simple qui permet de récupérer les résultats des NSLog dans une application lancée par le Springboard : réorienter les NSLog vers un fichier.&lt;br /&gt;&lt;br /&gt;
Une macro remplace le NSLog.&lt;/div&gt;
&lt;div&gt;Les données sont écrites dans /var/root/VSLog.txt&lt;/div&gt;
&lt;div&gt;&lt;a href=&quot;http://blog.visuaweb.com/public/VSLog.zip&quot;&gt;Les sources sont téléchargeables ici&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;/*&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  VSLog.h&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  Created by Jérémie Engel 12/12/2007.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  Copyright 2007 VisuaWeb. All rights reserved.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; */&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#include &lt;/span&gt;&amp;lt;Foundation/Foundation.h&amp;gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #c41a16&quot;&gt;&lt;span style=&quot;color: #643820&quot;&gt;#include &lt;/span&gt;&amp;lt;CoreFoundation/CoreFoundation.h&amp;gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #643820&quot;&gt;#define VSLog(s,...) [VSLog LogToDefaultFile:(s),##__VA_ARGS__]&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #643820&quot;&gt;#define NSLog(s,...) [VSLog LogToDefaultFile:(s),##__VA_ARGS__]&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;@interface&lt;/span&gt; VSLog : &lt;span style=&quot;color: #5c2699&quot;&gt;NSObject&lt;/span&gt; {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #5c2699&quot;&gt;va_list&lt;span style=&quot;color: #000000&quot;&gt; ap;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSFileHandle&lt;/span&gt; *fileOutHandle;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt; *strToWrite, *fileOut;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)LogToDefaultFile: (&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt;*)format, ...;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt;/*&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  VSLog.m&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  Created by Jérémie Engel 12/12/2007.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *  Copyright 2007 VisuaWeb. All rights reserved.&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; *&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #007400&quot;&gt; */&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #643820&quot;&gt;#include &lt;span style=&quot;color: #c41a16&quot;&gt;&quot;VSLog.h&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@implementation&lt;span style=&quot;color: #000000&quot;&gt; VSLog&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;+ (&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)LogToDefaultFile:(&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt;*)format, ...; {&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #5c2699&quot;&gt;va_list&lt;span style=&quot;color: #3f6e74&quot;&gt;ap&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSFileHandle&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; *&lt;/span&gt;fileOutHandle&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; *&lt;/span&gt;strToWrite&lt;span style=&quot;color: #000000&quot;&gt;, *&lt;/span&gt;fileOut&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;va_start(&lt;span style=&quot;color: #3f6e74&quot;&gt;ap&lt;/span&gt;,format);&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;strToWrite&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;=[[[&lt;/span&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt;alloc&lt;span style=&quot;color: #000000&quot;&gt;] &lt;/span&gt;initWithFormat&lt;span style=&quot;color: #000000&quot;&gt;:format &lt;/span&gt;arguments&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;ap&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;] &lt;/span&gt;stringByAppendingString&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;\n&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;va_end(&lt;span style=&quot;color: #3f6e74&quot;&gt;ap&lt;/span&gt;);&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; (![[&lt;/span&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSFileManager&lt;/span&gt;defaultManager&lt;span style=&quot;color: #000000&quot;&gt;] &lt;/span&gt;fileExistsAtPath&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;/var/root/VSLog.txt&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;]) [[&lt;/span&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSFileManager&lt;/span&gt;defaultManager&lt;span style=&quot;color: #000000&quot;&gt;] &lt;/span&gt;createFileAtPath&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;/var/root/VSLog.txt&quot;&lt;/span&gt;contents&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;attributes&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;nil&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOut&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; = [[&lt;/span&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSString&lt;/span&gt;stringWithString&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;/var/root/VSLog.txt&quot;&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;] &lt;/span&gt;stringByExpandingTildeInPath&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOutHandle&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt; = [&lt;/span&gt;&lt;span style=&quot;color: #5c2699&quot;&gt;NSFileHandle&lt;/span&gt;fileHandleForWritingAtPath&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOut&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOutHandle&lt;/span&gt;truncateFileAtOffset&lt;span style=&quot;color: #000000&quot;&gt;:[&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOutHandle&lt;/span&gt;seekToEndOfFile&lt;span style=&quot;color: #000000&quot;&gt;]];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #2e0d6e&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;fileOutHandle&lt;/span&gt;writeData&lt;span style=&quot;color: #000000&quot;&gt;:[&lt;/span&gt;&lt;span style=&quot;color: #3f6e74&quot;&gt;strToWrite&lt;/span&gt;dataUsingEncoding&lt;span style=&quot;color: #000000&quot;&gt;:&lt;/span&gt;NSUTF8StringEncoding&lt;span style=&quot;color: #000000&quot;&gt;]];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;fileOutHandle&lt;span style=&quot;color: #2e0d6e&quot;&gt;closeFile&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;fileOutHandle&lt;span style=&quot;color: #2e0d6e&quot;&gt;release&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;fileOut&lt;span style=&quot;color: #2e0d6e&quot;&gt;release&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #3f6e74&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;[&lt;/span&gt;strToWrite&lt;span style=&quot;color: #2e0d6e&quot;&gt;release&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;];&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;return&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;@end&lt;/p&gt;
&lt;/div&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/12/Debuggage-Iphone-%3A-pas-facile-Reorienter-NSLog-vers-un-fichier#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/12/Debuggage-Iphone-%3A-pas-facile-Reorienter-NSLog-vers-un-fichier#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/9</wfw:commentRss>
      </item>
    
  <item>
    <title>Joe-editor 3.5 pour Iphone</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/12/Joe-editor-pour-Iphone</link>
    <guid isPermaLink="false">urn:md5:37d98a8bb6af693038a90e7e34be9b07</guid>
    <pubDate>Wed, 12 Dec 2007 12:13:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>Iphone joe-editor</category>    
    <description>    &lt;p&gt;Voici une compilation de Joe-Editor 3.5 pour Iphone.&lt;/p&gt;


&lt;p&gt;Pour l'installer et qu'il soit disponible en ligne de commande via un connexion ssh sur votre IPhone ou votre IPod, copiez juste le binaire &quot;joe&quot; dans le répertoire /usr/bin de votre iMachine.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://blog.visuaweb.com/public/Files/joe_editor_iphone-3.5.zip&quot;&gt;Binaire de joe-editor pour IPhone&lt;/a&gt;.
&lt;img src=&quot;http://blog.visuaweb.com/public/Files/snap_joe.jpg&quot; alt=&quot;snap_joe.jpg&quot; style=&quot;display:block; margin:0 auto;&quot; /&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/12/Joe-editor-pour-Iphone#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/12/Joe-editor-pour-Iphone#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/8</wfw:commentRss>
      </item>
    
  <item>
    <title>Iphone Dev : Changer la font d'un UITableCell</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/06/Modify-the-text-Font-of-a-UITableCell</link>
    <guid isPermaLink="false">urn:md5:1d0254ea5532592201c2bfd695190bba</guid>
    <pubDate>Thu, 06 Dec 2007 12:22:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>Iphone Source</category><category>UITable Font</category>    
    <description>    &lt;br /&gt;Vous développez une application IPhone qui utilise un tableau UITable pour afficher du texte et vous souhaitez changer la taille du texte ?&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;Voici une solution simple. Il s'agit d'ajouter à la vue de la cellule un objet UITextLabel dont la font sera modifiable.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Dans l'exemple ci-dessous, la UITable créée contient 2 colonnes et 1 ligne dont la typo est Helvetica de taille 16.&lt;/div&gt;&lt;div&gt;&lt;div&gt;WebFontCache.h est a importer, il fait parti de WebKit.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;-(&lt;span style=&quot;color: #aa0d91&quot;&gt;void&lt;/span&gt;)showTable&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;{&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;UIView *v = [[[UIView alloc] initWithFrame: [window bounds]] autorelease];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;float&lt;/span&gt; th = &lt;span style=&quot;color: #1c00cf&quot;&gt;115&lt;/span&gt;;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;CGSize vs = [v bounds].size;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;table = [[UITable alloc] initWithFrame: CGRectMake(&lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt;,th,vs.width,vs.height-s.height-th)];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[table addTableColumn: [[[UITableColumn alloc] initWithTitle:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;&quot;&lt;/span&gt; identifier:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col1&quot;&lt;/span&gt; width:&lt;span style=&quot;color: #1c00cf&quot;&gt;220&lt;/span&gt;] autorelease]];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[table addTableColumn: [[[UITableColumn alloc] initWithTitle:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;&quot;&lt;/span&gt; identifier:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col2&quot;&lt;/span&gt; width:&lt;span style=&quot;color: #1c00cf&quot;&gt;100&lt;/span&gt;] autorelease]];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[table setDataSource: &lt;span style=&quot;color: #aa0d91&quot;&gt;self&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[v addSubview: table];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[window setContentView: v];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;div&gt;&lt;div&gt;&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (&lt;span style=&quot;color: #aa0d91&quot;&gt;int&lt;/span&gt;)numberOfRowsInTable:(UITable*)table&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;{&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #aa0d91&quot;&gt;return&lt;span style=&quot;color: #000000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(28, 0, 207);&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #000000&quot;&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;div&gt;&lt;div&gt;&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;- (UITableCell*)table:(UITable*)table cellForRow:(&lt;span style=&quot;color: #aa0d91&quot;&gt;int&lt;/span&gt;)row column:(UITableColumn *)column&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;{&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;id&lt;/span&gt; cell = [[[UIImageAndTextTableCell alloc] init] autorelease];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;UITextLabel *textLabel = [UITextLabel alloc];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; ([column identifier] == &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col1&quot;&lt;/span&gt;) [textLabel initWithFrame:CGRectMake(&lt;span style=&quot;color: #1c00cf&quot;&gt;10.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;0.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;210.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;30.0f&lt;/span&gt;)];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt; ([column identifier] == &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col2&quot;&lt;/span&gt;) [textLabel initWithFrame:CGRectMake(&lt;span style=&quot;color: #1c00cf&quot;&gt;0.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;0.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;100.0f&lt;/span&gt;,&lt;span style=&quot;color: #1c00cf&quot;&gt;30.0f&lt;/span&gt;)];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt;( row == &lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt; &amp;amp;&amp;amp; [column identifier] == &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col1&quot;&lt;/span&gt; )  [textLabel setText: &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;text to print Col1&quot;&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;if&lt;/span&gt;( row == &lt;span style=&quot;color: #1c00cf&quot;&gt;0&lt;/span&gt; &amp;amp;&amp;amp; [column identifier] == &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;col2&quot;&lt;/span&gt; ) [textLabel setText: &lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;text to print Col2&quot;&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;// Modify the UITableCell Font with a subview UITextLabel&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[textLabel setFont: [NSClassFromString(&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;WebFontCache&quot;&lt;/span&gt;) createFontWithFamily:&lt;span style=&quot;color: #c41a16&quot;&gt;@&quot;Helvetica&quot;&lt;/span&gt; traits:&lt;span style=&quot;color: #1c00cf&quot;&gt;2&lt;/span&gt; size:&lt;span style=&quot;color: #1c00cf&quot;&gt;16&lt;/span&gt;]];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[textLabel setCentersHorizontally:&lt;span style=&quot;color: #aa0d91&quot;&gt;NO&lt;/span&gt;];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[cell addSubview: textLabel];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;[textLabel release];&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;&lt;span style=&quot;color: #aa0d91&quot;&gt;return&lt;/span&gt; cell;&lt;/p&gt;
&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco&quot;&gt;}&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/06/Modify-the-text-Font-of-a-UITableCell#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/06/Modify-the-text-Font-of-a-UITableCell#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/7</wfw:commentRss>
      </item>
    
  <item>
    <title>Jailbreak d'un IPhone Orange : retrouver le Visual Voice Mail (VVM)</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/04/Jailbreak-dun-IPhone-Orange-%3A-retrouve-le-Visual-Voice-Mail-VVM</link>
    <guid isPermaLink="false">urn:md5:40aa2645a9b61dea1d2f52a3814ec4fb</guid>
    <pubDate>Tue, 04 Dec 2007 10:04:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>IPhone VVM</category>    
    <description>    &lt;p&gt;La manipulation s'avère être des plus simples. Pour retrouver le Visual Voice Mail (VVM) sur un IPhone Orange Jailbreaké, il faut juste réinitialiser les paramètres du IPhone.
- aller dans Réglages
- cliquer sur General puis sur Réinitialiser
- Sélectionner &quot;Réinitialiser tous les réglages&quot;&lt;/p&gt;


&lt;p&gt;Certains paramètres seront alors à resaisir mais les données personnelles (média notamment) sont conservées&amp;nbsp;; seules les infos de paramétrage sont remises à zéro.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/04/Jailbreak-dun-IPhone-Orange-%3A-retrouve-le-Visual-Voice-Mail-VVM#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/04/Jailbreak-dun-IPhone-Orange-%3A-retrouve-le-Visual-Voice-Mail-VVM#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/5</wfw:commentRss>
      </item>
    
  <item>
    <title>Redémarrer SpringBoard pour prendre en compte une nouvelle application dans votre IPhone</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/04/Redemarrer-SpringBoard-pour-prendre-en-compte-une-nouvelle-application-dans-votre-IPhone</link>
    <guid isPermaLink="false">urn:md5:998c53103efdd5535aec08033771fbcc</guid>
    <pubDate>Tue, 04 Dec 2007 09:21:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>IPhone</category><category>SpringBoard</category>    
    <description>    &lt;img src=&quot;http://blog.visuaweb.com/public/Images/springboard.jpeg&quot; alt=&quot;SpringBoard IPhone&quot; style=&quot;float: left; margin: 0 1em 1em 0;&quot; /&gt;&lt;p&gt;Lorsque l'on dépose une application dans de répertoire Applications de l'iPhone, il est nécessaire de rebooter l'IPhone pour que celle-ci soit prise en compte par le SpringBoard. Ceci peut s'avérer rébarbatif dans une phase de développement où cette opération doit être répétée un grand nombre de fois.&lt;/p&gt;
&lt;p&gt;Plusieurs solutions existent pour éviter de redémarrer l'IPhone :&lt;/p&gt;
&lt;p&gt;Utiliser SummerBoard qui propose une option de redémarrage du SpringBoard.&lt;/p&gt;
&lt;p&gt;Installer les &lt;a href=&quot;http://iphone.natetrue.com/EricaUtilities/&quot; hreflang=&quot;fr&quot;&gt;EricaUtilities&lt;/a&gt; pour bénéficier de la commande en ligne restart et redémarrer le SpringBoard en 1 ligne de commande via une connexion ssh  :&lt;br /&gt;
&lt;code&gt;restart /System/Library/CoreServices/SpringBoard.app/SpringBoard &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Une copie est disponible de la version 0.30 &lt;a href=&quot;http://blog.visuaweb.com/public/EricaUtiliites-0.30.tar&quot; hreflang=&quot;fr&quot;&gt;ici&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Personnellement, j'utilise la méthode en ligne de commande associée à un alias zsh, c'est plus rapide quand on a une console ssh ouverte.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/04/Redemarrer-SpringBoard-pour-prendre-en-compte-une-nouvelle-application-dans-votre-IPhone#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/04/Redemarrer-SpringBoard-pour-prendre-en-compte-une-nouvelle-application-dans-votre-IPhone#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/3</wfw:commentRss>
      </item>
    
  <item>
    <title>Configurer le Shell du IPhone</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/04/Configurer-le-Shell-du-IPhone</link>
    <guid isPermaLink="false">urn:md5:87a1221e04cad93fc1bb7aab66e84e8e</guid>
    <pubDate>Tue, 04 Dec 2007 09:19:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>IPhone</category>
        <category>IPhone</category><category>Shell</category>    
    <description>    &lt;p&gt;Vous avez débridé votre IPhone. Vous vous connectez dessus en ssh dès que vous pouvez ?
Alors, forcément vous souhaitez personnaliser votre shell.&lt;/p&gt;
&lt;p&gt;Le shell livré avec votre Iphone est SH (&lt;a href=&quot;http://zsh.sunsite.dk&quot; hreflang=&quot;en&quot;&gt;ZSH&lt;/a&gt;) dont voici le &lt;a href=&quot;http://zsh.sunsite.dk/Guide/zshguide.html&quot; hreflang=&quot;en&quot;&gt;manuel&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Pour configurer le Shell au niveau utilisateur, il s'agit d'éditer un fichier &lt;code&gt;~/.zsh&lt;/code&gt; et d'ajouter la ligne suivante dans /etc/profile :&lt;br /&gt;
&lt;code&gt;[ -r ~/.zsh ] &amp;amp;&amp;amp; . ~/.zsh&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;
le /etc/profile doit donc ressembler à :&lt;br /&gt;
&lt;code&gt;
# System-wide .profile for sh(1)&lt;br /&gt;
&lt;br /&gt;
PATH=&quot;/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&quot;&lt;br /&gt;
export PATH&lt;br /&gt;
&lt;br /&gt;
TERM=&quot;vt102&quot;&lt;br /&gt;
export TERM&lt;br /&gt;
&lt;br /&gt;
if [ &quot;${BASH-no}&quot; != &quot;no&quot; ]; then&lt;br /&gt;
[ -r /etc/bashrc ] &amp;amp;&amp;amp; . /etc/bashrc&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
[ -r ~/.zsh ] &amp;amp;&amp;amp; . ~/.zsh
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Un alias bien pratique pour &lt;a href=&quot;http://blog.visuaweb.com/index.php/post/2007/12/04/Redemarrer-SpringBoard-pour-prendre-en-compte-une-nouvelle-application-dans-votre-IPhone&quot; hreflang=&quot;fr&quot;&gt;redémarrer le SpringBoard&lt;/a&gt; en utilisant EricaUtils (à placer dans &lt;code&gt;~/.zsh&lt;/code&gt;) : &lt;br /&gt;
&lt;code&gt;alias sr='/usr/local/bin/restart \ &lt;br /&gt; /System/Library/CoreServices/SpringBoard.app/SpringBoard&lt;/code&gt;
&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/04/Configurer-le-Shell-du-IPhone#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/04/Configurer-le-Shell-du-IPhone#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/2</wfw:commentRss>
      </item>
    
  <item>
    <title>Gérer sans sfGuard une ouverture de session utilisateur au sein d'une application Web avec Symfony.</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/04/Gerer-sans-sfGuard-une-ouverture-de-session-utilisateur-au-sein-dune-application-Web-avec-Symfony</link>
    <guid isPermaLink="false">urn:md5:e8c6262c4fbf3853e338fe1b8353ef39</guid>
    <pubDate>Tue, 04 Dec 2007 09:18:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>Notes techniques</category>
        <category>symfony sfGuard</category>    
    <description>&lt;p&gt;Voici un tutorial pas à pas pour gérer une ouverture de session utilisateur au sein d'une application Web avec Symfony.
De la création de la table dans la base de données au template HTML, normalement, tout y est pour pouvoir le reproduire sans difficultés.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Créer la table dans la base de données&lt;/li&gt;
&lt;li&gt;Saisir le schema de la base dans le fichier /config/schema.yml&lt;/li&gt;
&lt;li&gt;Paramétrer symfony pour qu'il puisse se connecter à votre base de données&lt;/li&gt;
&lt;li&gt;Construire les classes associées à la table users dans l'arborescence de fichiers de Symfony.&lt;/li&gt;
&lt;li&gt;Créer les modules et les controllers de l'application&lt;/li&gt;
&lt;li&gt;Créer la page HTML qui proposera l'ouverture de session à l'utilisateur.&lt;/li&gt;
&lt;li&gt;Travailler sur le fichier myUser.php&lt;/li&gt;
&lt;li&gt;Configurer le controller&lt;/li&gt;
&lt;li&gt;Ajouter un filtre pour identifier automatiquement l'utilisateur dans une session ouverte&lt;/li&gt;
&lt;/ul&gt;    &lt;p&gt;Dans le cadre de ma découverte de Symfony, je me suis d'abord attaché à développer un système d'authentification des utilisateurs. Grâce à leurs noms d'utilisateur et leur mots de passe, les utilisateurs s'identifient pour accéder à des espaces personnels. Dans cette présentation, je me focalise uniquement sur la procédure d'authentification que je présente en pas à pas.&lt;/p&gt;



&lt;h4&gt;Créer la table dans la base de données qui gérera les utilisateurs.&lt;/h4&gt;


&lt;p&gt;Dans mon cas j'utilise Postgresql mais la même définition de table se fait sans problème avec n'importe quel SGBD.&lt;/p&gt;

&lt;pre&gt; CREATE TABLE &quot;public&quot;.&quot;users&quot; (
 &quot;id&quot; SERIAL, 
 &quot;login&quot; VARCHAR(30) NOT NULL, 
 &quot;password&quot; VARCHAR(20) NOT NULL, 
 CONSTRAINT &quot;user_pkey&quot; PRIMARY KEY(&quot;id&quot;)
 ) WITH OIDS;&lt;/pre&gt;



&lt;h4&gt;Saisir le schema de la base dans le fichier &lt;code&gt;/config/schema.yml&lt;/code&gt;&lt;/h4&gt;

&lt;pre&gt; propel:
   users:
     _attributes: { phpName: User }
     id:
     login:              varchar(30)
     password:           varchar(20)&lt;/pre&gt;


&lt;p&gt;Attention de ne pas mettre de tabulation et de bien utiliser des espaces.&lt;/p&gt;


&lt;h4&gt;Paramétrer symfony pour qu'il puisse se connecter à votre base de données&lt;/h4&gt;


&lt;p&gt;Pour cela saisissez les informations de connexion à votre base de données dans le fichier &lt;code&gt;/config/databases.yml&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt; all:
   propel:
     class:          sfPropelDatabase
     param:
       dsn:          pgsql://login:pass@serveur/votrebase&lt;/pre&gt;


&lt;h4&gt;Construire les classes associées à la table &lt;code&gt;users&lt;/code&gt; dans l'arborescence de fichiers de Symfony.&lt;/h4&gt;

&lt;pre&gt; symfony propel-build-model&lt;/pre&gt;

&lt;p&gt;Vérifiez bien que vous avec l'info &lt;code&gt;BUILD FINISHED&lt;/code&gt; à l'issue de la construction, dans le cas contraire, vérifiez bien la saisie du fichier &lt;code&gt;schema.yml&lt;/code&gt; et recommencez la commande &lt;code&gt;symfony propel-build-model&lt;/code&gt;&lt;/p&gt;


&lt;p&gt;A l'issue de la construction, vous devez avoir les fichiers suivants&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; /lib/model/map
 /lib/model/om
 /lib/model/UserPeer.php -&amp;gt; Gère les collections d'utilisateurs
 /lib/model/User.php -&amp;gt; Classe correspondant à un utilisateur&lt;/pre&gt;


&lt;p&gt;Voilà, à cette étape, Symfony est prêt à recevoir le code pour gérer l'authentification des utilisateurs.&lt;/p&gt;


&lt;h4&gt;Créer les modules et les controllers de l'application&lt;/h4&gt;

&lt;p&gt;Il s'agit là de doter l'application des controllers qui gèreront la fonctionnalité. Dans mon cas, j'ai créé un module &lt;code&gt;main&lt;/code&gt; pour la page par défaut de l'application et un module &lt;code&gt;register&lt;/code&gt; qui se chargera de réceptionner les action d'ouverture et de fermeture de de session.
Dans le répertoire racine de votre projet, il s'agit de saisir les commandes&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; symfony init-module main
 symfony init-module register&lt;/pre&gt;

&lt;p&gt;Sans oublier d'indiquer à Symfony que le controller par déaut est maintenant &lt;code&gt;main&lt;/code&gt;. Ainsi le fichier &lt;code&gt;/apps/frontend/config/routing.yml&lt;/code&gt; doit présenter les informations suivantes&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; homepage:
   url:   /
   param: { module: main, action: index }&lt;/pre&gt;


&lt;h4&gt;Créer la page HTML qui proposera l'ouverture de session à l'utilisateur.&lt;/h4&gt;

&lt;p&gt;Dans cet exemple, le formulaire est directement implémenté dans la page d'accueil du site.
Ainsi le fichier &lt;code&gt;/apps/frontend/modules/main/templates/indexSuccess.php&lt;/code&gt; présente les données suivantes&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; &amp;lt;p align=&quot;center&quot;&amp;gt;
 Utilisateur ID : &amp;lt;?php echo  $this-&amp;gt;getContext()-&amp;gt;getUser()-&amp;gt;getAttribute('user_id'); ?&amp;gt;&amp;lt;br /&amp;gt;
 Utilisateur AUTH : &amp;lt;?php echo ($this-&amp;gt;getContext()-&amp;gt;getUser()-&amp;gt;isAuthenticated())?'oui':'non'; ?&amp;gt;&amp;lt;br /&amp;gt;
 &amp;lt;?php echo form_tag('register/login') ?&amp;gt;
 Username  : &amp;lt;?php echo input_tag('login'); ?&amp;gt;&amp;lt;br /&amp;gt;
 Password  : &amp;lt;?php echo input_tag('password'); ?&amp;gt;&amp;lt;br /&amp;gt;
 &amp;lt;?php echo submit_tag('Login'); ?&amp;gt;
 &amp;lt;/form&amp;gt;
 &amp;lt;a href=&quot;http://blog.visuaweb.com/index.php/post/2007/12/04/&amp;lt;?php echo url_for('register/logout'); ?&amp;gt;&quot;&amp;gt;Logout&amp;lt;/a&amp;gt;
 &amp;lt;/p&amp;gt;&lt;/pre&gt;

&lt;p&gt;On remarque que l'action d'ouverture de session est orienté vers le module &lt;code&gt;register&lt;/code&gt; avec l'action &lt;code&gt;login&lt;/code&gt; et que l'action de fermeture est orientée vers le même module avec l'action &lt;code&gt;logout&lt;/code&gt;.&lt;/p&gt;


&lt;h4&gt;Travailler sur le fichier myUser.php&lt;/h4&gt;

&lt;p&gt;Dans le cadre de Symfony, le fichier &lt;code&gt;/apps/frontend/lib/myUser.php&lt;/code&gt; a une importance toute particulière, il s'agit de la classe qui une fois instanciée et retournée par la méthode &lt;code&gt;$this-&amp;gt;getUser()&lt;/code&gt; d'un controller par exemple. C'est dans cette classe que l'implémentation des méthodes d'ouverture et de fermeture de session va être implémentée.
Ainsi, il s'agit de définir 2 méthodes pour la tentative d'ouverture de session et la fermeture de celle-ci&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; class myUser extends sfBasicSecurityUser
 {
 	public $user = null;
 
 	public function tryLogin($login, $password) {
 		$c = new Criteria(); 
 		$c-&amp;gt;add(UserPeer::LOGIN, $login);
 		$c-&amp;gt;add(UserPeer::PASSWORD, $password);
 		$this-&amp;gt;user = UserPeer::doSelectOne($c);
 		if ($this-&amp;gt;user) {
 			$this-&amp;gt;setAuthenticated(true);
   		$this-&amp;gt;setAttribute('user_id', $this-&amp;gt;user-&amp;gt;getId());	
 			return true;
 		}
 		return false;
 	}
 	
 	public function Logout() {
 		if ($this-&amp;gt;isAuthenticated()) {
 			$this-&amp;gt;getAttributeHolder()-&amp;gt;remove('user_id');
 			$this-&amp;gt;setAuthenticated(0);
 		}
 	}
 	
 }&lt;/pre&gt;


&lt;p&gt;Dans cette classe, un attribut &lt;code&gt;$user&lt;/code&gt; est définit. Cette attribut recevra une instance de la classe &lt;code&gt;User&lt;/code&gt; précédemment créée correponsant aux données de l'utilisateur en base de données.&lt;/p&gt;


&lt;h4&gt;Configurer le controller&lt;/h4&gt;

&lt;p&gt;Il s'agit maintenant de configurer le controller &lt;code&gt;register&lt;/code&gt;. Le fichier /apps/frontend/modules/register/actions/actions.class.php doit présenter le code suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; class registerActions extends sfActions
 {
   /**
    * Executes index action
    *
    */
   public function executeIndex()
   {
     $this-&amp;gt;forward('default', 'module');
   }
 
   public function executeLogin() {
	 $this-&amp;gt;getUser()-&amp;gt;tryLogin($this-&amp;gt;getRequestParameter('login'), $this-&amp;gt;getRequestParameter('password'));  
   	$this-&amp;gt;forward('main', 'index');
 }
 
 	public function executeLogout() {
 		$this-&amp;gt;getUser()-&amp;gt;Logout();
 		$this-&amp;gt;forward('main', 'index');
 	}
 }&lt;/pre&gt;


&lt;p&gt;A ce stade, l'authentification utilisateur fonctionne. Seul le problème de l'initialisation de l'utilisateur au sein d'une session ouverte reste à solutionner. Pour cela plusieurs méthodes existent. J'ai choisis d'utiliser les Filtes de Symphony qui permettent en amont et en aval de l'appel des controllers de réaliser des traitements.&lt;/p&gt;


&lt;h4&gt;Ajouter un filtre pour identifier automatique l'utilisateur dans une session ouverte&lt;/h4&gt;

&lt;p&gt;Il s'agit là de créer un fichier &lt;code&gt;/lib/zGlobalUserAuthFilter.php&lt;/code&gt; qui contient le code suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt; class zGlobalUserAuthFilter extends sfFilter {
 	public function execute($filterChain) {
     // Execute this filter only once
 	  if ($this-&amp;gt;isFirstCall()) {
 	  	$user = $this-&amp;gt;getContext()-&amp;gt;getUser();
 	  	if ($user-&amp;gt;isAuthenticated()) {
 	  		$c = new Criteria();
 				$c-&amp;gt;add(UserPeer::ID, $user-&amp;gt;getAttribute('user_id'));
 				$user-&amp;gt;user = UserPeer::doSelectOne($c);
 
 	  	}
 	  }
     // Execute next filter
     $filterChain-&amp;gt;execute();
   }
 
 }&lt;/pre&gt;


&lt;p&gt;et de déclarer le filtre dans le fichier &lt;code&gt;/apps/frontend/config/filters.yml&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt; rendering: ~
 web_debug: ~
 security:  ~
 
 # generally, you will want to insert your own filters here
 zUserAuth:
   class: zGlobalUserAuthFilter
   
 cache:     ~
 common:    ~
 flash:     ~
 execution: ~&lt;/pre&gt;



&lt;h4&gt;C'est terminé&amp;nbsp;!&lt;/h4&gt;

&lt;p&gt;Vous n'avez plus qu'à attaquer votre serveur web, créer un utilisateur dans votre base de données et de vous identifier dans l'appli web.
Il s'agit du minimum pour pouvoir gérer une ouverture de session utilisateur. A partir de ce cadre, il s'agit d'enrichir le code pour gérer par exemple les problèmes d'ouverture de session (mauvais login/pass) ou encore gérer l'expiration de la session. Mais mon intention était juste de présenter le gabarit fonctionnel.&lt;/p&gt;


&lt;p&gt;Si une méthode plus élégante existe, je suis preneur :)&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/04/Gerer-sans-sfGuard-une-ouverture-de-session-utilisateur-au-sein-dune-application-Web-avec-Symfony#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/04/Gerer-sans-sfGuard-une-ouverture-de-session-utilisateur-au-sein-dune-application-Web-avec-Symfony#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/1</wfw:commentRss>
      </item>
    
  <item>
    <title>Synchroniser des fichiers entre 2 serveurs linux avec RSYNC et SSH</title>
    <link>http://blog.visuaweb.com/index.php/post/2007/12/04/Synchroniser-des-fichiers-entre-2-serveurs-linux-avec-RSYNC-et-SSH</link>
    <guid isPermaLink="false">urn:md5:f81723aa54fc382571e1e9e47ab4cb28</guid>
    <pubDate>Sun, 04 Nov 2007 09:47:00 +0100</pubDate>
    <dc:creator>Jeremie Engel</dc:creator>
        <category>Notes techniques</category>
        <category>Rsync</category><category>ssh</category>    
    <description>Compte tenu que j'avais un peu galéré pour synchroniser des données d'un serveur de dev vers un serveur de prod en utilisant rsync et ssh, voici un petit script bien pratique.    &lt;p&gt;L'idéal et de générer des clés SSH pour ne pas avoir à raisir les mots de passe et ainsi pourquoi mettre en cron la synchro si besoin.
J'avais trouvé une partie du script sur un site dont je ne me souviens pas du nom, donc merci à eux quand même :)&lt;/p&gt;
&lt;code&gt;
#!/bin/sh&lt;br /&gt;
# sync&lt;br /&gt;
DIRECTORY=/var/www/DOSSIER_A_SYNCHRONISER/&lt;br /&gt;
SRC=${DIRECTORY}&lt;br /&gt;
DEST=/var/www/DOSSIER_A_SYNCHRONISER/&lt;br /&gt;
#La source est locale&lt;br /&gt;
SRC_HOST=localhost&lt;br /&gt;
# La destination : le serveur sur lequel on publie les données&lt;br /&gt;
DEST_HOST=www.serveur.com&lt;br /&gt;
# l'utilisateur unix qui se connecte en ssh&lt;br /&gt;
USER=UTILISATEUR&lt;br /&gt;
# Fichiers contenant les listes d'exclusions et d'inclusions&lt;br /&gt;
#EXCLUDES=${DIRECTORY}/synchro/excludes&lt;br /&gt;
#INCLUDES=${DIRECTORY}/synchro/includes&lt;br /&gt;
# Option passee a rsync&lt;br /&gt;
# Optionnellement on peut supprimer les fichiers exclus&lt;br /&gt;
#OPTS=&quot;-anvzSH --delete --delete-excluded&quot;&lt;br /&gt;
OPTS=&quot;-avzSH --delete&quot;&lt;br /&gt;
### Start programme&lt;br /&gt;
[ -f $EXCLUDES ] &amp;amp;&amp;amp; EXCL_OPT=&quot;--exclude-from=$EXCLUDES&quot;&lt;br /&gt;
[ -f $INCLUDES ] &amp;amp;&amp;amp; INCL_OPT=&quot;--include-from=$INCLUDES&quot;&lt;br /&gt;
# Shoot les messages&lt;br /&gt;
# exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
# Kill dernier rsync si encore en cour d'execution&lt;br /&gt;
progname=`basename $0`&lt;br /&gt;
pidfile=/var/run/$progname.pid&lt;br /&gt;
oldpid=`cat $pidfile 2&amp;gt;/dev/null`&lt;br /&gt;
# Si valeur de $oldpid non null, tue le process&lt;br /&gt;
if [ $oldpid ]; then&lt;br /&gt;
test -n $oldpid &amp;amp;&amp;amp; kill $oldpid &amp;amp;&amp;amp; kill -9 $oldfile&lt;br /&gt;
fi&lt;br /&gt;
# Lance le sync&lt;br /&gt;
rsync $OPTS  --exclude-from=$EXCLUDES --include-from=$INCLUDES -e ssh $SRC $USER@$DEST_HOST:$DEST&lt;br /&gt;
# Si on veut attaquer le serveur SSH sur un autre port :&lt;br /&gt;
#rsync $OPTS  --exclude-from=$EXCLUDES --include-from=$INCLUDES -e 'ssh -p 26' $SRC $USER@$DEST_HOST:$DEST&lt;br /&gt;
# Mets a jour le pid dans le fichier&lt;br /&gt;
echo $! &amp;gt;$pidfile&lt;br /&gt;
&lt;/code&gt;</description>
    
    
    
          <comments>http://blog.visuaweb.com/index.php/post/2007/12/04/Synchroniser-des-fichiers-entre-2-serveurs-linux-avec-RSYNC-et-SSH#comment-form</comments>
      <wfw:comment>http://blog.visuaweb.com/index.php/post/2007/12/04/Synchroniser-des-fichiers-entre-2-serveurs-linux-avec-RSYNC-et-SSH#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.visuaweb.com/index.php/feed/rss2/comments/4</wfw:commentRss>
      </item>
    
</channel>
</rss>