<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>JongAm's blog</title>
	<atom:link href="http://jongampark.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jongampark.wordpress.com</link>
	<description>Something About Programming</description>
	<pubDate>Sat, 23 Aug 2008 07:22:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Abstract classes in Cocoa</title>
		<link>http://jongampark.wordpress.com/2008/08/23/abstract-classes-in-cocoa/</link>
		<comments>http://jongampark.wordpress.com/2008/08/23/abstract-classes-in-cocoa/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 07:22:50 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=416</guid>
		<description><![CDATA[The Objective-C doesn&#8217;t provide any keyword for making a class abstract.
However, there are a few abtract classes.
What I know are :

NSObject
NSProxy
NSPreferencePane
NSView

What else can you think of?
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Objective-C doesn&#8217;t provide any keyword for making a class abstract.</p>
<p>However, there are a few abtract classes.</p>
<p>What I know are :</p>
<ol>
<li>NSObject</li>
<li>NSProxy</li>
<li>NSPreferencePane</li>
<li>NSView</li>
</ol>
<p>What else can you think of?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/416/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/416/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/416/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=416&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/08/23/abstract-classes-in-cocoa/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I need &#8220;Reveal in Finder&#8221; and browsing from window title bar on the Windows platform</title>
		<link>http://jongampark.wordpress.com/2008/08/15/why-i-need-reveal-in-finder-and-browsing-from-window-title-bar-on-the-windows-platform/</link>
		<comments>http://jongampark.wordpress.com/2008/08/15/why-i-need-reveal-in-finder-and-browsing-from-window-title-bar-on-the-windows-platform/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 03:05:09 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=409</guid>
		<description><![CDATA[Every platform has its good side and bad side. With recognition of that, I prefer Mac platform with good reason. Big features are easy to be appreciated. However there are very small features people forget but very beneficial.
Because I use the Visual C++ very frequently, the most lacking feature on Windows I can acknowledge are [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Every platform has its good side and bad side. With recognition of that, I prefer Mac platform with good reason. Big features are easy to be appreciated. However there are very small features people forget but very beneficial.</p>
<p>Because I use the Visual C++ very frequently, the most lacking feature on Windows I can acknowledge are :</p>
<ol>
<li>Reveal in Finder</li>
<li>Browsing from the title bar</li>
</ol>
<div>The first feature, Reveal in Finder, relieves headache of opening the Explorer window and browsing it. Try locating a source file or a built binary in the Explorer. You know where they are. So, you browse into the folder which contains the files. However, how many steps do you need? Also, one thing bad on Windows platform is that it can&#8217;t handle two different files with the same name. Especially with the VC++, it is somewhat difficult and inconvenient to confirm where the file is.  It depends on how to setup &#8220;window display&#8221; mode. If you use the tab mode, it is easy. You just need to put the mouse pointer on the tab. Then it will display the path. However, if you choose the other option, it can&#8217;t.</div>
<div>However, on the Mac OS X, almost all programs support &#8220;Reveal in Finder&#8221;. If you choose a file in the Xcode project or the iTunes and choose &#8220;Reveal in Finder&#8221;, it will open the folder in which the file is and it automatically select the file for you. Also, some supports &#8220;Open the containing folder&#8221;. It is almost same.</div>
<div>With this feature, you don&#8217;t need to open as many folder window, because you can always access that folder very easily. Especially when there are so many different projects, you will appreciate the feature. Take a look at my drive.</div>
<div></div>
<div><img class="aligncenter size-medium wp-image-414" src="http://jongampark.files.wordpress.com/2008/08/myprojects.jpg?w=300&h=196" alt="" width="300" height="196" /></div>
<div></div>
<div>Second one, which is &#8220;browsing from the title bar&#8221;, is also very useful. Let&#8217;s say that you open a file in the MS Word. You want to know where the file is. Probably you want to check other files there also. Then &#8220;comand+click&#8221; on the title bar which displays the file name. Then you can browse into one of its containing folders. Very handy, isn&#8217;t it?</div>
<div>On the Windows, MS Office products have one serious defect. If there are two files with the same name, you can&#8217;t open the other file, when you already open one. In that case, you sometimes don&#8217;t know which file you opened. If the Windows supports the two really good features of the Mac OS X, there will be no such confusion.</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/409/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/409/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/409/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=409&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/08/15/why-i-need-reveal-in-finder-and-browsing-from-window-title-bar-on-the-windows-platform/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>

		<media:content url="http://jongampark.files.wordpress.com/2008/08/myprojects.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Where is the lock icon used for authorization on Mac OS X?</title>
		<link>http://jongampark.wordpress.com/2008/08/15/where-is-the-lock-icon-used-for-authorization-on-mac-os-x/</link>
		<comments>http://jongampark.wordpress.com/2008/08/15/where-is-the-lock-icon-used-for-authorization-on-mac-os-x/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 07:12:09 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=405</guid>
		<description><![CDATA[Have you ever tried finding the lock icon you can see on Energy Savor system preference on your Mac?
I tried using it for my program, but I couldn&#8217;t find it. The reason I want to use it is to enforce root/admin privilege for changing some preference. So, it is quite suitable to use that icon.
I [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Have you ever tried finding the lock icon you can see on Energy Savor system preference on your Mac?</p>
<p>I tried using it for my program, but I couldn&#8217;t find it. The reason I want to use it is to enforce root/admin privilege for changing some preference. So, it is quite suitable to use that icon.</p>
<p>I found out that how it can be used in the <a href="http://developer.apple.com/documentation/Security/Reference/SecurityInterfaceFramework/Classes/SFAuthorizationView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40002003-4355">SFAuthorizationView class reference</a>.</p>
<p> </p>
<p style="text-align:center;"><img class=" aligncenter" src="http://developer.apple.com/documentation/Security/Reference/SecurityInterfaceFramework/Classes/SFAuthorizationView_Class/Art/authview.gif" alt="Lock" width="324" height="180" /></p>
<p>It is very interesting. Is there any other view class which draws an image for itself?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/405/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/405/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=405&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/08/15/where-is-the-lock-icon-used-for-authorization-on-mac-os-x/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>

		<media:content url="http://developer.apple.com/documentation/Security/Reference/SecurityInterfaceFramework/Classes/SFAuthorizationView_Class/Art/authview.gif" medium="image">
			<media:title type="html">Lock</media:title>
		</media:content>
	</item>
		<item>
		<title>Interprocess communication : AppleEvent, Notification, Remote Object, etc</title>
		<link>http://jongampark.wordpress.com/2008/08/12/interprocess-communication-appleevent-notification-remote-object-etc/</link>
		<comments>http://jongampark.wordpress.com/2008/08/12/interprocess-communication-appleevent-notification-remote-object-etc/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 04:48:03 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=403</guid>
		<description><![CDATA[On a Macintosh, there are many ways to communicate among different processes.

AppleEvents
Notification (Distributed Notification)
Remote Object (Distributed Object)
Shared memory
Pipe
Socket

The first 3s are supported by the Objective-C or the Cocoa, while the latter 3s are supported by the Unix foundation. 
Have you ever wondered why there are so many different mechanism and what to use? Why doesn&#8217;t Apple [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>On a Macintosh, there are many ways to communicate among different processes.</p>
<ul>
<li>AppleEvents</li>
<li>Notification (Distributed Notification)</li>
<li>Remote Object (Distributed Object)</li>
<li>Shared memory</li>
<li>Pipe</li>
<li>Socket</li>
</ul>
<div>The first 3s are supported by the Objective-C or the Cocoa, while the latter 3s are supported by the Unix foundation. </div>
<div>Have you ever wondered why there are so many different mechanism and what to use? Why doesn&#8217;t Apple document explain about them more explicitly? </div>
<div></div>
<div>Although I have my own opinion for that question, I found one in <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/PreferencePanes/Concepts/Managing.html">the Preferece Pane document from the Apple Inc</a>. It is not solely for explaining when to use what and how they differ, but they are described in that way.</div>
<div></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/403/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/403/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=403&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/08/12/interprocess-communication-appleevent-notification-remote-object-etc/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>NSValue and non-object types</title>
		<link>http://jongampark.wordpress.com/2008/08/07/nsvalue-and-non-object-types/</link>
		<comments>http://jongampark.wordpress.com/2008/08/07/nsvalue-and-non-object-types/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 04:08:46 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=397</guid>
		<description><![CDATA[When you want to use the collections of the Cocoa for storing non-object types, NSValue and NSNumber are very useful. NSNumber is a child class of the NSValue, and therefore the NSValue has more flexibility.
Let&#8217;s take look at the description on what the NSValue can do :
An NSValue object is a simple container for a [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you want to use the collections of the Cocoa for storing non-object types, NSValue and NSNumber are very useful. NSNumber is a child class of the NSValue, and therefore the NSValue has more flexibility.<br />
Let&#8217;s take look at the description on what the NSValue can do :</p>
<blockquote><p>An NSValue object is a simple container for a <strong><span style="color:#800000;">single C or Objective-C data item</span></strong>. It can hold any of the <strong><span style="color:#800000;">scalar types</span></strong> such as int, float, and char, as well as<strong><span style="color:#800000;"> pointers, structures, and object ids</span></strong>. The purpose of this class is <span style="color:#800000;"><strong>to allow items of such data types to be added to collection objects</strong></span> such as instances of NSArray or NSSet, which require their elements to be objects. NSValue objects are<strong><span style="color:#800000;"> </span><span style="color:#008000;">always immutable</span></strong>.</p></blockquote>
<p>So, the following code is possible.</p>
<pre name="code" class="c++">

// assume ImaginaryNumber defined:
typedef struct {
float real;
float imaginary;
} ImaginaryNumber;

ImaginaryNumber miNumber;
miNumber.real = 1.1;
miNumber.imaginary = 1.41;

NSValue *miValue = [NSValue value: &amp;amp;amp;amp;miNumber
withObjCType:@encode(ImaginaryNumber)]; // encode using the type name

ImaginaryNumber miNumber2;
[miValue getValue:&amp;amp;amp;amp;miNumber2];
</pre>
<p>Impressive, isn&#8217;t it?<br />
However, Apple&#8217;s document has a one strange line of explanation which is somewhat ambiguous.</p>
<blockquote><p>Note that the type you specify <span style="color:#800000;"><strong>must be of constant length</strong></span>. You <strong><span style="color:#800000;">cannot</span></strong> store C strings, <strong><span style="color:#800000;">variable-length arrays and structures</span></strong>, and other data types of indeterminate length in an NSValue—you should use NSString or NSData objects for these types. You can store a pointer to variable-length item in an NSValue object.</p></blockquote>
<p>What does that mean? What if your data is not variable length? Will it be stored correctly?</p>
<pre name="code" class="c++">

typedef struct {
int dataSize;
char *data;
int year;
} myStructType1;
</pre>
<p>When the data points to a character array, will it be encoded correctly?<br />
This is easy to answer. It is variable length. So, the content the data points to is not encoded.<br />
Only the address is encoded. So, if you write a publisher thread which encodes the type and releases allocated memory space for the data, and a consumer thread which decode it to retrieve original data, the decoded myStructType1 instance only contains the address for the data, not the content. So, don&#8217;t expect it would store the data. For the purpose, use NSData or NSArchiver.</p>
<p>How about this example?</p>
<pre name="code" class="c++">

typedef struct {
int age;
int month;
int day;
} innerType;

typedef struct {
int dataSize;
innerType *innerData;
} myStructType2;
</pre>
</pre>
<p> <br />
Well.. the innerType is sort of non-variable-length type. So, will it be encoded correctly?<br />
No. Apple&#8217;s document is not clear on this. It also encode the address not the content.<br />
So, in this case, you also need to use the NSData.<br />
So, try using the NSValue to convert struct without any member which is a pointer to some other structure.</p>
<p>Then how the NSValue stores? It is kind of shallow copy. Please read this.</p>
<blockquote><p>Here the address of myCString is passed (&amp;myCString), so the address of the first character of the string is stored in theValue. Note that the NSValue object <strong><span style="color:#800000;">doesn’t copy the contents of the string, but the pointer itself</span></strong>. <span style="color:#800000;"><strong>If you create an NSValue object with an allocated data item, don’t deallocate its memory while the NSValue object exists</strong></span>.</p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/397/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/397/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/397/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=397&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/08/07/nsvalue-and-non-object-types/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Helpers for debugging memory allocation/deallocation</title>
		<link>http://jongampark.wordpress.com/2008/07/31/helpers-for-debugging-memory-allocationdeallocation/</link>
		<comments>http://jongampark.wordpress.com/2008/07/31/helpers-for-debugging-memory-allocationdeallocation/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 05:12:09 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=393</guid>
		<description><![CDATA[Today, I posted a long question to the cocoa mailing list of the Apple Computer. At that time, I was thinking about 3 different things at the same time, so my question was not quite correct.
By the way, one guy there told me about an environmental variable which helps memory debugging.

MallocScribble : if set, released [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today, I posted a long question to the cocoa mailing list of the Apple <del datetime="00">Computer</del>. At that time, I was thinking about 3 different things at the same time, so my question was not quite correct.</p>
<p>By the way, one guy there told me about an environmental variable which helps memory debugging.</p>
<ol>
<li>MallocScribble : if set, released memory block will be filled with 0&#215;55</li>
<li>MallocPreScribble : if set, newly allocated block will be filled with 0xAA</li>
<li>MallocGuardEdges : It is like MS&#8217;s no-men&#8217;s-land</li>
</ol>
<p>For more, please read <a href="http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html">Memory Usage Performance Guidelines: Enabling the Malloc Debugging Features</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/393/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/393/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=393&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/31/helpers-for-debugging-memory-allocationdeallocation/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Shallow copy or Deep Copy with NSValue</title>
		<link>http://jongampark.wordpress.com/2008/07/31/shallow-copy-or-deep-copy-with-nsvalue/</link>
		<comments>http://jongampark.wordpress.com/2008/07/31/shallow-copy-or-deep-copy-with-nsvalue/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 05:01:24 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=391</guid>
		<description><![CDATA[This is very important issue in memory management in Cocoa. About 10 years ago, I didn&#8217;t worry about this issue much, because at that time things were clear and API were not that complicated. However, it is not true any more. Due to performance issues, copying memory is avoided if possible, and in that case [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is very important issue in memory management in Cocoa. About 10 years ago, I didn&#8217;t worry about this issue much, because at that time things were clear and API were not that complicated. However, it is not true any more. Due to performance issues, copying memory is avoided if possible, and in that case shallow copy is prefered. ( Nowadays, even weak reference or strong reference should be considered also. )</p>
<p>Collections in Cocoa are usually shallow-copy-based, if a programmers want it in the other way. Apple prepares deep copy option for those users.</p>
<p>Then, how about NSValue and NSNumber? Recently I started using these two classes heavily. They are used to make opaque types like int, float, or other C structures work with the Cocoa collections. Any objects based on NSObject can be put into collections. However the primitive types can&#8217;t be. So, they should be wrapped in NSValue and NSNumber. How to do so is shown below.</p>
<pre name="code" class="c++">

typedef struct complexTypeConveyer
{
	int dataSize;
	int year;
	int tag;
} complexTypeConveyer;

// Move to the conveyer
complexTypeConveyer *theConveyer = (complexTypeConveyer *)malloc(sizeof(complexTypeConveyer));;
	theConveyer-&gt;dataSize = dataSet.dataSize;
	theConveyer-&gt;year = dataSet.year;
	theConveyer-&gt;tag = dataSet.tag;

NSValue *aValue = [NSValue valueWithBytes:theConveyer objCType:@encode(complexTypeConveyer)];
</pre>
<p>The [NSValue valueWithBytes: objCType:] is a kind of a convenience method. You don&#8217;t need to wrap each data member of a given data structure.<br />
I will post a separate article on this, because it has some issues with pointers pointing to other structures.</p>
<p>Then, how will the data be kept? It is self-contained, or in other words, the data, theConveyer holds, are <del datetime="00">deep-copied</del> shallow-copied. But Apple&#8217;s document doesn&#8217;t clearly mention it. So, test it for yourself and check if things work as you want.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/391/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/391/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=391&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/31/shallow-copy-or-deep-copy-with-nsvalue/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>When [pool release] causes BAD_ACCESS error</title>
		<link>http://jongampark.wordpress.com/2008/07/30/when-pool-release-causes-bad_access-error/</link>
		<comments>http://jongampark.wordpress.com/2008/07/30/when-pool-release-causes-bad_access-error/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 04:09:57 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Debugging]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=382</guid>
		<description><![CDATA[The Objective-C 2.0 introduced a garbage collector. It is nice and very simple to use.
However, I still prefer old style, release, retain, copy model. The reason is simple. You can control when to retain and release object. By doing so, you can manage memory more well. I don&#8217;t think old style is difficult to understand.
However, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Objective-C 2.0 introduced a garbage collector. It is nice and very simple to use.</p>
<p>However, I still prefer old style, release, retain, copy model. The reason is simple. You can control when to retain and release object. By doing so, you can manage memory more well. I don&#8217;t think old style is difficult to understand.</p>
<p>However, when you are involved in a group project in which a few programmers join, you don&#8217;t know how others write memory related codes. In such a case, garbage collection can be better.</p>
<p>Anyway, when making threads, you are supposed to make a dedicated memory pool for yourself. In the end of such thread function, you should issue :</p>
<pre name="code" class="c++">

[pool release];
</pre>
<p>However, it can raises BAD_ACCESS_EXE exception. Why? It is because certain objects are released to much. Especially when you deal with collections, this can happen, because Apple&#8217;s explanation when objects are retained, just referenced, or copied is not clear sometimes.</p>
<p>How to figure out which causes the exception and where it happens?</p>
<p>There are good documentation on the issue.</p>
<ol>
<li><a title="How to debug those random crashes in your Cocoa app" rel="bookmark" href="http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/">Instruments on Leopard: How to debug those random crashes in your Cocoa app</a></li>
<li><a href="http://www.cocoadev.com/index.pl?DebuggingAutorelease">CocoaDev Debugging Autorelease</a></li>
</ol>
<div>To make things short, I would like to mention that NSZombie is crucial here.</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/382/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/382/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/382/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=382&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/30/when-pool-release-causes-bad_access-error/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Unicode Normalization and NSString</title>
		<link>http://jongampark.wordpress.com/2008/07/21/unicode-normalization-and-nsstring/</link>
		<comments>http://jongampark.wordpress.com/2008/07/21/unicode-normalization-and-nsstring/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 02:00:27 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=380</guid>
		<description><![CDATA[Although I use Korean everyday, I didn&#8217;t have enough chance to figure out how the Unicode is actually designed.
The Mac OS X supports the Unicode, and when they say &#8220;Unicode&#8221;, it usually means the UTF-16, which is a 2 byte version of the Unicode.
One day I noticed a strange symptom. An NSString made with &#8220;자연&#8221; [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Although I use Korean everyday, I didn&#8217;t have enough chance to figure out how the Unicode is actually designed.</p>
<p>The Mac OS X supports the Unicode, and when they say &#8220;Unicode&#8221;, it usually means the UTF-16, which is a 2 byte version of the Unicode.</p>
<p>One day I noticed a strange symptom. An NSString made with &#8220;자연&#8221; looked different from the same one in an FCP project file.</p>
<p>I wonder why and asked to the Apple&#8217;s Cocoa mailing list.</p>
<p>I got an answer from Ken Thomas and he suggested to check Unicode normalization.</p>
<p>Here is the link :</p>
<p><a href="http://unicode.org/reports/tr15/">Unicode Standard Annex #15<br />
Unicode Normalization Forms</a></p>
<p>There are 4 different way of representing Unicode.</p>
<ol>
<li>Normalization Form D (NFD)</li>
<li>Normalization Form C (NFC)</li>
<li>Normalization Form KD (NFKD)</li>
<li>Normalization Form KC (NFKC)</li>
</ol>
<p>Form D means Canonical &#8220;D&#8221;ecomposition, while Form C means Canonical &#8220;C&#8221;omposition.<br />
The K in KD and KC mean &#8220;Compatibility&#8221;.<br />
The link above explains what they are very well using pictures. So, take a look at it.</p>
<p>Now, you will be able to understand what -precomposed.. and -decomposed.. mean in the NSString documentation for these methods.</p>
<ol>
<li>-precomposedStringWithCanonicalMapping : Form C</li>
<li>-precomposedStringWithCompatibilityMapping : Form KC</li>
<li>-decomposedStringWithCanonicalMapping : Form D</li>
<li>-decomposedStringWithCompatibilityMapping : Form KD</li>
</ol>
<p>There are two additional issues I would like to mention.<br />
<strong><span style="color:#800000;"> First</span></strong>, we know that the Mac OS X uses Unicode natively. However which Unicode representation does it use?</p>
<p>- (const char*)fileSystemRepresentation of the NSString and - (const char*)fileSystemRepresentationWithPath:(NSString *)path returns the file name in Unicode in a way the MacOS X uses.</p>
<p>It is said to be mostly decomposed version. So, when you try opening a file by choosing one using NSOpenPanel, it would contain the string in decomposed way.</p>
<p><strong><span style="color:#800000;">Second</span></strong>&#8230; then how we compare two Unicode strings? I guess we should take care of the two cases. But, the NSString is smart enought to handle them for us.</p>
<p>The compare: methods of the NSString can accept whatever forms and it can compare a composed version with a decomposed version. If the twos are actually for the same characters or words, it returns NSOrderedSame, which means that they are the same.</p>
<p>Impressive, isn&#8217;t it?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/380/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/380/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=380&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/21/unicode-normalization-and-nsstring/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>han9kin doesn&#8217;t exist</title>
		<link>http://jongampark.wordpress.com/2008/07/19/han9kin-doesnt-exist/</link>
		<comments>http://jongampark.wordpress.com/2008/07/19/han9kin-doesnt-exist/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 18:28:28 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=376</guid>
		<description><![CDATA[I added han9kin&#8217;s blog to the link list on the side.
  I got to know han9kin at http://www.osxdev.org. He wrote a Korean input method with the Carbon TSM and is now implementing another one with IMKit for the Leopard, Hanulim, which means big consonance. The Han, 韓, has meant &#8220;big&#8221;, &#8220;great&#8221;. Korean people is [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I added han9kin&#8217;s blog to the link list on the side.</p>
<p> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I got to know han9kin at http://www.osxdev.org. He wrote a Korean input method with the Carbon TSM and is now implementing another one with IMKit for the Leopard, Hanulim, which means big consonance. The Han, 韓, has meant &#8220;big&#8221;, &#8220;great&#8221;. Korean people is 韓民族, while pure Chinese is 漢. Same pronounciation in Korean, but different meaning. Han9kin can be understood as Han 9k in.</p>
<p>You can check the Hanulim project at http://code.google.com/p/hanulim/</p>
<p>9 sounds like Goo. By adding K, it becomes Gook. in is pronounced as &#8220;in&#8221;. In is 人. The Republic of Korea&#8217;s official name in Korean is 大韓民國, or 韓國 in short, and it is the pronouciation of Han9k. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, he made his nick name on the Internet very wisely and smart. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> han9kin means a Korean, i.e a Korean people.</p>
<p>By the way, 韓 is originally same to 桓. Currently students from element school to high school are tought that Korea&#8217;s first country is Go-Cho-Sun, meaning Old Chosun, but it is twisted history by Japanese during the japanese reign. Before that there were, 桓國 and 伸市. It is almost 15,000 years ago, but more archaeological evidence are being found and archaeologists say that Korea&#8217;s history can be much longer.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/376/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/376/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=376&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/19/han9kin-doesnt-exist/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>NSImage setSize and setScaleWhenResized</title>
		<link>http://jongampark.wordpress.com/2008/07/19/nsimage-setsize-and-setscalewhenresized/</link>
		<comments>http://jongampark.wordpress.com/2008/07/19/nsimage-setsize-and-setscalewhenresized/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 17:51:52 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Objective-C/Cocoa]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=370</guid>
		<description><![CDATA[The setSize of NSImage behaves differently on the Leopard and the Tiger.
According to the NSImage class reference for the Leopard, it says :
&#8220;Changing the size of an NSImage after it has been used effectively resizes the image.&#8221;
It behaves as such on the Leopard, but not on the Tiger.
On the Tiger, the setSize doesn&#8217;t resize an [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The setSize of NSImage behaves differently on the Leopard and the Tiger.<br />
According to the NSImage class reference for the Leopard, it says :</p>
<p>&#8220;Changing the size of an NSImage after it has been used effectively resizes the image.&#8221;</p>
<p>It behaves as such on the Leopard, but not on the Tiger.<br />
On the Tiger, the setSize doesn&#8217;t resize an image.</p>
<p>Take a look at the source code below.</p>
<pre name="code" class="c++">

NSImage *anImage;
NSSize imageSize;
NSString *imagePath;

imagePath = [[NSBundle mainBulde] pathForImageResource:@&quot;myLogo.eps&quot;];
anImage = [[NSImage alloc] initWithContentsOfFile:imagePath];
imageSize = [anImage size];
imageSize.width *= 0.3;
imageSize.height *= 0.3;
[anImage setScaleWhenResized:YES]; // For the Tiger
[anImage setSize:imageSize];
</pre>
<p>The eps format is a postscript format with which a scaling can be used.<br />
The Leopard version of the setSize method of the NSImage automatically scales and draws the image as such.<br />
However, on the Tiger the setScaleWhenResized with YES as its parameter should be explicitly called.<br />
Documentation for the Tiger explains this much better.</p>
<p>For other approaches, <a href="http://weblog.scifihifi.com/2005/06/25/how-to-resize-an-nsimage/">Sci-Fi Hi-Fi hosted a good article</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/370/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/370/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=370&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/19/nsimage-setsize-and-setscalewhenresized/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Differences in function name decoration for the Leopard and pre-Leopard</title>
		<link>http://jongampark.wordpress.com/2008/07/18/differences-in-function-name-decoration-for-the-leopard-and-pre-leopard/</link>
		<comments>http://jongampark.wordpress.com/2008/07/18/differences-in-function-name-decoration-for-the-leopard-and-pre-leopard/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 02:51:18 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=368</guid>
		<description><![CDATA[From the Mac OS X 10.5, or the Leopard, the function name decoration for standard C functions were changed. It is not only for the Mac, but also for other Unices also.
When I took over other&#8217;s project, he set the SDK to use to MAC OS X 10.5 on the Xcode project setting, while he [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>From the Mac OS X 10.5, or the Leopard, the function name decoration for standard C functions were changed. It is not only for the Mac, but also for other Unices also.<br />
When I took over other&#8217;s project, he set the SDK to use to MAC OS X 10.5 on the Xcode project setting, while he set the Deployment target to Mac OS X 10.4.<br />
The reason was that there was an external library built from a console, and with the 10.4 SDK it threw linking errors like :</p>
<blockquote><p>_fnctl<span style="color:#800000;"><strong>$UNIX2003</strong></span> can&#8217;t be found</p></blockquote>
<p>Why? Because it uses the external library was built without the -mmacosx-version-min=10.4, it is linked to standar library with the new convention for which $UNIX2003 postfix is appended.<br />
( Please cf. my previous post on building universal binary for configure based Unix project for this. Apple didn&#8217;t update their tech note page for the Leopard.)</p>
<p>So, if you want to build external libraries from the console, try this instead :</p>
<blockquote><p>export CFLAGS=&#8221;-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 <span style="color:#800000;"><strong>-mmacosx-version-min=10.4</strong></span>&#8220;<br />
export LDFLAGS=&#8221;-arch i386&#8243;<br />
sudo ./configure &#8211;prefix=/opt/local <span style="color:#800000;"><strong>&#8211;disable-dependency-tracking</strong></span></p></blockquote>
<p>I should mention two important things here.</p>
<p>1. If you build it on a Tiger machine, you don&#8217;t need to use the -mmacosx-version-min=10.4. It will use the latest version as its base target.<br />
So, it is linked for the Tiger. However, if you build the source code on a Leopard machine, you should use the option. You may shout, &#8220;Of course&#8221;, here.</p>
<p>2. Please take a look at the first two lines where the CFLAGS and LDFLAGS are set. I used only -arch i386. They were set on a Leopard machine. There was something odd on a Tiger machine to build a Universal Binary version of the external library.<br />
I expected that it is OK and enough to use &#8220;-arch i386 -arch ppc&#8221; to build a Universal Binary version of the library.</p>
<p>However, I found out that the generated Intel binary code on a PPC Tiger was different from that built on a Intel Leopard machine. They stripped codes differently. So, on the Tiger machine, the compiler stripped its static functions more aggressively for the Intel architecture.</p>
<p>So, I had to build a PPC version on a PPC Tiger machine and an Intel version on a Intel Leopard machine separately and combined them using the lipo.<br />
(Is there any switch which controls how much it strips codes? Why the default behaviour is so different? I tried fidning those at the GCC web site, but I couldn&#8217;t find one unfortunately.)</p>
<p>Also, the PowerPC binary generated on a Intel Leopard looked different from that on a PPC Tiger machine. That is why I asked question, &#8220;[Q] Is the 10.4u SDK distributed for the Intel Mac and the PPC Mac different?&#8221;, to the cocoa mailing list around July, 27, 2008.</p>
<p>So, let&#8217;s go back to the topic where we started.<br />
So, by compiling the external library correctly, you can change the SDK setting on the Project setting to Mac OS X 10.4, and it compiles successfully.<br />
I would like to mention, especially to Xcode beginners, that the Deployment Target setting should be used carefully and it is not for targeting some specific version of Mac OS X when a highest version of the Mac OS X SDK is used.<br />
I don&#8217;t like the name, &#8220;Deployment Target&#8221;. It misleads people very easily. It is sort of &#8220;Deployment Target&#8221;, but it is different from what people can easily imagine what it is for.</p>
<p>Almost all people upgraded from 10.0 through 10.3 Panther to 10.4 Tiger.<br />
Because the 10.4 Tiger is quite complete version compared to its predecessors and quite reliable, I think there are still many companies which make their product for the Tiger.<br />
Indeed, it is better to write programs which can run on the Tiger and the Leopard at the same time without changing the source codes.<br />
(It is one of the reason I don&#8217;t use Objective-C 2.0 addition.) The Panther is also a stable version. I don&#8217;t know how many people still use the 10.3 Panther.<br />
Apple still provides 10.3 SDK for the latest XCode 3.1. So, I guess there are still many.<br />
But in my case I&#8217;m OK to consider only the 10.4. Anyway, point is that it is better to keep old machines for development and test purpose.<br />
My 1Ghz iMac 17&#8243; machine is still my main machine and it handles playing movies while it is downloading Korean soap operas and &#8220;History Special&#8221; program using P2P.<br />
At the same time, I write codes on it and check email. The PowerPC tends to have better throughput, so it handles all of those very nicely and smoothly.<br />
The only exception is to play HD clips with huge dimension and VC-1 clips. (Probably it is because the VC-1 decoder from the ffmpeg is not optimized enought yet.)<br />
So, there are many good reason to keep the old machine!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/368/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/368/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/368/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=368&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/18/differences-in-function-name-decoration-for-the-leopard-and-pre-leopard/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Poll : Who read articles here at JongAm&#8217;s blog?</title>
		<link>http://jongampark.wordpress.com/2008/07/15/poll-who-read-articles-here-at-jongams-blog/</link>
		<comments>http://jongampark.wordpress.com/2008/07/15/poll-who-read-articles-here-at-jongams-blog/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 05:02:04 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=366</guid>
		<description><![CDATA[Hello, all.
I was quite busy recently and had no chance to post any new story here.
I had things to write but I doubt if I can even remember them.  
By the way, I would like to know who read my post and what you do.
I do notice some Koreans visit by looking at the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hello, all.</p>
<p>I was quite busy recently and had no chance to post any new story here.</p>
<p>I had things to write but I doubt if I can even remember them. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>By the way, I would like to know who read my post and what you do.</p>
<p>I do notice some Koreans visit by looking at the search terms. Are you a Korean living in the US? Or visiting from Korea? What do you think about my blog? Do you want Windows stuff or Mac stuff? Or even Unix stuff?</p>
<p>Do you want some development related gossip or idea as well as things about coding?</p>
<p>Is there anything you want to tell me?</p>
<p>I appreciate any comment except for some flames.</p>
<p><strong><span style="color:#800000;">Updated</span></strong> : OK.. So, han9kin is the only one who visit my site! And others can be just bots. The number of visitors monthly exceeds 1000 now, so I wanted to know who are interested in my blog and what they expected and how they think about it, i.e. my bad English, and so on. If there are people who want to leave any comment, I welcome you always!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/366/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/366/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=366&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/15/poll-who-read-articles-here-at-jongams-blog/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>NSViewController</title>
		<link>http://jongampark.wordpress.com/2008/07/15/nsviewcontroller/</link>
		<comments>http://jongampark.wordpress.com/2008/07/15/nsviewcontroller/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 04:54:47 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=364</guid>
		<description><![CDATA[NSViewController was introduced from the Leopard, but even Apple&#8217;s document doesn&#8217;t explain why it was added and what it is for.
Here at KATI blog, there is a good background information on the NSViewController.
NSViewController, the New C in MVC - Pt. 1 of 3
NSViewController, the New C in MVC - Pt. 2 of 3
NSViewController, the New [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>NSViewController was introduced from the Leopard, but even Apple&#8217;s document doesn&#8217;t explain why it was added and what it is for.</p>
<p>Here at KATI blog, there is a good background information on the NSViewController.</p>
<p><a href="http://katidev.com/blog/2008/04/09/nsviewcontroller-the-new-c-in-mvc-pt-1-of-3/">NSViewController, the New C in MVC - Pt. 1 of 3</a></p>
<p><a href="http://katidev.com/blog/2008/04/17/nsviewcontroller-the-new-c-in-mvc-pt-2-of-3/">NSViewController, the New C in MVC - Pt. 2 of 3</a></p>
<p><a href="http://katidev.com/blog/2008/05/26/nsviewcontroller-the-new-c-in-mvc-pt-3-of-3/">NSViewController, the New C in MVC - Pt. 3 of 3</a></p>
<p>I would like to thank  Stefan Arentz, who told me about the link and also to Cathy Shive who is the owner of the KATI blog for the good article.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/364/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/364/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=364&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/07/15/nsviewcontroller/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a library in Universal Binary format</title>
		<link>http://jongampark.wordpress.com/2008/06/27/building-a-library-in-universal-binary-format/</link>
		<comments>http://jongampark.wordpress.com/2008/06/27/building-a-library-in-universal-binary-format/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 05:22:47 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=361</guid>
		<description><![CDATA[The Apple Inc. put nice documents on building a Unix program as a Universal Binary format.

Building Universal Binaries from &#8220;configure&#8221;-based Open Source Projects
Building an Open Source Universal Binary

The 1st one is for Unix geek, while the 2nd one is for IDE addicts.
Each has its own pros and cons.

    The 1st one doesn&#8217;t require a project [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Apple Inc. put nice documents on building a Unix program as a Universal Binary format.</p>
<ul>
<li><a href="http://developer.apple.com/technotes/tn2005/tn2137.html">Building Universal Binaries from &#8220;configure&#8221;-based Open Source Projects</a></li>
<li><a href="http://developer.apple.com/opensource/buildingopensourceuniversal.html">Building an Open Source Universal Binary</a></li>
</ul>
<div>The 1st one is for Unix geek, while the 2nd one is for IDE addicts.</div>
<div>Each has its own pros and cons.</div>
<div></div>
<div>    The 1st one doesn&#8217;t require a project to be converted. However, it is pretty hard to figure out what is going on and what started being wrong. Things are scrolled up and text is written in the screen without any indentation or separation based on context.</div>
<div></div>
<div>    The 2nd one, on the other hand, uses the Xcode to compile. However, the Xcode just works as a shell to the configure script. You are making just a dummy project in which a script to invoke ./configure is in. What is more important aspect fundamentally here is that the 1st approach tries compile the source codes in one step. In its CFLAGS and LDFLAGS, you issue -arch ppc -arch i386. So, the gcc compiles source codes in combination of the two. And you don&#8217;t need a &#8220;merge&#8221; stage. However, the 2nd approach let the gcc compile and link the sources and the objects files for each architecture. You need to invoke the lipo to tie the two generated library or executable. </div>
<div>Which one do you like more? Well..as for the lipo approach, you can do it in the console also. So, you need to choose one according to convenience of building. Yeah.. the 1st approach seems to be easier. However, some open source projects cannot be built by the 1st approach. For example, the postgreSQL can&#8217;t be built by the 1st approach. It fails in compiling. I don&#8217;t know why. But somewhere I heard that they way the gcc optimize codes is different for the two approach.</div>
<div>    There is the 3rd one. It requires you some time to reorganize the source code structure or directory structure. (Not necessarily) So, you need to understand each and every configure script and Makefile contents. What you do here is to make a genuine Xcode project. Once things are done, it is much trouble-free than the 1st and the 2nd approach, because information is located where it can be easily found, like the property of projects, etc. Some people don&#8217;t like IDE-centric approach like this 3rd one. They usually say that it is inconvenient for batch-building. Well&#8230; not true. You can issue build command in a console window without running the Xcode.</div>
<div></div>
<div>OK, so far we thought about 3 ways of building very Unix-like project.</div>
<div>Now, I would like to fix something described in the Apple document.</div>
<div>For the 1st document mentioned above, there is something wrong for Leopard-era.</div>
<div>
<p><span style="color:#993300;"> env CFLAGS=&#8221;-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc&#8221; \<br />
LDFLAGS=&#8221;-arch i386 -arch ppc&#8221;   ./configure &#8211;prefix=${HOME}/Hello &#8211;disable-dependency-tracking </span></div>
<div>    You need to add -mmacosx-version-min=10.4, for example to the CFLAGS. On Leopard Intel Mac, the resultant binary size is very different from the case without the option, although the source code doesn&#8217;t use any Cocoa/Carbon framework. In default, the 10.5 leopard gcc seems to strip codes more aggressively. So, for some static functions, they can be removed although they are actually used.   Another thing I would like to mention is the -isysroot /Developer/SDKs/MacOSX10.4u.sdk.<br />
What the option means is that it will use the 10.4 universal SDK. It is very important to determine what version of the MacOS X is targetted. Even when the open source project doesn&#8217;t use any Cocoa functions, it is better to include that option. You can easily see that the file size is different between the two cases with and without the option.    </p>
<p>As a closure, I would like to mention that the 10.4u SDK seems to be different on PPC mac and Intel Mac. Although they are all 10.4u SDK, the result of compilation seems to be different. the one distributed with/for  Intel Mac doesn&#8217;t seem to be correct sometimes. I need to confirm this.</p>
<p> </p></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/361/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/361/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=361&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/27/building-a-library-in-universal-binary-format/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)</title>
		<link>http://jongampark.wordpress.com/2008/06/21/archs_standard_32_bit_pre_xcode_3_1/</link>
		<comments>http://jongampark.wordpress.com/2008/06/21/archs_standard_32_bit_pre_xcode_3_1/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 03:33:35 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=360</guid>
		<description><![CDATA[What is this? I found this setting in some project files obtained from someone else.
It sounds like that&#8230; The Xcode will support more than the Intel and PowerPC processors?
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>What is this? I found this setting in some project files obtained from someone else.</p>
<p>It sounds like that&#8230; The Xcode will support more than the Intel and PowerPC processors?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/360/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/360/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=360&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/21/archs_standard_32_bit_pre_xcode_3_1/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>On Interface Building..</title>
		<link>http://jongampark.wordpress.com/2008/06/21/on-interface-building/</link>
		<comments>http://jongampark.wordpress.com/2008/06/21/on-interface-building/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 02:29:57 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=358</guid>
		<description><![CDATA[    Probably I&#8217;m just the last one who find KATI : Developing Interfaces with Cocoa. I did not read the whole post yet, but I could feel that it is full of very good information.
I would like to put the link to the right side of my blog.
It is worth while to reading it!
 
   [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>    Probably I&#8217;m just the last one who find <a title="Developing Interface with Cocoa" href="http://katidev.com/blog/">KATI : Developing Interfaces with Cocoa</a>. I did not read the whole post yet, but I could feel that it is full of very good information.</p>
<p>I would like to put the link to the right side of my blog.</p>
<p>It is worth while to reading it!</p>
<p> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/358/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/358/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=358&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/21/on-interface-building/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>A few lines on how to use the NSXMLDocument</title>
		<link>http://jongampark.wordpress.com/2008/06/21/a-few-lines-on-how-to-use-the-nsxmldocument/</link>
		<comments>http://jongampark.wordpress.com/2008/06/21/a-few-lines-on-how-to-use-the-nsxmldocument/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 22:02:47 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Objective-C]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=357</guid>
		<description><![CDATA[&#160; &#160; &#160; &#160; Because I needed to retrieve information from a Final Cut Pro project file saved in XML format, I wrote some lines of code. But before doing so, to figure out what XQuery statement to use, I implemented a helper program to load a XML document and test some XQuery statement. Apple&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; Because I needed to retrieve information from a Final Cut Pro project file saved in XML format, I wrote some lines of code. But before doing so, to figure out what XQuery statement to use, I implemented a helper program to load a XML document and test some XQuery statement. Apple&#8217;s XMLBrowser sample was helpful, but it doesn&#8217;t show an input XML file and the result of XQuery side by side. </p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; So, I wrote one, and here I would like to the quick and dirty approach on how to use the NSXMLDocument.</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; The NSXMLDocument is a tree parser, while the Apple also provides an event parser. The tree parser provides very helpful method to manipulate an XML file. One of the good thing is XQuery. So, in this short codes, it sends query to the NSXMLDocumet.</p>
<pre name="code" class="c++">

- (IBAction)openXMLFile:(id)sender
{
    int result;
    NSArray *filetypes = [NSArray arrayWithObject:@&quot;xml&quot;];
    NSOpenPanel *oPanel = [NSOpenPanel openPanel];

    [oPanel setAllowsMultipleSelection:NO];

    result = [oPanel runModalForDirectory:NSHomeDirectory() file:nil types:filetypes];
    if ( result == NSOKButton) {
        NSString *aFile = [oPanel filename];
        [self createXMLDocumentFromFile:aFile];
        [sourceTextView setString:[NSString stringWithFormat:@&quot;%@&quot;, xmlDoc]];
    }

}

- (void)createXMLDocumentFromFile:(NSString *)file
{
    NSError *err = nil;

    NSURL *furl = [NSURL fileURLWithPath:file];
    if( !furl )
    {
        NSLog(@&quot;Can&#039;t create an URL from file %@.&quot;, file );
        return;
    }

    if( xmlDoc )
        [xmlDoc release];

    xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl options:(NSXMLNodePreserveWhitespace|NSXMLNodePreserveCDATA) error:&amp;err];
    if( xmlDoc == nil )
    {
        // in previous attempt, it failed creating XMLDocument because it
        // was malformed.
        xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:furl options:NSXMLDocumentTidyXML error:&amp;err];
    }
    if( xmlDoc == nil)
    {

        NSLog( @&quot;Error occurred while creating an XML document.&quot;);
//        if(err)
//            [self handleError:err];
    }
    else
        NSLog(@&quot;%@&quot;, xmlDoc);
}
</pre>
<p>And&#8230; here is the code to send XQuery statement to the NSXMLDocument</p>
<pre name="code" class="c++">

- (IBAction)executeQuery:(NSButton *)sender {

    [queryResultView setString:@&quot;&quot;];

    if ([queryTextView string] != nil) {
        NSError *error;
        NSArray *result = [xmlDoc objectsForXQuery:
             [queryTextView string] constants:nil error:&amp;amp;error];
        if (result) {
            unsigned count = [result count];
            unsigned i;
            NSMutableString *stringResult = [[NSMutableString alloc] init];
            for (i = 0; i &amp;lt; count; i++) {
                [stringResult appendString:
                    [NSString stringWithFormat:@&quot;%d: {\r&quot;, i]];
                [stringResult appendString:[[result objectAtIndex:i]
                    description]];
                [stringResult appendString:@&quot;\r}\r&quot;];
            }
            [queryResultView setString:stringResult];

            NSLog(@&quot;%@&quot;, stringResult);

            [stringResult release];
        } else if (error) {
            NSLog(@&quot;Error Occurred.&quot;);

            //[self handleError:error];
        }

    }

}
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/357/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/357/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=357&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/21/a-few-lines-on-how-to-use-the-nsxmldocument/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable Font and Format menu with the Interface Builder 3</title>
		<link>http://jongampark.wordpress.com/2008/06/16/how-to-enable-font-and-format-menu-with-the-interface-builder-3/</link>
		<comments>http://jongampark.wordpress.com/2008/06/16/how-to-enable-font-and-format-menu-with-the-interface-builder-3/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 04:06:45 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=356</guid>
		<description><![CDATA[    Within the MacOS X 10.5 Leopard there are a lot of new features included. Nobody, even the Apple, can&#8217;t enlist the feature set. They are from small enhancement to big additions. For example, the new dictionary can now be linked to some Korean dictionary, and so on. It searches words from the Wikipedia.
    However, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>    Within the MacOS X 10.5 Leopard there are a lot of new features included. Nobody, even the Apple, can&#8217;t enlist the feature set. They are from small enhancement to big additions. For example, the new dictionary can now be linked to some Korean dictionary, and so on. It searches words from the Wikipedia.</p>
<p>    However, no one seems to talk about the new additions in the Cocoa/Carbon framework or even the development tools. Cocoa Scripting Bridges, and so on.. There are lots of new things added. Some are new. But there are also something becoming bad.</p>
<p>    I didn&#8217;t care about the Font menu and Format menu before. Because those things are free bread for the Cocoa programming. Until the Interface Builder 2.x, you can just drag &amp; drop those menus in your main menu bar, and it automatically supported font manipulation in any of your NSTextView.</p>
<p>    However, from the Interface Builder 3.0, it is not true anymore. You need to connect message handlers for yourself, although you still don&#8217;t need to write a single line of codes. I don&#8217;t understand this. The FirstResponder supports all the required messages for the Font and the Format menus, just like it did during the Interface Builder 2.0 era. </p>
<p>    Anyway, Apple posted <a href="http://developer.apple.com/qa/qa2007/qa1571.html">a technical article on that here</a>.</p>
<p> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/356/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/356/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=356&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/16/how-to-enable-font-and-format-menu-with-the-interface-builder-3/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorials for XQuery and Cocoa</title>
		<link>http://jongampark.wordpress.com/2008/06/14/tutorials-for-xquery-and-cocoa/</link>
		<comments>http://jongampark.wordpress.com/2008/06/14/tutorials-for-xquery-and-cocoa/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 22:01:43 +0000</pubDate>
		<dc:creator>jongampark</dc:creator>
		
		<category><![CDATA[Cocoa]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://jongampark.wordpress.com/?p=354</guid>
		<description><![CDATA[    I needed to extract information from a Final Cut Pro project file in XML format. There are two ways to do so. One is to use a event-driven method using NSXMLParser, while the other approach is to use a Tree parser like NSXML.
    Apple provides a nice sample code for XML processing, which is [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>    I needed to extract information from a Final Cut Pro project file in XML format. There are two ways to do so. One is to use a event-driven method using NSXMLParser, while the other approach is to use a Tree parser like NSXML.</p>
<p>    Apple provides a nice sample code for XML processing, which is located at <strong><span style="color:#993300;">/Developer/Examples/Foundation/XMLBrowser</span></strong>.<br />
With this sample, you can apply many settings like &#8220;Pretty-Print&#8221; and so on. You can even try what result XQuery statement returns. So, this XMLBrowser sample code is quite a good test bed for your Objective-C/Cocoa coding.</p>
<p>    Along this, I found <a href="http://www.w3schools.com/xquery/default.asp">a good tutorial for the XQuery</a>. ( You can understand the XQuery to XML as SQL to the relational database. ) There is another one <a href="http://www.ibm.com/developerworks/xml/library/x-xqueryxpath.html">here at the IBM developer works</a>.</p>
<p>    Also, Apple provides <a href="http://developer.apple.com/appleapplications/fcpxml.html">a very interesting tips for the Final Cut</a>.</p>
<p>Enjoy the XML coding!!!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jongampark.wordpress.com/354/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jongampark.wordpress.com/354/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jongampark.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jongampark.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jongampark.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jongampark.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jongampark.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jongampark.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jongampark.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jongampark.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jongampark.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jongampark.wordpress.com/354/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jongampark.wordpress.com&blog=813782&post=354&subd=jongampark&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://jongampark.wordpress.com/2008/06/14/tutorials-for-xquery-and-cocoa/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/jongampark-128.jpg" medium="image">
			<media:title type="html">아미</media:title>
		</media:content>
	</item>
	</channel>
</rss>