Author Archives: feuvan

Why IDE matters

It has been a long time since I became a coder, or a programmer if you don’t like naming it as coder. When in THU I was working on my own time, playing with some small tools/scripts, happily doing some cracks while playing games and hanging out with friends/girls. It was so called “coding for fun” time. After graduation I have to act as a society cell, began working for companies. Since then productivity overcomes fun, takes higher priority when make decisions. It’s a comparable question like business opportunity versus doing cool things for startup guys. You may have double shot, but most of the times you have to choose one of them.

To coders the most frequently used tool is their IDE. Well, somebody may say editor! or V.. or Em…. whatever. For me, IDE is the most important thing because it provides design time check.

Let’s overview part of the develop process again: you get design doc from pm or funny/crazy/important ideas pop up in your mind, then you have a general idea on how to implement then code. Sometimes you work with new technology/toolchain/environment, then design time check makes sense. Even if you are expert on the very familiar domain, it helps.

Today several advanced IDE can do something like intelligent check of possible bugs based on context and trying to defer the designer’s purpose. And yes, I mean Visual Studio or Xcode, these kind of resource consuming monsters. They can help you find basic errors like syntax error, spell error, and common errors like off-by-1, uninitialized usage of variables, infinite loop. Then you try compile, compiler gives you compile time check. The code/design again, compile again. These steps iterates until you’ve completed the work then deliver it to test role, tester/qa or yourself if you are building some kinds of tools for fun.

Following this process, if you have many times of switching between code/design and compile, you will mostly lost track if compile takes time…As it has been reported on media or you have realized, you may be distracted on sns/im/twitter/fb. Then after a short time you find that it’s time to go home or have lunch. But even if you are concentrated on your task and working very hard, IDE can help you work in a better way, save your precious time by reducing possibile bugs from the very beginning design time. And you have more confidential if there’s no warning shown when writing plain code or playing elements in UI designers.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Handle URL open from other apps in iOS

For short, declare UTImportedTypeDeclarations(for types that are not predefined as System Uniform Type Identifiers), CFBundleDocumentTypes in Info.plist, UIApplicationLaunchOptionsURLKey in

[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey]

And for multitask apps, additionally respond to

(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation // for iOS 4.2+

or

(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url // for iOS 2.0+, deprecated.

One little trick to handle ALL file types:

	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeName</key>
			<string>All Files</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>public.data</string>
				<string>public.content</string>
			</array>
		</dict>
	</array>
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

remove a symbol from multiple platform Mach-O file

For Mach-O fat binaries that contains multiple platforms, stripping symbol may not work as you would expect.
So you have to extract the executables/libraries from Mach-O and thin it using lipo. Then you can remove the .o file you don’t like by “ar -d <.a> <.o>” or strip the symbol by “strip” which is no longer necessary.
After that, do the reverse steps to pack it back to a multiple platform Mach-O file.

Well, this post *may* be the last post this year.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)