<?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>Doga Berntas &#187; iphone</title>
	<atom:link href="http://doganberktas.com/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://doganberktas.com</link>
	<description>is actually from a small planet somewhere in the vicinity of Betelgeuse</description>
	<lastBuildDate>Sat, 21 Apr 2012 21:48:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>iOS and Custom Fonts</title>
		<link>http://doganberktas.com/2012/01/26/ios-and-custom-fonts/</link>
		<comments>http://doganberktas.com/2012/01/26/ios-and-custom-fonts/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 22:52:51 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[custom fonts]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[HelveticaNeue]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=793</guid>
		<description><![CDATA[Recently, I was working on a game with Cocos2d and keep getting this weird iOS version problem. On iOS 5, all my labels were shown as expected but on iOS 4 labels somehow kept disappearing. First I thought this is because of the retina display and point/pixels stuff. However, it was because of the fonts I was [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a title="Crazy quilt collage, is this Cubism (Hockney anyone?) or is this a Fauvist mess?" href="http://flickr.com/photos/23642817@N00/2478897091"><br />
</a></p>
<p>Recently, I was working on a game with Cocos2d and keep getting this weird iOS version problem. On iOS 5, all my labels were shown as expected but on iOS 4 labels somehow kept disappearing. First I thought this is because of the retina display and point/pixels stuff. However, it was because of the fonts I was using. HelveticaNeue-CondensedBold and HelveticaNeue-CondensedBlack are available on iOS 5, but not on iOS 4 (<a href="http://iosfonts.com/" target="_blank">http://iosfonts.com/</a>).</p>
<p><a title="Crazy quilt collage, is this Cubism (Hockney anyone?) or is this a Fauvist mess?" href="http://flickr.com/photos/23642817@N00/2478897091"><img class="aligncenter" src="http://farm4.static.flickr.com/3086/2478897091_02ac5a97fb.jpg" alt="" width="309" height="500" /></a></p>
<p>I googled to see how easy to add custom fonts and it turned out, it is super easy.</p>
<p>These are the links I found helpful:</p>
<ul>
<li>Adding custom fonts by Dave Allanson (<a href="http://www.daveallanson.com/index.php?option=com_content&amp;view=article&amp;id=56:adding-custom-fonts-ios-4&amp;catid=38:blog&amp;Itemid=56" target="_blank">link</a>)</li>
<li>Using Custom Fonts by M. Arsalan Anwar (<a href="http://arsalananwar.blogspot.com/2010/10/using-custom-fonts-on-iphoneipad.html" target="_blank">link</a>)</li>
</ul>
<div><strong>Steps to Add Custom Font:</strong></div>
<div>1. Add font files to project</div>
<div>2. Open your Info.plist file</div>
<div>3. Create the key &#8220;UIAppFonts&#8221;  as Array (it will be shown as &#8220;Fonts provided by application&#8221;  if you are not on Ras Key/Value state, right click and you will see what I mean)</div>
<div>4. Add the fonts to the array</div>
<div><a href="http://doganberktas.com/wp-content/uploads/2012/01/Screen-Shot-2012-01-25-at-2.43.30-PM.png"><img class="alignnone size-medium wp-image-796" title="Screen Shot 2012-01-25 at 2.43.30 PM" src="http://doganberktas.com/wp-content/uploads/2012/01/Screen-Shot-2012-01-25-at-2.43.30-PM-300x34.png" alt="" width="300" height="34" /></a></div>
<div>5. In your code, you can use these fonts as if you are using the regular ones (without the file extension).</div>
<div><strong>Drawing Problems:</strong></div>
<div>If you get the fonts from Adobe, we will get a drawing problem like mentioned <a href="http://stackoverflow.com/questions/5414730/custom-installed-font-not-displayed-correctly-in-uilabel">here</a>. You need to follow the steps <a href="http://stackoverflow.com/questions/7535498/uibutton-custom-font-vertical-alignment/8314197#8314197">here</a>, change the font file&#8217;s ascender property. Don&#8217;t worry it is not that scary as it seems <img src='http://doganberktas.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Don&#8217;t forget to install Apple Font Tool Suite from <a href="http://developer.apple.com/fonts/">here</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2012/01/26/ios-and-custom-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animating Views with iPhone Keyboard</title>
		<link>http://doganberktas.com/2011/02/21/animating-views-with-iphone-keyboard/</link>
		<comments>http://doganberktas.com/2011/02/21/animating-views-with-iphone-keyboard/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 11:29:48 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[NSNotificationCenter]]></category>
		<category><![CDATA[UIKeyboardWillHideNotification]]></category>
		<category><![CDATA[UIKeyboardWillShowNotification]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=765</guid>
		<description><![CDATA[Keyboards on iPhone can be a headache with their half screen size, especially when you have many input fields on a single view. Animating the view in an elegant way so that the input fields are always visible to the user  requires to slide up or down with the keyboard synchronously. Following is a very simple view [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Swimming In The iPool" href="http://flickr.com/photos/83346641@N00/3420540107"><img src="http://farm4.static.flickr.com/3378/3420540107_f71054f41f.jpg" alt="" /></a>Keyboards on iPhone can be a headache with their half screen size, especially when you have many input fields on a single view. Animating the view in an elegant way so that the input fields are always visible to the user  requires to slide up or down with the keyboard synchronously.</p>
<p>Following is a very simple view based project, that will demonstrate animating view with keyboard slide up/down.<br />
But first, let&#8217;s see the problem. If you don&#8217;t change your view positioning when the keyboard becomes visible, basically you are likely to get something like this:</p>
<p style="text-align: center;"><a href="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-2.06.19-AM.png"><img class="size-full wp-image-768  aligncenter" title="Screen shot 2011-02-21 at 2.06.19 AM" src="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-2.06.19-AM.png" alt="" width="396" height="744" /></a><a href="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-2.06.27-AM.png"><img class="size-full wp-image-767  aligncenter" title="Screen shot 2011-02-21 at 2.06.27 AM" src="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-2.06.27-AM.png" alt="" width="396" height="744" /></a></p>
<p>To fix that, what should be done is to listen the keyboard slide up/down notifications through the NSNotificationCenter, which viewWillAppear is a good place to start listening these two notifications.</p>
<pre>-(void)viewWillAppear:(BOOL)animated
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slideUpView:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slideDownView:) name:UIKeyboardWillHideNotification object:nil];
}</pre>
<p>Second step is to change the positioning of the components according to the animation of the keyboard. The following methods are called when there is a notification from the keyboard:</p>
<pre>-(void)slideDownView:(NSNotification*)notification
{
	[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&amp;animationCurve];
    [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&amp;animationDuration];
    [[[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] getValue:&amp;keyboardFrame];

	[UIView animateWithDuration:animationDuration
				delay:0.0
				options:animationCurve
				animations:^{
					self.view.frame = CGRectMake(0, 0, 320, 480);
				}
				completion:^(BOOL finished){
					NSLog(@"Slide down Done..!");
				}];
}

-(void)slideUpView:(NSNotification*)notification
{
    [[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&amp;animationCurve];
    [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&amp;animationDuration];
    [[[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] getValue:&amp;keyboardFrame];
	//
	[UIView animateWithDuration:animationDuration
				delay:0.0
				options:animationCurve
				animations:^{
					self.view.frame = CGRectMake(0, -keyboardFrame.size.height + 70, 320, 416);
				}
				completion:^(BOOL finished){
					NSLog(@"Slide up Done..!");
				}];
}</pre>
<p>Don&#8217;t forget to add .h file the following declarations:</p>
<pre>// in controller's .h file
NSTimeInterval animationDuration;
UIViewAnimationCurve animationCurve;
CGRect keyboardFrame;</pre>
<p>The final result is something like this</p>
<p style="text-align: center;"><a href="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-3.22.16-AM.png"><img class="aligncenter" title="Screen shot 2011-02-21 at 3.22.16 AM" src="http://doganberktas.com/wp-content/uploads/2011/02/Screen-shot-2011-02-21-at-3.22.16-AM.png" alt="" width="396" height="744" /></a></p>
<p>note 1: Feel free to download the source code (<a href="http://doganberktas.com/code/SlideUpWithKeyboard.zip">link</a>). It also includes the slide down via the button.<br />
note 2: The licence to this peace of code is <a href="http://en.wikipedia.org/wiki/Beerware">Beerware</a>, In short, &#8220;Should the user of the product meet the author and consider the software useful, he is encouraged to buy the author a <a href="http://en.wikipedia.org/wiki/Beer">beer</a> &#8216;in return&#8217; (or, in some variations, drink a beer in the author&#8217;s honor).&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2011/02/21/animating-views-with-iphone-keyboard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Saving UIImage as a PNG with an Alpha Channel (with transparency) on iOS</title>
		<link>http://doganberktas.com/2010/11/22/saving-uiimage-as-a-png-with-an-alpha-channel-with-transparency-on-ios/</link>
		<comments>http://doganberktas.com/2010/11/22/saving-uiimage-as-a-png-with-an-alpha-channel-with-transparency-on-ios/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 00:28:19 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[alpha channel]]></category>
		<category><![CDATA[documents folder]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[transparency]]></category>
		<category><![CDATA[uiimage]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=738</guid>
		<description><![CDATA[Say you let your user draw thing and let them go wild with their imaginations, as they probably create awesome drawings, you should probably want to save these images to somewhere. After this short happy talk, here is the code snippet that saves your UIImage to the Documents folder with its alpha channel, if there [...]]]></description>
			<content:encoded><![CDATA[<p>Say you let your user draw thing and let them go wild with their imaginations, as they probably create awesome drawings, you should probably want to save these images to somewhere.</p>
<p style="text-align: center;"><a title="Three Cats by the window..." href="http://flickr.com/photos/73567305@N00/1780521687"><img class="aligncenter" src="http://farm3.static.flickr.com/2248/1780521687_8efe47e43b.jpg" alt="" /></a></p>
<p>After this short happy talk, here is the code snippet that saves your UIImage to the Documents folder with its alpha channel, if there is one. The other method is for reading that image back to an UIImage instance.</p>
<pre>-(void)saveImageToDocs:(NSString *)fileName
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];
	NSString *filePath2 = [NSString stringWithFormat:@"%@/%@.png", documentsDirectory, fileName];

	// If you use this method, the transparency will be lost
	//NSData* imageData = UIImageJPEGRepresentation(drawImage.image, 1.0);
	//NSData* imageData = UIImagePNGRepresentation(drawImage.image);
	//[imageData writeToFile:filePath2 atomically:NO];

	// So use this one
	[UIImagePNGRepresentation(myUIImage) writeToFile:filePath2 atomically:YES];
}

-(void)loadImageFromDocs:(NSString *)fileName
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];
	NSString *filePath2 = [NSString stringWithFormat:@"%@/%@.png", documentsDirectory, fileName];
	if([[NSFileManager defaultManager] fileExistsAtPath:filePath2])
	{
		NSLog(@"image file exists");
		myUIImage = [UIImage imageWithContentsOfFile: filePath2];
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/11/22/saving-uiimage-as-a-png-with-an-alpha-channel-with-transparency-on-ios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Data Storage Alternatives on iOS (in a Nutshell)</title>
		<link>http://doganberktas.com/2010/10/16/data-storage-alternatives-on-ios-in-a-nutshell/</link>
		<comments>http://doganberktas.com/2010/10/16/data-storage-alternatives-on-ios-in-a-nutshell/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 20:27:00 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[data managements]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=687</guid>
		<description><![CDATA[Below you can find the summary of available alternatives for storing data on iOS based machines. Mainly, which one to use depends on your needs like size of data, need of concurrency, access speed, etc. NSUserDefaults Based on plists Store lightweight app state Tutorial (link) Plist &#8212; Writing everything out as a plist Not suitable [...]]]></description>
			<content:encoded><![CDATA[<p><a title="The Sheep, and we Twitter Sheep can follow these 10 great photographers!" href="http://flickr.com/photos/95572727@N00/3440978820"><img class="alignnone" src="http://farm4.static.flickr.com/3414/3440978820_cf8c782674.jpg" alt="" width="500" height="332" /></a></p>
<p><a title="The Sheep, and we Twitter Sheep can follow these 10 great photographers!" href="http://flickr.com/photos/95572727@N00/3440978820"></a>Below you can find the summary of available alternatives for storing data on iOS based machines. Mainly, which one to use depends on your needs like size of data, need of concurrency, access speed, etc.</p>
<ul>
<li>NSUserDefaults
<ul>
<li>Based on plists</li>
<li>Store lightweight app state</li>
<li>Tutorial (<a href="http://icodeblog.com/2008/10/03/iphone-programming-tutorial-savingretrieving-data-using-nsuserdefaults/">link</a>)</li>
</ul>
</li>
<li>Plist &#8212; Writing everything out as a plist
<ul>
<li>Not suitable for complex model objects</li>
<li>Faster than NSUserDefaults</li>
<li>How to load a plist (<a href="http://code.davidjanes.com/blog/2009/03/23/how-to-load-a-plist-in-an-iphone-application/">link</a>)</li>
<li>Write &amp; Read data to .plist (<a href="http://ipgames.wordpress.com/tutorials/writeread-data-to-plist-file/">link</a>)</li>
</ul>
</li>
<li>Archived Objects
<ul>
<li>Conteptual guide (<a title="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Archiving/Archiving.html%23//apple_ref/doc/uid/10000047-SW1" href="http://">link</a>)</li>
<li>Archives provide a means to convert objects and values into an architecture-independent stream of bytes that preserves the identity of and the relationships between the objects and values.</li>
<li>Serialization converts Objective-C types to and from an architecture-independent byte stream. In contrast to archiving, basic serialization does not record the data type of the values nor the relationships between them; only the values themselves are recorded. Arbitrary objects cannot be serialized. Only instances of NSArray, NSDictionary, NSString, NSDate, NSNumber, and NSData (and some of their subclasses) can be serialized. (<a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Archiving/Articles/objectgraphs.html">link</a>)</li>
<li>Forum post about how to use archiver (<a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/3369-archiving-object-nskeyedarchiver-sqlite-coredata.html">link</a>)</li>
</ul>
</li>
<li>The joy of SQLite
<ul>
<li>Basically a local file act like a database server</li>
<li>Not very good for extreme concurrent access</li>
<li>A step by step tutorial (<a href="http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/">link</a>)</li>
</ul>
</li>
<li>Core Data
<ul>
<li>Higher abstraction layer than SQLite</li>
<li>Save&amp;load model objects</li>
<li>ORM (Rails ActiveRecord, Java Hibernate)</li>
<li>Use NSPredicate for in memory filtering</li>
<li>Apple Dev Center Article (<a href="http://developer.apple.com/macosx/coredata.html">link</a>)</li>
</ul>
</li>
<li>Web Services
<ul>
<li>Store &amp; access remote data</li>
<li>XML and Json parsers</li>
</ul>
</li>
</ul>
<p>ps. Related Stackoverflow <a href="http://stackoverflow.com/questions/934878/iphone-plist-or-sqlite-for-static-data">entry</a></p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/10/16/data-storage-alternatives-on-ios-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iOS Shouldn&#8217;t Have 6 Device Orientations</title>
		<link>http://doganberktas.com/2010/08/30/ios-shouldnt-have-6-device-orientations/</link>
		<comments>http://doganberktas.com/2010/08/30/ios-shouldnt-have-6-device-orientations/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 19:47:51 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[device orientation]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[view controller]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=592</guid>
		<description><![CDATA[For a small iPad project, I happened to use iPad&#8217;s orientation stuff. As it turns out, there is always a catch. In UIDevice class , you see the following orientations: typedef enum { UIDeviceOrientationUnknown, UIDeviceOrientationPortrait, // Device oriented vertically, home button on the bottom UIDeviceOrientationPortraitUpsideDown, // Device oriented vertically, home button on the top UIDeviceOrientationLandscapeLeft, [...]]]></description>
			<content:encoded><![CDATA[<p>For a small iPad project, I happened to use iPad&#8217;s orientation stuff. As it turns out, there is always a catch.</p>
<p>In UIDevice class , you see the following orientations:</p>
<pre>
typedef enum
{
    UIDeviceOrientationUnknown,
    UIDeviceOrientationPortrait,            // Device oriented vertically, home button on the bottom
    UIDeviceOrientationPortraitUpsideDown,  // Device oriented vertically, home button on the top
    UIDeviceOrientationLandscapeLeft,       // Device oriented horizontally, home button on the right
    UIDeviceOrientationLandscapeRight,      // Device oriented horizontally, home button on the left
    UIDeviceOrientationFaceUp,              // Device oriented flat, face up
    UIDeviceOrientationFaceDown             // Device oriented flat, face down
} UIDeviceOrientation;
</pre>
<p>But for a view controller&#8217;s parent, there are only four</p>
<p>self.parentViewController.interfaceOrientation only has</p>
<pre>typedef enum
{
    UIInterfaceOrientationPortrait           = UIDeviceOrientationPortrait,
    UIInterfaceOrientationPortraitUpsideDown = UIDeviceOrientationPortraitUpsideDown,
    UIInterfaceOrientationLandscapeLeft      = UIDeviceOrientationLandscapeRight,
    UIInterfaceOrientationLandscapeRight     = UIDeviceOrientationLandscapeLeft
} UIInterfaceOrientation;</pre>
<p>So the problem arises when you try to layout according to</p>
<pre>  [UIDevice currentDevice].orientation</pre>
<p>When the device orientation is UIDeviceOrientationFaceUp or UIDeviceOrientationFaceDown, you get 3 orientation changed calls. One is the up and down, than a landscape, than again up or down.</p>
<p>This is, to be honest, completely broken. It is clear that, since the status bar can be located to four locations on the screen, there should be 4 device orientations, not 6. The FaceUp and FaceDown should be a different property I guess (gravityOrientation or sth like that)</p>
<p>ps. Some links that can help if you have issues with this up&amp;down thing</p>
<ul>
<li><a href="http://blogs.remobjects.com/blogs/mh/2010/06/29/p1685">Handling UIDeviceOrientationFaceUp &amp; UIDeviceOrientationFaceDown </a></li>
<li><a href="http://www.cocos2d-iphone.org/forum/topic/6413">http://www.cocos2d-iphone.org/forum/topic/6413</a></li>
<li><a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/45799-ipad-device-orientation-face-up.html">http://www.iphonedevsdk.com/forum/iphone-sdk-development/45799-ipad-device-orientation-face-up.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/08/30/ios-shouldnt-have-6-device-orientations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Summary of Web Application Libraries for iPhone</title>
		<link>http://doganberktas.com/2010/07/17/summary-of-web-application-libraries-for-iphone/</link>
		<comments>http://doganberktas.com/2010/07/17/summary-of-web-application-libraries-for-iphone/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 23:46:13 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iui]]></category>
		<category><![CDATA[iwebkit]]></category>
		<category><![CDATA[jqtouch]]></category>
		<category><![CDATA[pastrykit]]></category>
		<category><![CDATA[sencha touch]]></category>
		<category><![CDATA[spoutcore]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=437</guid>
		<description><![CDATA[PastryKit &#8212; it is from Apple, but it is not public,  you can see it from the iPhone User Guide, it will be released to public hopefully. http://stackoverflow.com/questions/1143589/what-is-the-pastrykit-framework http://daringfireball.net/2009/12/pastrykit http://ajaxian.com/archives/pastrykit-an-iphone-webdev-library-from-apple Sencha Touch &#8212; you should definitely see their kitchen sink, it is pretty cool.but there is no commercial license yet. http://ajaxian.com/archives/sencha-touch http://mobile.tutsplus.com/articles/news/sencha-touch-html5-mobile-framework/ http://www.endofnative.com/ iUi &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PastryKit</strong> &#8212; it is from Apple, but it is not public,  you can see it from the <a href="http://help.apple.com/iphone/3/mobile/">iPhone User Guide</a>, it will be released to public hopefully.</p>
<ul>
<li><a href="http://stackoverflow.com/questions/1143589/what-is-the-pastrykit-framework">http://stackoverflow.com/questions/1143589/what-is-the-pastrykit-framework</a></li>
<li><a href="http://daringfireball.net/2009/12/pastrykit">http://daringfireball.net/2009/12/pastrykit</a></li>
<li><a href="http://ajaxian.com/archives/pastrykit-an-iphone-webdev-library-from-apple">http://ajaxian.com/archives/pastrykit-an-iphone-webdev-library-from-apple</a></li>
</ul>
<p><a href="http://www.sencha.com/products/touch/"><strong>Sencha Touch</strong></a> &#8212; you should definitely see their <a href="http://www.sencha.com/deploy/touch/examples/kitchensink/">kitchen sink</a>, it is pretty cool.but there is no commercial license yet.</p>
<ul>
<li><a href="http://ajaxian.com/archives/sencha-touch">http://ajaxian.com/archives/sencha-touch</a></li>
<li><a href="http://mobile.tutsplus.com/articles/news/sencha-touch-html5-mobile-framework/">http://mobile.tutsplus.com/articles/news/sencha-touch-html5-mobile-framework/</a></li>
<li><a href="http://www.endofnative.com/">http://www.endofnative.com/</a></li>
</ul>
<p style="text-align: center;"><img class="aligncenter" src="http://doganberktas.com/wp-content/uploads/2010/07/photo.png" alt="and the winner is ..." width="368" height="490" /></p>
<p><a href="http://code.google.com/p/iui/"><strong>iUi</strong></a> &#8212; not that many people using it I guess. I build a site with it, if it is sth fast and easy to learn, iUi can do the job.</p>
<ul>
<li>Sites build with iUi &#8212; <a href="http://code.google.com/p/iui/wiki/PoweredBy">http://code.google.com/p/iui/wiki/PoweredBy</a></li>
</ul>
<p><span style="color: #ff6600;"><a href="http://jqtouch.com"><strong>jqtouch</strong></a></span> &#8212; <a href="http://jqtouch.com/preview/demos/main/">demos</a> seem very nice, probably better than iUi in terms of current release capabilities and size of community.</p>
<p><a href="http://iwebkit.net/">iWebkit</a> &#8212; <a href="http://iwebkit.net/demo">demo</a> seems promising, but not ready for prime time.</p>
<p><a href="http://www.sproutcore.com/what-is-sproutcore/">SproutCore</a> &#8212; not for iPhone specificly, but its <a href="http://demo.sproutcore.com/sample_controls/">demo</a> seems nice.</p>
<p>So my choice for the next task is jqtouch. not iui this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/07/17/summary-of-web-application-libraries-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Hacker News iPad Reader</title>
		<link>http://doganberktas.com/2010/07/07/yet-another-hacker-news-ipad-reader/</link>
		<comments>http://doganberktas.com/2010/07/07/yet-another-hacker-news-ipad-reader/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 09:27:45 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=375</guid>
		<description><![CDATA[A couple of weeks ago, I wanted to read Hackernews with my iPad [although some HackerNews readers see iPad’s Safari good enough for the task (which requires opening new tabs for comments,  lots of copy &#38; pasting URLs to share and  etc)], I searched for an application. Eventually, I found two, which are both paid [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A couple of weeks ago, I wanted to read Hackernews with my iPad [although  some HackerNews readers see iPad’s Safari good enough for the task  (which requires opening new tabs for comments,  lots of copy &amp; pasting URLs to  share and  etc)], I searched for an application. Eventually, I found two, which are both paid applications. Since this applications is in my seven nights category (which is something I can code in seven consequent nights without disrupting my day work), I decided to code it myself.</p>
<p style="text-align: justify;">After 3 nights the application was ready for the submission. It got rejected since I didn&#8217;t read the iPad User guidelines carefully (actually I just skimmed it in 5 minutes). The rejection reason is &#8220;You can&#8217;t show more than one popover at the same time&#8221;. I fixed the problem, and it is available in the app store (<a href="http://dogan.appspot.com/35">App Store link</a>)</p>
<p><img class="alignnone" style="margin-left: -50px;" src="http://doganberktas.com/wp-content/uploads/2010/07/Screen-shot-2010-07-07-at-12.07.53-PM.png" alt="Yet Another Hackernews reader" width="566" height="476" /></p>
<p style="text-align: justify;">I will probably change the default RSS feed of Hackernews which only show top 30 posts. Probably something on GAE, and maybe a simple my favorites kind of thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/07/07/yet-another-hacker-news-ipad-reader/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Transparent Modal View Programatically&#8211; iPhone</title>
		<link>http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/</link>
		<comments>http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/#comments</comments>
		<pubDate>Tue, 18 May 2010 03:14:28 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[iphone application]]></category>
		<category><![CDATA[iphone sdk]]></category>
		<category><![CDATA[UIActivityIndicatorView]]></category>
		<category><![CDATA[uiview]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=301</guid>
		<description><![CDATA[Assuming you have a long process  taken so long that you want to show a transparent view, you can do it very easily by just adding the following method to your .m file and you will get the following transparent loading view -(void)showLoadingView { CGRect transparentViewFrame = CGRectMake(0.0, 0.0,320.0,480.0); transparentView = [[UIView alloc] initWithFrame:transparentViewFrame]; transparentView.backgroundColor [...]]]></description>
			<content:encoded><![CDATA[<p>Assuming you have a long process  taken so long that you want to show a transparent view, you can do it very easily by just adding the following method to your .m file and you will get the following transparent loading view</p>
<p style="text-align: center;"><a href="http://doganberktas.com/wp-content/uploads/2010/05/Screen-shot-2010-05-17-at-8.09.33-PM.png"><br />
<img class="size-full wp-image-302 aligncenter" style="margin-top: 10px; margin-bottom: 10px;" title="Screen shot 2010-05-17 at 8.09.33 PM" src="http://doganberktas.com/wp-content/uploads/2010/05/Screen-shot-2010-05-17-at-8.09.33-PM.png" alt="" width="414" height="770" /></a></p>
<pre>-(void)showLoadingView
{
	CGRect transparentViewFrame = CGRectMake(0.0, 0.0,320.0,480.0);
	transparentView = [[UIView alloc] initWithFrame:transparentViewFrame];
	transparentView.backgroundColor = [UIColor lightGrayColor];
	transparentView.alpha = 0.9;

	UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
	spinner.center = transparentView.center;
	[spinner startAnimating];

	UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 280, 320, 30)];
	messageLabel.textAlignment = UITextAlignmentCenter;
	messageLabel.text = @"please wait...";

	[transparentView addSubview:spinner];
	[transparentView addSubview:messageLabel];

	[self.view addSubview:transparentView];

	[messageLabel release];
	[spinner release];
	[transparentView release];
}
</pre>
<p>Now, you should call this function whenever needed. Let&#8217;s say you have a background process that will run while the transparent loading view is shown, below is the code to handle this situation:</p>
<pre>-(void)myAction:(id)sender
{
	[self showLoadingView];

	[self performSelectorInBackground:@selector(myActionBackground:) withObject:sender];
}

-(void)myActionBackground:(id)sender
{
        NSAutoreleasePool *apool = [[NSAutoreleasePool alloc] init];
	//your code
        [apool release];
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/05/18/adding-transparent-modal-view-programatically-iphone/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using Memcache with Google App Engine (GAE/J)</title>
		<link>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/</link>
		<comments>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 21:39:23 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[gae/j]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[ifragman]]></category>
		<category><![CDATA[iphone application]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Servlet]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=196</guid>
		<description><![CDATA[A simple beginning &#8212; Fragman iPhone Application Memcache provides convenience to store a frequent query in memory, so that you don&#8217;t have to make the same execution over and over again. For the iPhone application I build (Fragman), I build a GAE/J backend for managing movie names, IMDB URLs, thumb images, video files, etc. It [...]]]></description>
			<content:encoded><![CDATA[<p><strong>A simple beginning &#8212; Fragman iPhone Application</strong></p>
<p>Memcache provides convenience to store a frequent query in memory, so that you don&#8217;t have to make the same execution over and over again. For the <a href="http://ifragman.com"><span style="color: #800000;">iPhone application I build (Fragman</span></a><span style="color: #800000;">)</span>, I build a GAE/J backend for managing movie names, IMDB URLs, thumb images, video files, etc. It interacts with the Obj-c code via calls encoded in JSON.</p>
<p>Since the categories are updated so frequently (new trailer, top 250 , soap opera trailers), every time the user starts the application from her iPhone, the corresponding categories Id(key) lists are  created which includes all the aspects mentioned above,</p>
<p>what I see, after people start to use the application that, most of the time, the application got stuck with the time constraint of GAE and  this causes inconvenience, so I decided to hold the category lists&#8217;s JSON in memory. Following is the code ,</p>
<p>this is the servlet for creating the JSON which is called after say upcoming movie list is changed. This servlet updates the memcached list</p>
<pre>        List keyList = new ArrayList();
	static Cache cache;
	static
	{
		try
		{
			CacheFactory cacheFactory =</pre>
<pre>CacheManager.getInstance().getCacheFactory();
			cache = cacheFactory.createCache(</pre>
<pre>Collections.emptyMap());
		}
		catch (CacheException e)
		{
			// ...
		}
		//.....
                public void doGet(HttpServletRequest request,</pre>
<pre>HttpServletResponse response) throws ServletException, IOException</pre>
<pre>	        {
                       //................
                       if(cache.containsKey(mode))
		       {
			     cache.remove(mode);
		       }
		       cache.put(mode, keyList);
	        }</pre>
<pre>                //........</pre>
<pre>          }</pre>
<p>And this is the servlet that fetch the Fragman beans from the datastore with the given keys (key list is got from the memecached list)</p>
<pre>          keyList = (List)cache.get(mode);</pre>
<pre>By doing this, I reduce the time that the servlet that creates the JSON takes.</pre>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/01/18/using-memcache-with-google-app-engine-gaej-a-simple-beginning-fragman-iphone-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cydia and XCode Local App Testing</title>
		<link>http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/</link>
		<comments>http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 13:44:48 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Cydia]]></category>
		<category><![CDATA[Dpkg]]></category>
		<category><![CDATA[IPhone OS]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[ldid]]></category>
		<category><![CDATA[local application]]></category>
		<category><![CDATA[Multi-touch]]></category>
		<category><![CDATA[test application]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=78</guid>
		<description><![CDATA[1. Go to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/SDKSettings.plist and change CODE_SIGNING_REQUIRED to NO and save it. (if it complains about file permission right click the file and select Get Info and after unlocking the file, change the permission to read&#38;write) 2. In XCode open the info page and change Code Signing Identy to Don&#8217;t Code Sign. 3. In the [...]]]></description>
			<content:encoded><![CDATA[<p>1. Go to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/SDKSettings.plist and change CODE_SIGNING_REQUIRED to NO and save it. (if it complains about file permission right click the file and select Get Info and after unlocking the file, change the permission to read&amp;write)</p>
<p><img src="file:///Users/dkberktas/Desktop/Picture%2011.png" alt="" /><a rel="attachment wp-att-79" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-11/"><img class="alignnone size-full wp-image-79" style="border: 0pt none;" title="Plist File" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-11.png" alt="Plist File" width="498" height="310" /></a></p>
<p><a rel="attachment wp-att-80" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-12/"><img class="alignnone size-full wp-image-80" style="border: 0pt none;" title="Picture 12" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-12.png" alt="Picture 12" width="499" height="461" /></a></p>
<p>2. In XCode open the info page and change Code Signing Identy to Don&#8217;t Code Sign.</p>
<p><a rel="attachment wp-att-81" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-13/"><img class="alignnone size-full wp-image-81" style="border: 0pt none;" title="Picture 13" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-13.png" alt="Picture 13" width="497" height="364" /></a><br />
3. In the terminal, set the environment variable  CODESIGN_ALLOCATE  as follows: (or you will get an error like this util/ldid.cpp(567): _assert(0:arch != NULL))<br />
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate<br />
<a rel="attachment wp-att-82" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-14/"><img class="alignnone size-full wp-image-82" style="border: 0pt none;" title="Picture 14" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-14.png" alt="Picture 14" width="513" height="419" /></a><br />
4. Open Fugu and connect to your iphone (you can download FUGU from <a href="http://tc.versiontracker.com/product/redir/lid/173454/Fugu-1.2.0-Universal-English.dmg" target="_blank">here</a>)(you can find the IP address your iphone from Settings-&gt;Wi-fi-&gt;ConnectedWirelessName) (Username should be <strong>root</strong> and password should be <strong>alpine</strong> OR <strong>dottie</strong>) (open your iphone and don&#8217;t let it pass to stand-by mode during these phases)</p>
<p><a rel="attachment wp-att-83" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-15/"><img class="alignnone size-full wp-image-83" style="border: 0pt none;" title="Picture 15" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-15.png" alt="Picture 15" width="509" height="415" /></a><a rel="attachment wp-att-84" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-16/"><img class="alignnone size-full wp-image-84" style="border: 0px solid black;" title="Picture 16" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-16.png" alt="Picture 16" width="510" height="416" /></a><br />
5. Go to root directory and from here go to Applications directory</p>
<p><a rel="attachment wp-att-85" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-17/"><img class="alignnone size-full wp-image-85" style="border: 0pt none;" title="Picture 17" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-17.png" alt="Picture 17" width="513" height="418" /></a><a rel="attachment wp-att-86" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-18/"><img class="alignnone size-full wp-image-86" style="border: 0pt none;" title="Picture 18" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-18.png" alt="Picture 18" width="511" height="417" /></a><a rel="attachment wp-att-87" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-19/"><img class="alignnone size-full wp-image-87" style="border: 0pt none;" title="Picture 19" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-19.png" alt="Picture 19" width="514" height="420" /></a><br />
6. In XCode, build your application, from Products folder, select Reveal in Finder</p>
<p>7. Upload the .app file to the Applications folder in your iPhone</p>
<p>8. Open a Terminal and connect to your iphone with ssh like (be  careful that iphone is not in stand-by mode)</p>
<p>root@192.168.1.5 and enter your password</p>
<p><a rel="attachment wp-att-88" href="http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/picture-20/"><img class="alignnone size-full wp-image-88" style="border: 0pt none;" title="Picture 20" src="http://doganberktas.com/wp-content/uploads/2009/10/Picture-20.png" alt="Picture 20" width="557" height="425" /></a></p>
<p>9. First change the binary file permission of your application</p>
<p>chmod 755 /Applications/Appname.app/Appname</p>
<p>10. Then sign the app file with ldid</p>
<p>ldid -S /Applications/Appname.app/Appname</p>
<p>11. Restart the iphone, you are good to go</p>
<p>Note:<br />
1. If ldid command can not be found, type apt-get install ldid OR aptitude install ldid<br />
2. If apt-get can not be found install aptitude from Cydia</p>
<p>3.There are very useful pages on the net, so just google xcode and cydia, here is one of them http://thebigboss.org/hosting-repository/submit-your-app/compile-for-cydia-submission/</p>
<p>4. If you get an error like util/ldid.cpp(567): _assert(0:arch != NULL), there can be two possible reason for this, you either forget to export CODESIGN_ALLOCATE. The other possibility is that you build the application for the simulator. To fix this,  from XCOde change it to Device &#8211; 3.0  or sth similar <img src='http://doganberktas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . You should see it on the combo box top left top corner of XCode.</p>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2009/10/19/cydia-and-xcode-local-app-testing/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

