I know Mountain Lion was released a couple days ago, but I ended up downgrading my MacBook Pro to Snow Leopard. Lion is just too buggy. I never thought I’d say that, but even Windows Vista is better. It’s buggy, slow, ugly and consumes a lot of memory. And is there anything new on Lion that’s relevant? No! Just a mobile interface on a desktop, and let’s face it, it doesn’t work work. Snow Leopard is far better than Lion. Mountain Lion won’t run on my Mac without a workaround. But the main reason to not install it at this moment is that it probably has a lot of bugs considering it’s a .0 version. I also kept Tiger on another partition, as I’m a big fan of that OS. This time, the Tiger partition is a half of my hard drive. And yes, I still use it regularly. Mainly to work on a Mac app that should be out soon. I really wanna make it compatible with Tiger and Panther.
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.
Threading is known for being very hard in any language. A foolish mistake can make your application crash. Programmers spend a lot of time to make sure everything works fine. On Mac OS X 10.5, Apple finally introduced a very easy way to deal with threading. NSOperation is The Apple Way® to deal with threading. All you have to do is to subclass the NSOperation, create and initialize a NSOperationQueue, create and initialize the NSOperation and add it to the NSOperationQueue. For this tutorial, I will teach you how to write a simple app that will load a RSS feed and display it on a NSTableView.
To get started, go to Xcode and create a new project. I will call mine RSS Reader, but feel free to call it whatever you want. Let’s start by editing our AppDelegate.h. Create 3 IBOutlets:
People ask me very often what they should do to get started in programming. I usually tell them to read books. And what’s the best book for those who want to learn Mac programming? It’s Cocoa Programming forMac OS X by Aaron Hillegass. This book is the best, it simple defines what we are, it’s our bible. The book considers you already know a little C or C++ and teaches you everything a decent Mac developer should know: from a hello world to printing, web services and Core Animation.
The guy who wrote this book can be considered the world’s best Cocoa teacher. He taught Objective-C at companies like Intel, NeXT, Apple and Microsoft. He is also the own of Big Nerd Ranch, a very famous training center.
Now let me tell you guys about my faith testimony. I started to try to learn Cocoa in the beginning of 2008, I had gave up and started to look for alternatives to Objective-C. I mean, that syntax looked so weird. A very long time after that, in the end of 2009, Lars Bergstrom told me about this book. In less than a month I was writing my first commercial app.
At the time I’m writing this, it costs $30.24 USD on Amazon. It’s not the world’s cheapest book, but it isn’t the most expensive one. It’s worth investing on a copy. Get it on Amazon.
Opening URLs on external applications is easy, no matter if you’re on an iPhone/iPod touch/iPad or on a Mac. On the Mac, we’d do something like this:
NSURL *URL = [NSURL URLWithString:@"http://www.sensitivecode.com"];
[[NSWorkspace sharedWorkspace] openURL:URL];
Simple, uh? Now let’s see how to do this on the iOS:
NSURL *URL = [NSURL URLWithString:@"http://www.sensitivecode.com"];
[[UIApplication sharedApplication] openURL:URL];
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.
Well guys, my computer started to behave strangely, so I decided to reinstall Mac OS X. But for the first time, I didn’t install the Client version, but the Server one. Yeah, I’m running Mac OS X Server! It has some stuff I’ve never seen in my entire life(like QuickTime Broadcaster). Mac OS X Client and Server are basically the same, excepting by the fact that the Server has a couple more apps and backends.
One of the good things about being a developer registred on the Mac Developer Program is that Apple gives us some free stuff. As an example, we can use get Mac OS X Client and Server for free. To not mention the fact we’ve got a page where we may download older versions of Mac OS X, including beta versions of them! Did I mention this list contains very old stuff like Jaguar and Panther?
I still have some stuff to explore on it. Also, the wallpaper is much nicer. I hope I will like this system.
Three days ago, I was reading about a rumor of a Mac App Store. The rumor said there will be a Mac App Store and no software without authorization from Apple will run on Mac OS X. I was scared. When I was thinking about switching to Linux if that was true. I decided to e-mail Steve Jobs. I asked him if that was true. I never ever ever thought he would reply me, but it was worth trying. I was wrong. He replied me! He just said “Nope”. Yeah, nothing else. That was enough to make me get calm. I tweeted about it and the editor from MacStories found my tweet. Read the post here. I became “famous” instantly. My name was on every big website/blog focused Apple. Even websites that were not focused Apple were talking about that e-mail. Nobody used to post a comment on this blog, excepting by my friend Lucia Stevenson and spammers. Now I’m receiving comments from other people on this webblog. Wow, I still can’t believe it