<?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>Shang Liang &#187; iphone</title>
	<atom:link href="http://shang-liang.com/blog/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://shang-liang.com/blog</link>
	<description>Life in a Flash</description>
	<lastBuildDate>Wed, 11 Jan 2012 11:48:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adding Core Data for Xcode 4 Projects</title>
		<link>http://shang-liang.com/blog/adding-core-data-for-xcode-4-projects/</link>
		<comments>http://shang-liang.com/blog/adding-core-data-for-xcode-4-projects/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 09:32:53 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[core data]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[NSManagedObjectContext]]></category>
		<category><![CDATA[NSManagedObjectModel]]></category>
		<category><![CDATA[NSPersistentStoreCoordinator]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=375</guid>
		<description><![CDATA[In Xcode 3, this is an option to select whether the project uses core data features. If it&#8217;s checked, Xcode automatically generates the code to set up the environment. Most of the examples about core data is based on the codes generated by Xcode. However, this feature is taken out in Xcode 4.This post is [...]]]></description>
			<content:encoded><![CDATA[<p>In Xcode 3, this is an option to select whether the project uses core data features. If it&#8217;s checked, Xcode automatically generates the code to set up the environment. Most of the examples about core data is based on the codes generated by Xcode. However, this feature is taken out in Xcode 4.<a title="add core data to xcode 4 project" href="http://www.theappcodeblog.com/2011/08/08/add-core-data-to-an-existing-project-in-xcode-4/" target="_blank">This post is a guide </a>of how to add the code manually in Xcode 4. Based on that, here&#8217;s my version of a simplified routine (it&#8217;s only 7 lines without the comments) .</p>
<p><a href="https://gist.github.com/1594228">&gt;&gt;Enjoy&lt;&lt;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/adding-core-data-for-xcode-4-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t mess with Core Data</title>
		<link>http://shang-liang.com/blog/dont-mess-with-core-data/</link>
		<comments>http://shang-liang.com/blog/dont-mess-with-core-data/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 06:29:35 +0000</pubDate>
		<dc:creator>Shang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[core data]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[NSManagedObjectContext]]></category>
		<category><![CDATA[NSManagedObjectModel]]></category>
		<category><![CDATA[NSPersistentStoreCoordinator]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=351</guid>
		<description><![CDATA[I had a weird error when working with Core Data. The App crashes without giving anything information. After adding break points here and there for  a few hours, I narrowed that the problem is caused by failure to retrieve the NSManagedObjectModel file. I re-created another project and re-created the xcdatamodeld file from scratch and everything works fine. [...]]]></description>
			<content:encoded><![CDATA[<p>I had a weird error when working with Core Data. The App crashes without giving anything information. After adding break points here and there for  a few hours, I narrowed that the problem is caused by failure to retrieve the NSManagedObjectModel file. I re-created another project and re-created the xcdatamodeld file from scratch and everything works fine. I suddenly remember I edited the xcdatamodeld file with vim when entering the attributes. That must be the reason.</p>
<p>I&#8217;m not 100% sure what happened but here&#8217;s my guess. The data model file is versioned automatically in Xcode 4. If I edit the &#8220;content&#8221; file directly, the versioning is disturbed and the IOS won&#8217;t be able to locate the &#8220;mom&#8221; file properly inside the &#8220;momd&#8221; folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/dont-mess-with-core-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Google Analytics IOS SDK</title>
		<link>http://shang-liang.com/blog/using-google-analytics-ios-sdk/</link>
		<comments>http://shang-liang.com/blog/using-google-analytics-ios-sdk/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 19:31:14 +0000</pubDate>
		<dc:creator>Shang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=289</guid>
		<description><![CDATA[The library is great and it&#8217;s very simple to implement. You can follow the instructions on Google to get things ready. When calling the function, assuming trackPageview, it will be like this NSError* error; [[GANTracker sharedTracker] trackPageview:@"/page name" withError:&#38;error] Just two things to note: the page name must start with forward slash &#8220;/&#8221; withError cannot be [...]]]></description>
			<content:encoded><![CDATA[<p>The library is great and it&#8217;s very simple to implement. You can follow the <a title="google analytics iphone instruction" href="http://code.google.com/mobile/analytics/docs/iphone/" target="_blank">instructions on Google</a> to get things ready.</p>
<p>When calling the function, assuming trackPageview, it will be like this</p>
<p><code>NSError* error;<br />
[[GANTracker sharedTracker] trackPageview:@"/page name" withError:&amp;error]</code></p>
<p>Just two things to note:</p>
<ol>
<li>the page name must start with forward slash &#8220;/&#8221;</li>
<li>withError cannot be nil. If you set the &#8220;error&#8221; as nil, the system will give you a runtime error.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/using-google-analytics-ios-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rearrange file orders in Xcode : Sort</title>
		<link>http://shang-liang.com/blog/rearrange-file-orders-in-xcode-sort/</link>
		<comments>http://shang-liang.com/blog/rearrange-file-orders-in-xcode-sort/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 18:20:02 +0000</pubDate>
		<dc:creator>5566</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=280</guid>
		<description><![CDATA[I&#8217;m spoilt by other IDEs and used to see all my files in my project folder are sorted alphabetically. Xcode does not do that automatically. The newer files are located at the bottom of the folders by default. However, you can drag and drop to arrange them. I accidentally found out that there is a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m spoilt by other IDEs and used to see all my files in my project folder are sorted alphabetically. Xcode does not do that automatically. The newer files are located at the bottom of the folders by default. However, you can drag and drop to arrange them. </p>
<p>I accidentally found out that there is a &#8220;Sort&#8221; function in the &#8220;Edit&#8221; menu. Select the folder you want to sort and apply.  It will list the files by name or by type based on your choice.</p>
<p>I guess the reason for Xcode not to sort files automatically is due to usability issue. As I am working on my project, some files are seldom opened and some files are edited constantly. It&#8217;s quite convenient to drag the more frequently used files onto the top.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/rearrange-file-orders-in-xcode-sort/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom fonts in IOS4</title>
		<link>http://shang-liang.com/blog/custom-fonts-in-ios4/</link>
		<comments>http://shang-liang.com/blog/custom-fonts-in-ios4/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 16:04:55 +0000</pubDate>
		<dc:creator>Shang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=268</guid>
		<description><![CDATA[I was following the instructions on this website but I didn&#8217;t manage to get the custom fonts working. After trying for a while I found out the problem. Here&#8217;s the updated details of how to use custom fonts in iPhone. This is only available for SDK 4.0 and above. Add your custom font files into your [...]]]></description>
			<content:encoded><![CDATA[<p>I was following the instructions <a href="http://blog.beefyapps.com/2010/06/custom-fonts-in-ios-4/" target="_blank">on this website</a> but I didn&#8217;t manage to get the custom fonts working. After trying for a while I found out the problem.</p>
<p>Here&#8217;s the updated details of how to use custom fonts in iPhone. This is only available for SDK 4.0 and above.</p>
<ol>
<li>Add your custom font files into your project using XCode as resources.</li>
<li>Add a key to your info.plist file called &#8220;Fonts provided by application&#8221; ( Used to be called UIAppFonts).</li>
<li>It&#8217;s an array key.</li>
<li>For each font you have, enter the full name of your font file (including the extension).</li>
<li>Save info.plist.</li>
<li>Now in your application you can simply call [UIFont fontWithName:@"CustomFontName" size:12] to get the custom font to use with your UILabels and UITextView.</li>
<li>&#8220;CustomFontName&#8221; is not the font&#8217;s file name. It is the font name registered in the operating system. For example, if you try to use &#8220;Bauhaus Medium BT.ttf&#8221;, the &#8220;CustomFontName&#8221; should be &#8220;Bauhaus Md BT&#8221;, no extension &#8220;.ttf&#8221; is needed. You need to install the font in your system to find out what name it is. Some fonts have 2 names, you may need FontForge to find out and try which one works.</li>
<li>So far I found out that both ttf and otf format work out of the box. I haven&#8217;t tested other font formats yet.</li>
</ol>
<p>*Points 1-6 credit to http://blog.beefyapps.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/custom-fonts-in-ios4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>iBeer, Another iPhone Toy</title>
		<link>http://shang-liang.com/blog/ibeer-another-iphone-toy/</link>
		<comments>http://shang-liang.com/blog/ibeer-another-iphone-toy/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 06:11:52 +0000</pubDate>
		<dc:creator>Shang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=71</guid>
		<description><![CDATA[Looks really fun! This one is definitely done in Objective-C.]]></description>
			<content:encoded><![CDATA[<p><a title="iphone application ibeer" href="http://www.hottrixdownload.com/secure/iBeer/iBeer.html">Looks really fun</a>!</p>
<p>This one is definitely done in Objective-C.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/ibeer-another-iphone-toy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>vikingsmackdown.com Brilliant Simple Idea</title>
		<link>http://shang-liang.com/blog/vikingsmackdowncom-brilliant-simple-idea/</link>
		<comments>http://shang-liang.com/blog/vikingsmackdowncom-brilliant-simple-idea/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 07:30:01 +0000</pubDate>
		<dc:creator>Shang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone web app]]></category>

		<guid isPermaLink="false">http://shang-liang.com/blog/?p=70</guid>
		<description><![CDATA[Developing iPhone stuff with Cocoa, Objective-C and xCode? Take a look at www.vikingsmackdown.com. If you don&#8217;t have an iPhone, you can view the video in this article from TechChurch. I thought it was built with the accelerometer and stuff but it was just JavaScript! It listens to a Safari browser event, &#8220;onorientationchange&#8221;. So technically, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Developing iPhone stuff with <span> Cocoa, Objective-C and xCode? Take a look at <a title="Viking Smack Down iphone vikingsmackdown" href="http://www.vikingsmackdown.com" target="_blank">www.vikingsmackdown.com</a>. If you don&#8217;t have an iPhone, you can view the video in <a title="iphone viking smak down vikingsmackdown" href="http://www.techcrunch.com/2008/07/07/viking-smackdown-the-motion-sensing-iphone-game-thats-already-out/">this article from TechChurch</a>.<br />
</span></p>
<p>I thought it was built with the <span>accelerometer and stuff but it was just JavaScript! It listens to a <a title="iphone javascript event orientation window" href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/chapter_8_section_6.html">Safari browser event</a>, &#8220;onorientationchange&#8221;. So technically, it&#8217;s not motion sensing. It&#8217;s a very old <a title="javascript onresize event" href="http://www.w3schools.com/jsref/jsref_onresize.asp">JavaScript event &#8220;onresize&#8221;</a>. All other phones with a rotatable browser can also implement this diea.<br />
</span></p>
<p>More information of developing JavaScript based applications or games can be found at <a title="apple iphone web application" href="http://developer.apple.com/webapps/">Apple Web Apps DevCenter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://shang-liang.com/blog/vikingsmackdowncom-brilliant-simple-idea/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

