Creating your first iOS app

No Comments

In this tutorial I’m going to teach you how to write your first iOS app(aka Hello World). I will assume you already know logic programming. If you’re reading this, then you’re probably not familiar with Objective-C and maybe even scared of it! Objective-C looks scary at first, but once you learn it, you won’t want to write code in any other language. It’s just easy, organised and readable. But why people find it so scary? Because of its unusual syntax! In Java, you’d write something like this:

object.method(argument);

In Objective-C, that would be:

[object method:argument];

It looks nothing like C, Java, PHP or other popular languages. But all you have to do is to open your mind and start from simple things, like this app I’m going to teach you how to write.

More

I’m on GitHub

No Comments

It toke a while to convince me to start using GitHub, but a few days ago a friend finally convinced me. I already published a few projects there and intend to publish a lot more. I will stop publishing open source projects on this blog(at least for now). Anyway, go check it out!

FVGetApp, an open source class to get and set default apps

No Comments

I’m pleased to announce the release of FVGetApp, an open source class to get and set default apps on Mac OS X. Say your Cocoa app needs to change the default browser. Not only FVGetApp can change it, but it also can get a list of apps that can handle the HTTP protocol. FVGetApp’s not limited to HTTP and HTTPS. It’s also possible to deal with any other protocol like mailto, ichat and ftp.

You can also deal with MIME types and extensions. So if you created an audio player and you want to let the user change the default app for MP3 files with a click, you will like my class too.

As a plus you can also check if an app can open a certain file.

I developed and tested it on Mountain Lion, but it should work on previous versions of Mac OS X. Adapting it to non-ARC code would take less than 1 minute. You can download a ZIP file containing the class, documentation and a test app by clicking here. To help you to understand the capabilities of this class before downloading the ZIP, here’s a method list:

+(BOOL)isAppCompatible:(NSURL *)appURL withFile:(NSURL *)fileURL;
+(NSDictionary *)appForProtocol:(NSString *)protocol;
+(NSDictionary *)appForMIMEType:(NSString *)MIMEType;
+(NSDictionary *)appForExtension:(NSString *)extension;
+(NSArray *)allAppsForProtocol:(NSString *)protocol;
+(NSArray *)allAppsForMIMEType:(NSString *)MIMEType;
+(NSArray *)allAppsForExtension:(NSString *)extension;

This week

No Comments

Well, after a lot of work I finally finished Metropolis. Now that it’s released I can start focusing on other stuff. Believe or not, I started working on it on December 2011. I was working on it on my free time, so I didn’t have much time to work on it. Well, now it’s released. I hope for god I will get some nice money from it. Even if I don’t get, Metropolis is too fucking cool. So far I’m proud of it.

Well, I’ve got a plan for this year. The goal is to do everything I was supposed to have done years ago. I’m not sure if it’s a good idea to write here who’s my inspiration for the plan. Well, anyway, I’m going to become a slave. And I finally solved my motivation and focus problems.
This week I will start a weight loss program. I simply stop drinking too much soft drinks. I love them, but they won’t let me lose weight easily. I will drink no more than 2 cans a day. I know I should drink no soda at all, but if I try anything that’s too complicated I will end up giving up. Last year I ran a 13 day Albuterol cycle. I was able to lose 2KG without losing muscle mass. And I wasn’t even on a diet. Now the goal is to lose 5~6KG. Yeah, I want to become very lean. 8% body fat or less is fine. Last time I toke 12MG a day, this time I want to start from 4MG every four hours and go 8MG every 4 hours. Considering I will be on a diet and that I’m now on TRT, there’s a big change I will be able to lose all the weight I want in just 2 weeks.
This week I will also get serious on learning how to play the guitar. If I study it for 30 minutes everything, I will play it decently in a few weeks. I will start from scratch, learning chords and sound effects. Well, it won’t be easy, but I have to learn it. It would help me a lot. I mean, those who can play an instrument always get attention. It’s easier even to make friends.
This week I will also sue my former broadband provider. They simply cut my signal and when I tried calling them, the phone would just stay mute. The store I subscribed the service from said they wouldn’t help me. WTF!? I’m not even able to cancel it. And worst of all, I needed to finish Metropolis quickly because it will be sold on MacUpdate Promo on monday. I got another broadband provider and now it’s working fine(let’s hope it will work for long). 
I also have to buy more whey protein. 
Well, this week won’t be easy, but I will have to start getting on a routine if I want to succeed.
BTW, I’m writing this post from Metropolis and I must say it’s WAY better than the WordPress admin. Seriously, I have no idea why I never tried using a blogging app before. It’s very good to write a post on it. And I really really hope Metropolis will be successful. Yeah, I’m paranoid. 😛

Busy busy busy

No Comments

Currently I’m busy as hell. I’m working on a new Mac app and I hope to finish it soon. Working 10˜12 hours a day is painful!

Android

No Comments

Galaxy Tab 7.0 Plus

Galaxy Tab 7.0 Plus

 

Developing for Android is not a choice anymore. A lot of my customers are asking for Android apps, so I bought this nice piece of gadget. I need a real device because Android simulator is just too slow and doesn’t seem to work very well. Time to learn how to program for Android!

[Open Source]FVGravityView

No Comments

Hey folks, I’m proud to announce my new open source project for iPhone. It’s called FVGravityView. It’s basically an UIView that has the ability to fall. Yes, fall. It uses the accelerometer to detect the device position and the view will fall depending on it. It’s basically an UIView that recognizes gravity.

A few thing:
-The default velocity is 20, but you may change this value by changing the velocity property.
-FVGravityView supports dragging. To enable it, set the property isDragable to YES.
-Say you want to invert the gravity. Just set the isInverse to YES.
-It’s basically an UIView, so you may add subviews to it. It also has every drawing capabilities that an ordinary UIView has.

To download the sample project, click here.

PS: I didn’t try it on an iPad, but it should work with no problems at all.

RIP Sensitive Code

No Comments

Hey folks, unfortunately, my blog Sensitive Code is dead. I had no time to update it and ended up not renewing the domain registration. It had a great page rank. For example, if you type UIFileSharing on Google, a post from Sensitive Code it is the first result(not sure for how long). I moved every post from there to this blog, so everything is still available. I hope to write about programming on this blog in the future.

FVImageSequence for Mac OS X/iOS

6 Comments

When I got to know Rainer Brockerhoff, one of my first questions was about networking. One of his advices was to write some open source code. A few days ago I was working on my customer’s app. He needed something similar to Apple’s 360° demo. I did not want to do that on a UIWebView as the performance is not the best. After looking for a view that does that, I found there was no one available. So I decided to write my own. Now I’m releasing it as an open-source project. The first of many.

FVImageSequence is basically a subclass of NSImageView/UIImageView that allows you to create the 360° effect by using a sequence of images. To use this view, you will have to add a image sequence to your project. All images must have the same prefix(i.e. myimage0.png, myimage1.png, myimage2.png). Set the prefix of the images you want to use by setting the prefix property.

You must also set the number of images. Just set the numberOfImages property in order to do that.

Also, don’t forget to set the property extension with the extension of the files(i.e png, jpg, gif).

Optionally you might set the increment property. This property basically tells the view how many images it should increment. If instead of incrementing 1 image, you want to increment 5, just set it to 5.

If you’re using the iOS version, don’t forget to enable the user interaction on Interface Builder.

Download the source code and the sample project from this link.

Solve problems

No Comments

Great post I found on Kenneth Ballenegger’s blog. I totally agree with him.

I do not pride myself in my skills as a programmer. Complex algorithms scare me, and I stay away from them as much as I can. Rather, what I am good at is creating elegant solutions to problems. I’m good at imagining how things could work together, how something could be improved through programming. I’m good at building real-life products and streamlining processes. Breadth, rather than depth.

I also do not pride myself in knowing a language fully. I am good at understanding concepts, code and documentation, and when asked a specific question in a job interview I am not afraid to say that I don’t know, but could easily figure it out with 5min and access to the internet.

What I’m getting at is that I value resourcefulness, scrappiness and creativity more than knowledge and intelligence. This is why I’m not taking a computer science course, but rather am instead studying alternate approaches to problem-solving in the world of design. I think it will be a lot more valuable in my life in building an intellectually well-rounded personality, and an ability to pick up new skills quickly and bend them to suit my purposes. In the end, what truly matters is what I’m able to create, not how intelligent I may be.

Older Entries