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

<channel>
	<title>Seaside &#187; I talk code</title>
	<atom:link href="http://blog.blackwhale.at/category/i-talk-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.blackwhale.at</link>
	<description>A weblog by Blackwhale about design, code and random stuff we care about.</description>
	<lastBuildDate>Thu, 15 Jul 2010 07:11:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A infinite/endless paging UIScrollView</title>
		<link>http://blog.blackwhale.at/2010/07/a-infinite-endless-paging-uiscrollview/</link>
		<comments>http://blog.blackwhale.at/2010/07/a-infinite-endless-paging-uiscrollview/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:12:14 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[endless paging]]></category>
		<category><![CDATA[infinite paging]]></category>
		<category><![CDATA[uiscrollview]]></category>
		<category><![CDATA[uiview]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=625</guid>
		<description><![CDATA[Infinity is a very powerful concept, so maybe my post title shouldn&#8217;t include this term. Anyway, I tried to create something similar to a infinite or endless paging scroll view. The idea is very simple: Create a view including a standard scroll view. Provide an interface to load views for each page on demand. Cache [...]]]></description>
			<content:encoded><![CDATA[<p>Infinity is a very powerful concept, so maybe my post title shouldn&#8217;t include this term. Anyway, I tried to create something similar to a infinite or endless paging scroll view.</p>
<p>The idea is very simple:</p>
<ul>
<li> Create a view including a standard scroll view.</li>
<li> Provide an interface to load views for each page on demand.</li>
<li> Cache views for pages (specify the maximum amount of cached pages).</li>
<li> If user scrolls the view load (and cache) the next and previous view.</li>
</ul>
<p>You will find the source code of this component (I named it <code>InfinitePagingView</code>) and a example project at our <a href="http://github.com/anka/bw_examples">github repository</a>.</p>
<p>Using <code>InfinitePagingView</code> is very straightforward. Just implement the <code>InfinitePagingDataSource</code> protocol, create an instance of <code>InfinitePagingView</code> and add it to your current view:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">InfinitePagingView <span style="color: #002200;">*</span>infinitePagingView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>InfinitePagingView alloc<span style="color: #002200;">&#93;</span>
            initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">480</span><span style="color: #002200;">&#41;</span>
            andDataSource<span style="color: #002200;">:</span>self<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>infinitePagingView<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>infinitePagingView release<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>After that <code>-(UIView*) infinitePagingView:(InfinitePagingView*)infinitePagingView viewForPageIndex:(int)index</code> gets called for each page and you can provide your custom view for the requested page.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/07/a-infinite-endless-paging-uiscrollview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent UIToolBar</title>
		<link>http://blog.blackwhale.at/2010/07/transparent-uitoolbar/</link>
		<comments>http://blog.blackwhale.at/2010/07/transparent-uitoolbar/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:19:17 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[translucent]]></category>
		<category><![CDATA[transparent]]></category>
		<category><![CDATA[UIBarStyleBlackOpaque]]></category>
		<category><![CDATA[UINavigationBar]]></category>
		<category><![CDATA[uitoolbar]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=621</guid>
		<description><![CDATA[Sometimes it is really necessary to have a transparent UIToolBar within you iPhone app. Especially if you want to add a UIToolBar to your UINavigationBar you get some problems with overlaying backgrounds (UIBarStyleBlackOpaque did not work for a toolbar on a black opaque navigation bar). A quick and pragmatic solution is to subclass UIToolBar and [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is really necessary to have a transparent <code>UIToolBar</code> within you iPhone app. Especially if you want to add a <code>UIToolBar</code> to your <code>UINavigationBar</code> you get some problems with overlaying backgrounds (<code>UIBarStyleBlackOpaque</code> did not work for a toolbar on a black opaque navigation bar).</p>
<p>A quick and pragmatic solution is to subclass UIToolBar and do some modifications. The following code is everything you need to get a really transparent tool bar:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@interface</span> TransparentToolbar <span style="color: #002200;">:</span> UIToolbar
<span style="color: #a61390;">@end</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> TransparentToolbar
&nbsp;
<span style="color: #11740a; font-style: italic;">// Override draw rect to avoid</span>
<span style="color: #11740a; font-style: italic;">// background coloring</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// do nothing in here</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Set properties to make background</span>
<span style="color: #11740a; font-style: italic;">// translucent.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> applyTranslucentBackground
<span style="color: #002200;">&#123;</span>
	self.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</span>;
	self.opaque <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	self.translucent <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Override init.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init
<span style="color: #002200;">&#123;</span>
	self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>self applyTranslucentBackground<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Override initWithFrame.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> initWithFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span> frame
<span style="color: #002200;">&#123;</span>
	self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>self applyTranslucentBackground<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>To apply a color to the including <code>UIBarButtonItem</code>s you can set the bar style as usual.</p>
<p>That&#8217;s all for today,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/07/transparent-uitoolbar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multiple UIAccelerometer delegates</title>
		<link>http://blog.blackwhale.at/2010/06/multiple-uiaccelerometer-delegates/</link>
		<comments>http://blog.blackwhale.at/2010/06/multiple-uiaccelerometer-delegates/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 21:43:06 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[delegate]]></category>
		<category><![CDATA[observers]]></category>
		<category><![CDATA[UIAcceleration]]></category>
		<category><![CDATA[UIAccelerometer]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=615</guid>
		<description><![CDATA[Sometimes there is a need to listen to the acceleration events of your device and sometimes there is need to listen multiple times to this events. The only trade-off is, that you can set only one delegate to the shared instance of UIAccelerometer. For rare situations, multiple objects or controllers need to listen to acceleration [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes there is a need to listen to the acceleration events of your device and sometimes there is need to listen multiple times to this events. The only trade-off is, that you can set only one delegate to the shared instance of UIAccelerometer.</p>
<p>For rare situations, multiple objects or controllers need to listen to acceleration events in parallel we need to provide a simple wrapper implementation which acts as an acceleration delegate and notifies subscribed observers. Such a wrapper I implemented on my own and you can find it at my <a href="http://github.com/anka/bw_examples/tree/master/MultipleAccelerometer">github repository</a>.</p>
<p>To use it just import <code>Accelerometer.h</code> and use the <code>sharedInstance</code> to add and remove new delegates. The following examples shows you that:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//Create observers which implement UIAccelerometerDelegate protocol</span>
ObserverOne <span style="color: #002200;">*</span>one <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ObserverOne alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
ObserverTwo <span style="color: #002200;">*</span>two <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ObserverTwo alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//Subscribe observers to acceleration events</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>Accelerometer sharedInstance<span style="color: #002200;">&#93;</span> addDelegate<span style="color: #002200;">:</span>one<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>Accelerometer sharedInstance<span style="color: #002200;">&#93;</span> addDelegate<span style="color: #002200;">:</span>two<span style="color: #002200;">&#93;</span>;
&nbsp;
... <span style="color: #11740a; font-style: italic;">// some code goes here</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">//Unsubscribe observer from acceleration events</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>Accelerometer sharedInstance<span style="color: #002200;">&#93;</span> removeDelegate<span style="color: #002200;">:</span>one<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>The drawback of the current implementation is, that you can&#8217;t subscribe to different update intervals. For the moment each observer will be notified at the same interval.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/06/multiple-uiaccelerometer-delegates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show a custom popover view within your iPad App</title>
		<link>http://blog.blackwhale.at/2010/04/show-a-custom-popover-view/</link>
		<comments>http://blog.blackwhale.at/2010/04/show-a-custom-popover-view/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 20:06:17 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone OS 3.2]]></category>
		<category><![CDATA[context menu]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[modal view]]></category>
		<category><![CDATA[popover view]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=487</guid>
		<description><![CDATA[The possibility to show popover views (modal or non modal) is a really cool thing within the new iPhone OS 3.2. It allows you to display important information, request some input from the user or present some kind of navigation structure. Anyway, it depends on your application but it helps to focus the user on [...]]]></description>
			<content:encoded><![CDATA[<p>The possibility to show popover views (modal or non modal) is a really cool thing within the new iPhone OS 3.2. It allows you to display important information, request some input from the user or present some kind of navigation structure. Anyway, it depends on your application but it helps to focus the user on your main content and to avoid too many context (or better: view layout) changes.</p>
<p>Now I am going to give you just a quick example of how we can display a customized popover view within our application. First of all I want to present a simple popover view when a given toolbar button was pressed. The class <code>UIPopoverController</code> offers the functionality to show a popover with any given view controller.</p>
<p>We are also able to limit the popover&#8217;s view size with the new property <code>contentSizeForViewInPopover</code> in all <code>UIViewController</code> classes. If you don&#8217;t customize this property, the popover will be shown in its default width of 320 px and in full screen height.</p>
<p>After initialization of your <code>UIPopoverController</code> instance you can call the method <code>presentPopoverFromBarButtonItem: permittedArrowDirections: animated:</code>. The first parameter is used to locate the control which creates the popover view. The second parameter <code>permittedArrowDirections</code> allows you to restrict the direction of the shown arrow of the popover. To support all orientations and layout changes, <code>UIPopoverArrowDirectionAny</code> is the best way to go.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> toolbarAction<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>sender <span style="color: #002200;">&#123;</span>
   <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>self.popoverController isPopoverVisible<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
   <span style="color: #002200;">&#123;</span>
      <span style="color: #11740a; font-style: italic;">//close the popover view if toolbar button was touched</span>
      <span style="color: #11740a; font-style: italic;">//again and popover is already visible</span>
      <span style="color: #11740a; font-style: italic;">//Thanks to @chrisonhismac</span>
&nbsp;
      <span style="color: #002200;">&#91;</span>self.popoverController dismissPopoverAnimated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
      <span style="color: #a61390;">return</span>;
   <span style="color: #002200;">&#125;</span>
&nbsp;
   <span style="color: #11740a; font-style: italic;">//build our custom popover view</span>
   UIViewController<span style="color: #002200;">*</span> popoverContent <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIViewController alloc<span style="color: #002200;">&#93;</span>
                              init<span style="color: #002200;">&#93;</span>;
   UIView<span style="color: #002200;">*</span> popoverView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIView alloc<span style="color: #002200;">&#93;</span>
                        initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">300</span>, <span style="color: #2400d9;">400</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
   popoverView.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor blueColor<span style="color: #002200;">&#93;</span>;
   popoverContent.view <span style="color: #002200;">=</span> popoverView;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//resize the popover view shown</span>
   <span style="color: #11740a; font-style: italic;">//in the current view to the view's size</span>
   popoverContent.contentSizeForViewInPopover <span style="color: #002200;">=</span>
                              CGSizeMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">300</span>, <span style="color: #2400d9;">400</span><span style="color: #002200;">&#41;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//create a popover controller</span>
   self.popoverController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIPopoverController alloc<span style="color: #002200;">&#93;</span>
               initWithContentViewController<span style="color: #002200;">:</span>popoverContent<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//present the popover view non-modal with a</span>
   <span style="color: #11740a; font-style: italic;">//refrence to the toolbar button which was pressed</span>
   <span style="color: #002200;">&#91;</span>self.popoverController presentPopoverFromBarButtonItem<span style="color: #002200;">:</span>sender
               permittedArrowDirections<span style="color: #002200;">:</span>UIPopoverArrowDirectionUp
               animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//release the popover content</span>
   <span style="color: #002200;">&#91;</span>popoverView release<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>popoverContent release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>In my example application I get the following screen:</p>
<p style="text-align: center;"><a href="http://blog.blackwhale.at/wp-content/uploads/2010/04/toolbar-item-popover.jpg"><img class="aligncenter size-full wp-image-551" title="Toolbar item popover" src="http://blog.blackwhale.at/wp-content/uploads/2010/04/toolbar-item-popover.jpg" alt="" width="400" height="310" /></a></p>
<p>So, while showing popover views from toolbar items is very common, it is also often necessary to show popovers when interacting with other UI controls within your screen. Another example will show a popover view triggered from a standard button within my main content view.</p>
<p>I placed a button called <code>popoverButton</code> which performs the following method when activated. This time we use the method <code>presentPopoverFromRect</code> and use the button&#8217;s frame as source for the direction of the popover&#8217;s arrow. The popover implementation is very sophisticated and places the popover so it fits best at the current screen.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> buttonAction<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>sender <span style="color: #002200;">&#123;</span>
   <span style="color: #11740a; font-style: italic;">//build our custom popover view</span>
   UIViewController<span style="color: #002200;">*</span> popoverContent <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIViewController alloc<span style="color: #002200;">&#93;</span>
                  init<span style="color: #002200;">&#93;</span>;
   UIView<span style="color: #002200;">*</span> popoverView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIView alloc<span style="color: #002200;">&#93;</span>
                  initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">200</span>, <span style="color: #2400d9;">300</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
   popoverView.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor greenColor<span style="color: #002200;">&#93;</span>;
   popoverContent.view <span style="color: #002200;">=</span> popoverView;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//resize the popover view shown</span>
   <span style="color: #11740a; font-style: italic;">//in the current view to the view's size</span>
   popoverContent.contentSizeForViewInPopover <span style="color: #002200;">=</span>
                  CGSizeMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">200</span>, <span style="color: #2400d9;">300</span><span style="color: #002200;">&#41;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//create a popover controller</span>
   self.popoverController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIPopoverController alloc<span style="color: #002200;">&#93;</span>
               initWithContentViewController<span style="color: #002200;">:</span>popoverContent<span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//present the popover view non-modal with a</span>
   <span style="color: #11740a; font-style: italic;">//refrence to the button pressed within the current view</span>
   <span style="color: #002200;">&#91;</span>self.popoverController presentPopoverFromRect<span style="color: #002200;">:</span>popoverButton.frame
               inView<span style="color: #002200;">:</span>self.view
               permittedArrowDirections<span style="color: #002200;">:</span>UIPopoverArrowDirectionAny
               animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
&nbsp;
   <span style="color: #11740a; font-style: italic;">//release the popover content</span>
   <span style="color: #002200;">&#91;</span>popoverView release<span style="color: #002200;">&#93;</span>;
   <span style="color: #002200;">&#91;</span>popoverContent release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Using this code will create another popover which will look as shown in the picture below:</p>
<p style="text-align: center;"><a href="http://blog.blackwhale.at/wp-content/uploads/2010/04/custom-button-popover.jpg"><img class="aligncenter size-full wp-image-552" title="Custom button popover" src="http://blog.blackwhale.at/wp-content/uploads/2010/04/custom-button-popover.jpg" alt="" width="401" height="310" /></a></p>
<p>I really like popovers and also the possibility to show them in a modal manner. It is recommended to use modal popover views very rarely because the user&#8217;s focus gets lost from the main content. Use them only when it is really necessary and some kind of mandatory input is needed (i.e. accepting terms of use).</p>
<p>You will find the source code of this example at my <a href="http://github.com/anka/bw_examples" target="_blank">github   repository</a>. The project is called PopoverView.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/04/show-a-custom-popover-view/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Your first iPad split view application</title>
		<link>http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/</link>
		<comments>http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 18:00:43 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone OS 3.2]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[master detail]]></category>
		<category><![CDATA[popover]]></category>
		<category><![CDATA[split view]]></category>
		<category><![CDATA[UISplitViewController]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=481</guid>
		<description><![CDATA[The split view is something very cool within the new iPhone OS 3.2. It allows us to visualize a master-detail view in a very simple manner. Combined with iPads&#8217; big display of 1024&#215;748 pixels it will be possible to create even better, more user-friendly and valuable applications. Basically, the split view consists of two separate [...]]]></description>
			<content:encoded><![CDATA[<p>The split view is something very cool within the new iPhone OS 3.2. It allows us to visualize a master-detail view in a very simple manner. Combined with iPads&#8217; big display of 1024&#215;748 pixels it will be possible to create even better, more user-friendly and valuable applications.</p>
<p>Basically, the split view consists of two separate views. The master view will be shown in a 320 pixel width part on your screen if your iPad is at landscape orientation, otherwise the master view will be accessible as a popover view. The details view should show your main content and will be at full size if your iPad is at portrait orientation.  Mainly the user will be focused at your details view and this fact you should keep in mind.</p>
<p>Creating a split view pragmatically within your application is a easy task. The following code will show this:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//create the master view</span>
MasterViewController <span style="color: #002200;">*</span>masterView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MasterViewController alloc<span style="color: #002200;">&#93;</span>
                initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Master&quot;</span>
                bundle<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//create the details view</span>
DetailsViewController <span style="color: #002200;">*</span>detailsView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>DetailsViewController alloc<span style="color: #002200;">&#93;</span>
                initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Details&quot;</span>
                bundle<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//create the split view</span>
UISplitViewController <span style="color: #002200;">*</span>splitController <span style="color: #002200;">=</span>
                <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UISplitViewController alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//set the view controllers array</span>
splitController.viewControllers <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSArray</span>
                arrayWithObjects<span style="color: #002200;">:</span>masterView, detailsView, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//show split view as the main view</span>
<span style="color: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span>splitController.view<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//release view</span>
<span style="color: #002200;">&#91;</span>masterView release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>detailsView release<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Next we want to access the master view via a popover view, when the iPad is in portrait mode. The <code>shouldAutorotateToInterfaceOrientation:</code> method of your master and detail controller must support all orientations, otherwise it wont be possible to rotate a split view. After that implement the <code>UISplitViewControllerDelegate</code> protocol in any class and set the delegate of your split view controller. The methods within this protocol will be called whenever the master view will be hidden or shown again.</p>
<p>In my example I created another class which gets a reference to the details view controller and holds the toolbar object we will use to present the popover button. The following code is pretty simple and contains the three methods of the <code>UISplitViewControllerDelegate</code> protocol. The first method is called whenever the master view will be hidden. So in this case we will add a toolbar with the given popover button to our detail view. You are free to label the button as you like. The second method is called whenever the master view will be shown again. Now we simply hide the toolbar. So, that&#8217;s pretty all. The displaying logic of your master view within a popover view is done automatically, but you can still modify it within the last method (which is empty in my case).</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//the master view controller will be hidden</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>splitViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UISplitViewController<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>svc
    willHideViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIViewController <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>aViewController
    withBarButtonItem<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIBarButtonItem<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>barButtonItem
    forPopoverController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIPopoverController<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>pc <span style="color: #002200;">&#123;</span>
&nbsp;
  <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>toolBar <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">//set title of master button</span>
    barButtonItem.title <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Show Master&quot;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">//create a toolbar</span>
    toolBar <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIToolbar alloc<span style="color: #002200;">&#93;</span>
                    initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">1024</span>, <span style="color: #2400d9;">44</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>toolBar setItems<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSArray</span> arrayWithObject<span style="color: #002200;">:</span>barButtonItem<span style="color: #002200;">&#93;</span>
                    animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
  <span style="color: #002200;">&#125;</span>
&nbsp;
  <span style="color: #11740a; font-style: italic;">//add the toolbar to the details view</span>
  <span style="color: #002200;">&#91;</span>detailController.view addSubview<span style="color: #002200;">:</span>toolBar<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">//the master view will be shown again</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>splitViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UISplitViewController<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>svc
    willShowViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIViewController <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>aViewController
    invalidatingBarButtonItem<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIBarButtonItem <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>button <span style="color: #002200;">&#123;</span>
&nbsp;
  <span style="color: #11740a; font-style: italic;">//remove the toolbar</span>
  <span style="color: #002200;">&#91;</span>toolBar removeFromSuperview<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// the master view controller will be displayed in a popover</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>splitViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UISplitViewController<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>svc
    popoverController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIPopoverController<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>pc
    willPresentViewController<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIViewController <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>aViewController <span style="color: #002200;">&#123;</span>
&nbsp;
  <span style="color: #11740a; font-style: italic;">//empty for now</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Well, you need to do something more than this if you want to create really useful split view applications. Often it will be wise to use a table view as your master. Some things I found out while playing around with the split view are:</p>
<ul>
<li>You are not able to present a split view as a modal view</li>
<li>If the master or detail view doesn&#8217;t allow all interface orientations, the split view will not work properly. So if you don&#8217;t see the master view check your <code>shouldAutorotateToInterfaceOrientation</code> method within your view controller.</li>
</ul>
<p>You will find the source code of this example at my <a href="http://github.com/anka/bw_examples" target="_blank">github  repository</a>. The project is called MasterDetail.</p>
<p>Cheers,<br />
Andreas</p>
<h3>Update:</h3>
<p>Some people asked me if it is possible to keep the master view visible even in portrait mode. I tried around and found following working solution:</p>
<p>Create a subclass of <code>UISplitViewController</code> and just overwrite the method <code>willAnimateRotationToInterfaceOrientation: duration:</code>. This method will be called whenever the orientation of a view is going to be changed. Everything you have to do is to check if the interface will change to a portrait method and if that is true, adjust the visible frames of your master and detail views. Find below the code I used to get this working:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">/**
 * Sent to the view controller just before
 * the user interface begins rotating.
 */</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>willAnimateRotationToInterfaceOrientation<span style="color: #002200;">:</span>
            <span style="color: #002200;">&#40;</span>UIInterfaceOrientation<span style="color: #002200;">&#41;</span>interfaceOrientation
            duration<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSTimeInterval<span style="color: #002200;">&#41;</span>duration <span style="color: #002200;">&#123;</span>
&nbsp;
      <span style="color: #11740a; font-style: italic;">//get master and detail view controller</span>
      UIViewController<span style="color: #002200;">*</span> master <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self.viewControllers objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;
      UIViewController<span style="color: #002200;">*</span> detail <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self.viewControllers objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span>;
&nbsp;
      <span style="color: #11740a; font-style: italic;">//only handle the interface orientation</span>
      <span style="color: #11740a; font-style: italic;">//of portrait mode</span>
      <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>interfaceOrientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortrait ||
            interfaceOrientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortraitUpsideDown<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
            <span style="color: #11740a; font-style: italic;">//adjust master view</span>
            CGRect f <span style="color: #002200;">=</span> master.view.frame;
            f.size.width <span style="color: #002200;">=</span> <span style="color: #2400d9;">320</span>;
            f.size.height <span style="color: #002200;">=</span> <span style="color: #2400d9;">1024</span>;
            f.origin.x <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
            f.origin.y <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
&nbsp;
            <span style="color: #002200;">&#91;</span>master.view setFrame<span style="color: #002200;">:</span>f<span style="color: #002200;">&#93;</span>;
&nbsp;
            <span style="color: #11740a; font-style: italic;">//adjust detail view</span>
            f <span style="color: #002200;">=</span> detail.view.frame;
            f.size.width <span style="color: #002200;">=</span> <span style="color: #2400d9;">830</span>;
            f.size.height <span style="color: #002200;">=</span> <span style="color: #2400d9;">1024</span>;
            f.origin.x <span style="color: #002200;">=</span> <span style="color: #2400d9;">320</span>;
            f.origin.y <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
&nbsp;
            <span style="color: #002200;">&#91;</span>detail.view setFrame<span style="color: #002200;">:</span>f<span style="color: #002200;">&#93;</span>;
      <span style="color: #002200;">&#125;</span>
      <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
            <span style="color: #11740a; font-style: italic;">//call super method</span>
            <span style="color: #002200;">&#91;</span>super willAnimateRotationToInterfaceOrientation<span style="color: #002200;">:</span>interfaceOrientation
                        duration<span style="color: #002200;">:</span>duration<span style="color: #002200;">&#93;</span>;
      <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Now, just use your own <code>UISplitViewController</code> subclass within your code and the master view should stay visible even in portrait mode. I hope this code may answer your questions and will be helpful for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Multilanguage support in your iPhone app</title>
		<link>http://blog.blackwhale.at/2010/04/multilanguage-support-in-your-iphone-app/</link>
		<comments>http://blog.blackwhale.at/2010/04/multilanguage-support-in-your-iphone-app/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 19:15:16 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=502</guid>
		<description><![CDATA[Since your app can be downloaded in almost every country of the world, the support of multiple languages is a crucial topic in app development. In this post I will show a simple example of how you can localize strings used within your app. To consequently use the predefined foundation macros  within your code files [...]]]></description>
			<content:encoded><![CDATA[<p>Since your app can be downloaded in almost every country of the world, the support of multiple languages is a crucial topic in app development. In this post I will show a simple example of how you can localize strings used within your app.</p>
<p>To consequently use the predefined foundation macros  within your code files is the best way to start. The macros (a detailed description can be found over <a title="Foundation Reference" href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html" target="_blank">here</a>) are:</p>
<ul>
<li>NSLocalizedString(key, comment)</li>
<li>NSLocalizedStringFromTable(key, tableName, comment)</li>
<li>NSLocalizedStringFromTableInBundle(key, tableName, bundle, comment)</li>
<li>NSLocalizedStringWithDefaultValue(key, tableName, bundle, value, comment)</li>
</ul>
<p>The really best choice is to use <code>NSLocalizedStringWithDefaultValue</code>, because with this macro you are able to define your key and a corresponding default value. The default value should be the correct translation for the given key in your main development language. A simple example is:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">NSLocalizedStringWithDefaultValue<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;firstname&quot;</span>,
          <span style="color: #a61390;">nil</span>,
          <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span>,
          <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Firstname&quot;</span>,
          <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;user information&quot;</span><span style="color: #002200;">&#41;</span>;</pre></div></div>

<p>As you can see, I want to get a translation for my key <code>firstname</code>. Since translations are stored in <code>.strings</code> files, the parameter <code>tableName</code> specifies the name of the file you want to search for the given key. If this parameter is empty the default <code>Localizable.strings</code> will be searched. Also you have to specify the bundle, where your localized resources reside. Mostly it will be the main bundle of your application. The next two parameters are  <code>default</code> and <code>comment</code> which will be very useful as you will see soon.</p>
<p>So when using this macro, your application should be fully functional within your main development language. Before starting to translate your application you need to create some language specific folders within your application folder. These folders need to have the <code>.lproj</code> extension and their name should be the language abbreviation you want to support (i.e. en, de, fr, &#8230;).</p>
<p>Now there are two options to go. Either you create a <code>Localizable.strings</code> file in each <code>.lproj</code> directory and add your key-value-pairs manually or you generate the first .string file from you source code. Since we consequently used the predefined macros it is possible to use the command line tool <code>genstrings</code> to parse all your code files and create the corresponding <code>.strings</code> file. To do so, simply type in:</p>
<pre>genstrings -o en.lproj Classes/*.m
</pre>
<p>After that you get your <code>Localizable.strings</code> file with following content:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">/* user information */</span>
<span style="color: #bf1d1a;">&quot;firstname&quot;</span> <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">&quot;Firstname&quot;</span>;</pre></div></div>

<p>As you can see this is very simple. Also the given comment used within the macro call is visible within the generated code which allows you to keep records about your keys in a nice manner. Now you can simply copy your file to all other directories and translate them. The only trade-off you should keep in mind is that <code>genstrings</code> overwrites your file every time you call it. This means you should keep a copy of your files before calling <code>genstrings</code> again.</p>
<p>Multilanguage support within your <code>.nib</code> files or images is quite easy too, just create translated versions of your files and place them in the corresponding <code>.lproj</code> directory.</p>
<h2>Tip:</h2>
<p>If you are struggling with the localization and internationalization support within XCode, because it creates folders named like <code>English.lproj</code>, <code>German.lproj</code>, &#8230; then simply create the folders <code>en.lproj</code>, <code>de.lproj</code>, &#8230; within your application directory by your own. After that, place a file like <code>Localizable.strings</code> in your sub folders and then add the file within XCode to your project.</p>
<p>So that&#8217;s all folks and I hope you enjoyed this post.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/04/multilanguage-support-in-your-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to play a video within your iphone app</title>
		<link>http://blog.blackwhale.at/2010/03/how-to-play-a-video-within-your-iphone-app/</link>
		<comments>http://blog.blackwhale.at/2010/03/how-to-play-a-video-within-your-iphone-app/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 19:10:15 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=474</guid>
		<description><![CDATA[Sometimes you need to show a short sequence of a video file within your app to enrich your content. However, this is a very simple task. Everything you need is a H.264 or MPEG-4 video included in your project and you also have to reference the MediaPlayer framework. After that simply use the following code [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to show a short sequence of a video file within your app to enrich your content. However, this is a very simple task. Everything you need is a H.264 or MPEG-4 video included in your project and you also have to reference the MediaPlayer framework. After that simply use the following code to start your video:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">...
<span style="color: #11740a; font-style: italic;">//specify the URL of the movie</span>
<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>movieUrl <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> fileURLWithPath<span style="color: #002200;">:</span>
            <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;mymovie&quot;</span> 
            ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;m4v&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//create a new instance of MPMoviePlayerController</span>
MPMoviePlayerController<span style="color: #002200;">*</span> myMovie<span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MPMoviePlayerController alloc<span style="color: #002200;">&#93;</span> 
            initWithContentURL<span style="color: #002200;">:</span>movieUrl<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//disable scaling of our movie</span>
myMovie.scalingMode <span style="color: #002200;">=</span> MPMovieScalingModeNone;
&nbsp;
<span style="color: #11740a; font-style: italic;">//don't show any controls</span>
myMovie.movieControlMode <span style="color: #002200;">=</span> MPMovieControlModeHidden;
&nbsp;
<span style="color: #11740a; font-style: italic;">//you can specify at which time the movie should </span>
<span style="color: #11740a; font-style: italic;">//start playing (default is 0.0)</span>
myMovie.initialPlaybackTime <span style="color: #002200;">=</span> <span style="color: #2400d9;">2.0</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//register a callback method which will be called</span>
<span style="color: #11740a; font-style: italic;">//after the movie finished</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNotificationCenter</span> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self 
            selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>movieFinished<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> 
            name<span style="color: #002200;">:</span>MPMoviePlayerPlaybackDidFinishNotification 
            object<span style="color: #002200;">:</span>myMovie<span style="color: #002200;">&#93;</span>; 
&nbsp;
<span style="color: #11740a; font-style: italic;">//start the movie (asynchronous method)</span>
<span style="color: #002200;">&#91;</span>myMovie play<span style="color: #002200;">&#93;</span>;
...</pre></div></div>

<p>A callback method is used to release your media player instance, which you can simply add to your current class:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>movieFinished<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSNotification</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>aNotification 
<span style="color: #002200;">&#123;</span>
	<span style="color: #11740a; font-style: italic;">//get the movie instance from the notification object</span>
	MPMoviePlayerController<span style="color: #002200;">*</span> myMovie<span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span>aNotification object<span style="color: #002200;">&#93;</span>; 
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNotificationCenter</span> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self 
                    name<span style="color: #002200;">:</span>MPMoviePlayerPlaybackDidFinishNotification 
                    object<span style="color: #002200;">:</span>myMovie<span style="color: #002200;">&#93;</span>; 
&nbsp;
	<span style="color: #11740a; font-style: italic;">//release the movie</span>
	<span style="color: #002200;">&#91;</span>myMovie release<span style="color: #002200;">&#93;</span>; 
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>And that&#8217;s all folks. The code shown above works with iPhone OS 2.0 or greater. In the next release of the iPhone OS there maybe will be some more enhancements on playing movies within your app.</p>
<p>Cheers,</p>
<p>Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2010/03/how-to-play-a-video-within-your-iphone-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hide iPhone status bar</title>
		<link>http://blog.blackwhale.at/2009/12/hide-iphone-status-bar/</link>
		<comments>http://blog.blackwhale.at/2009/12/hide-iphone-status-bar/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 17:25:56 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[hide status bar]]></category>
		<category><![CDATA[plist settings]]></category>
		<category><![CDATA[status bar]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=467</guid>
		<description><![CDATA[Hi folks, today something very short and simple. There are two ways to hide your status bar within your iPhone app: Programmatically ... //use this whereever you want &#91;&#91;UIApplication sharedApplication&#93; setStatusBarHidden:YES animated:NO&#93;; ... Configuration of your Info.plist (seen in SDK 3.1.2) Just add a new line to your "your project name"-Info.plist file and select "Status [...]]]></description>
			<content:encoded><![CDATA[<p>Hi folks,</p>
<p>today something very short and simple. There are two ways to hide your status bar within your iPhone app:</p>
<ol>
<li>Programmatically

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">...
<span style="color: #11740a; font-style: italic;">//use this whereever you want</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> setStatusBarHidden<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span>
                                   animated<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><span style="color: #002200;">&#93;</span>;
...</pre></div></div>

</li>
<li>Configuration of your Info.plist (seen in SDK 3.1.2)<br />
Just add a new line to your <code>"your project name"-Info.plist</code> file and select <code>"Status bar is initially hidden"</code> like in the picture below.<br />
<img class="aligncenter size-full wp-image-468" title="Configuration to hide status bar" src="http://blog.blackwhale.at/wp-content/uploads/2010/01/Bildschirmfoto-2010-01-04-um-18.17.26.png" alt="" width="451" height="229" /></li>
</ol>
<p>Thats pretty all! Have fun,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2009/12/hide-iphone-status-bar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom video/camera overlay view on the iPhone</title>
		<link>http://blog.blackwhale.at/2009/10/custom-video-overlay-view-on-the-iphone/</link>
		<comments>http://blog.blackwhale.at/2009/10/custom-video-overlay-view-on-the-iphone/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 16:42:03 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[camera overlay]]></category>
		<category><![CDATA[UIImagePicker]]></category>
		<category><![CDATA[UIImagePickerController]]></category>
		<category><![CDATA[video capturing]]></category>
		<category><![CDATA[video overlay]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=443</guid>
		<description><![CDATA[Today I am going to show how we can add a custom overlay view to the standard iPhone video capturing functionality. First of all I have to say, that since the iPhone OS 3.1 is published, a custom overlay is really simple to achieve. There are only a few steps you have to do: Create [...]]]></description>
			<content:encoded><![CDATA[<p>Today I am going to show how we can add a custom overlay view to the standard iPhone video capturing functionality. First of all I have to say, that since the iPhone OS 3.1 is published, a custom overlay is really simple to achieve. There are only a few steps you have to do:<br />
<span id="more-443"></span></p>
<ol>
<li>Create a custom view with a transparent background.</li>
<li>Add controls and/or images to the custom view as you like.</li>
<li>Get a new instance of the UIImagePickerController (picker).</li>
<li>Set the source type of the picker to video source.</li>
<li>Hide unneccesary controls of the picker.</li>
<li>Make the video image full-size (if you wish to).</li>
<li>Set your custom overlay and present the picker.</li>
</ol>
<p>To prove that it is really so simple, I worked out an example for you, which adds a small image and a button to the custom overlay and shows this overlay on the image picker. In my example I didn&#8217;t add any functionality to keep it simple and straightforward.</p>
<p>First of all I subclassed UIView for my own custom Overlay view called OverlayView. In this custom overlay I simply added a small image and a button which will sketch the possibility of scanning a marked region within the video preview.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@implementation</span> OverlayView
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>initWithFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>frame <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        <span style="color: #11740a; font-style: italic;">//clear the background color of the overlay</span>
        self.opaque <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
        self.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">//load an image to show in the overlay</span>
        UIImage <span style="color: #002200;">*</span>searcher <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;searcher.png&quot;</span><span style="color: #002200;">&#93;</span>;
        UIImageView <span style="color: #002200;">*</span>searcherView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span>
                            initWithImage<span style="color: #002200;">:</span>searcher<span style="color: #002200;">&#93;</span>;
        searcherView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">30</span>, <span style="color: #2400d9;">100</span>, <span style="color: #2400d9;">260</span>, <span style="color: #2400d9;">200</span><span style="color: #002200;">&#41;</span>;
        <span style="color: #002200;">&#91;</span>self addSubview<span style="color: #002200;">:</span>searcherView<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>searcherView release<span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #11740a; font-style: italic;">//add a simple button to the overview</span>
        <span style="color: #11740a; font-style: italic;">//with no functionality at the moment</span>
        UIButton <span style="color: #002200;">*</span>button <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIButton
                            buttonWithType<span style="color: #002200;">:</span>UIButtonTypeRoundedRect<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>button setTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Scan Now&quot;</span> forState<span style="color: #002200;">:</span>UIControlStateNormal<span style="color: #002200;">&#93;</span>;
        button.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">430</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">40</span><span style="color: #002200;">&#41;</span>;
        <span style="color: #002200;">&#91;</span>self addSubview<span style="color: #002200;">:</span>button<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
...
<span style="color: #a61390;">@end</span></pre></div></div>

<p>All I have to do now is to create a UIImagePickerController instance and customize all specific properties of it to show the overlay view on the video preview. This is very simple and the following code should be very easy to understand.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//create an overlay view instance</span>
OverlayView <span style="color: #002200;">*</span>overlay <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>OverlayView alloc<span style="color: #002200;">&#93;</span>
        initWithFrame<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, SCREEN_WIDTH, SCREEN_HEIGTH<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//create a new image picker instance</span>
UIImagePickerController <span style="color: #002200;">*</span>picker <span style="color: #002200;">=</span>
                <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImagePickerController alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">//set source to video!</span>
picker.sourceType <span style="color: #002200;">=</span> UIImagePickerControllerSourceTypeCamera;
<span style="color: #11740a; font-style: italic;">//hide all controls</span>
picker.showsCameraControls <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
picker.navigationBarHidden <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
picker.toolbarHidden <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
<span style="color: #11740a; font-style: italic;">//make the video preview full size</span>
picker.wantsFullScreenLayout <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
picker.cameraViewTransform <span style="color: #002200;">=</span>
CGAffineTransformScale<span style="color: #002200;">&#40;</span>picker.cameraViewTransform,
            CAMERA_TRANSFORM_X,
            CAMERA_TRANSFORM_Y<span style="color: #002200;">&#41;</span>;
<span style="color: #11740a; font-style: italic;">//set our custom overlay view</span>
picker.cameraOverlayView <span style="color: #002200;">=</span> overlay;
&nbsp;
<span style="color: #11740a; font-style: italic;">//show picker</span>
<span style="color: #002200;">&#91;</span>self presentModalViewController<span style="color: #002200;">:</span>picker animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>The only things missing are my defines for the constants I am using, but I don&#8217;t wanna keep them away from you:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//transform values for full screen support</span>
<span style="color: #6e371a;">#define CAMERA_TRANSFORM_X 1</span>
<span style="color: #6e371a;">#define CAMERA_TRANSFORM_Y 1.12412</span>
<span style="color: #11740a; font-style: italic;">//iphone screen dimensions</span>
<span style="color: #6e371a;">#define SCREEN_WIDTH  320</span>
<span style="color: #6e371a;">#define SCREEN_HEIGTH 480</span></pre></div></div>

<p>After all we get something like this:</p>
<p><img class="aligncenter size-full wp-image-451" title="video scanner" src="http://blog.blackwhale.at/wp-content/uploads/2009/10/IMG_0228.PNG" alt="video scanner" width="320" height="480" /></p>
<p>So, that&#8217;s pretty all. Of course you have to add much more to get some functionality within your overlay, but this example was just a demonstration how easy it is to create your custom video preview overlay view.</p>
<p>You will find the source code of this example at my <a href="http://github.com/anka/bw_examples" target="_blank">github repository</a>. The project is called CameraOverlay.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2009/10/custom-video-overlay-view-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Set background image of UITableView</title>
		<link>http://blog.blackwhale.at/2009/09/set-background-image-of-uitableview/</link>
		<comments>http://blog.blackwhale.at/2009/09/set-background-image-of-uitableview/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 21:15:27 +0000</pubDate>
		<dc:creator>Andreas</dc:creator>
				<category><![CDATA[I talk code]]></category>
		<category><![CDATA[iPhone OS]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[UITableView]]></category>

		<guid isPermaLink="false">http://blog.blackwhale.at/?p=368</guid>
		<description><![CDATA[How to set a background image of a UITableView is a very often and common question. Today we will try to answer this. There are two ways to solve this problem: Create a new UIView &#8211; lets call the view V &#8211; set the background image of V and embed a UITableView &#8211; lets call [...]]]></description>
			<content:encoded><![CDATA[<p>How to set a background image of a UITableView is a very often and common question. Today we will try to answer this.</p>
<p>There are two ways to solve this problem:</p>
<ol>
<li>Create a new UIView &ndash; lets call the view V &ndash; set the background image of V and embed a UITableView &#8211; lets call it TV &#8211; within V. Now set the background color of TV to <code>[UIColor clearColor]</code> and do so for all UITableViewCells. Everything seems to work well but you have to handle some tasks (regarding the UITableView) on your own now like deselcting the currently selected UITableViewCell when returning from a prior pushed view.</li>
<li>The second approach requires less effort but creates a not so pretty side-effect. You can simply create a new UIView, set its background image and send this view to the back of the UITableView. If you do so the background image scrolls with the UITableView. So this solution should only be used if you do not have to many cells, i.e. to create a simple menu screen in a grouped style within your app.</li>
</ol>
<p>For those guys, implementing the second solution, the following code would be helpful. Put it i.e. in your <code>- (void) viewDidLoad;</code> method or further initialization of your view controller.</p>
<p><span id="more-368"></span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//clear background color of uitableview</span>
self.view.backgroundColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor blackColor<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//create new uiview with a background image</span>
UIImage <span style="color: #002200;">*</span>backgroundImage <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageWithContentsOfFile<span style="color: #002200;">:</span>
				<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> 
				pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;your_background&quot;</span> 
				ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;png&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
UIImageView <span style="color: #002200;">*</span>backgroundView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span> 
				initWithImage<span style="color: #002200;">:</span>backgroundImage<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//adjust the frame for the case of navigation or tabbars</span>
backgroundView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">460</span><span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//add background view and send it to the back</span>
<span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>backgroundView<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self.view sendSubviewToBack<span style="color: #002200;">:</span>backgroundView<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>backgroundView release<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>One more thing I should not forget to mention is that iPhone SDK Documentation recommends not to use transparent images, table views or cells. This kind of stuff consumes a lot of resources, so use it wisely and only when necessary (I know, for a pretty user interface it is often indispensable <img src='http://blog.blackwhale.at/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).</p>
<h3>Update</h3>
<p>Since iPhone SDK 3.2 there is new property called <code>backgroundView</code> for <code>UITableView</code>, which enables you to set a custom background very easily.</p>
<p>That&#8217;s all folks,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackwhale.at/2009/09/set-background-image-of-uitableview/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
