New iPhone

No Comments

So today I just got a new iPhone. It’s a 16GB 4S white. I really miss my old iPhone as it was the last great gift my aunt gave me before dying. Anyway, I thought the white model was way cooller, but now I see I was wrong. And this time, in case anyone finds/steals it, they will have a little surprise…

BTW, Siri is pretty cool. Too bad it won’t find restaurants and night clubs in Brazil. Now I gotta get back to work.

I was such a moron…

No Comments

Not too much people could say they had the chance to get rich when they were 14. Really. Believe in me or not, I had that fucking chance and I knew that. Not sure if you guys remember, but a couple years ago, as soon as the iPhone App Store came out, there was a lot of people making money on it. I knew that and all I had to do was to learn Objective-C + Cocoa(which I was supposed to have learned a couple months before I found out about the iPhone-made-rich-man). Even if my apps didn’t sell a lot, come on, there were a lot of people willing to invest everything they had on it(even their asses and their souls). So yeah, I had the chance. Mobile platforms have never been my favorites. In fact, I’d write only Mac software if I could. But I knew I had to program for the iPhone.

I started making plans for the money, like moving to Los Angeles, Mountain View, San Jose or San Francisco, buying an iPhone 3G(my dream gadget at the time) and a 17″ MacBook Pro with the best processor, memory and hard drive available. Not to mention other things like buying a Nintendo Wii and go to the mall to spend money(for just one day guys, I have never been so immature to spend a lot of money on shit all the time). I still go to the mall to walk and not to buy stuff. It makes no sense at all, I know.

Basically I was depressed at the time. I was depressed for almost 1 and a half years at the time. This depression lasted for another year. I read some time ago that the dementors from Harry Potter were inspired on depression. If it’s not, it’s would be a great inspiration for such characters. Depression sucks your blood and hope, just like a vampire. I really didn’t know I had depression at the time. Depression sucked my desire to learn how to program for the Mac and the iPhone. I just used to think that I still had time. DAMN! FUCKING DAMN! FUCKING DAMN SHIT!  6 months passed and it became impossible to make money on the iPhone app market. Basically because there was a lot of apps and developers out there(including those in India which will create an app for 140 bucks).

I wonder how my life would be now. While there is a possibility I’d have lost everything due to little experience, there’s a chance I’d pick that up quickly. I’d probably be living in the US right now and who knows what else. I still blame myself for that. Now that I’m an expert on iOS development, the market isn’t that good anymore. A lot of people thought like me, but the difference was that, unlike me, those people actually did something. So now I’m here, a mid-class worker living in Brazil.

So you might be thinking “That was a long time ago, why the hell you’re writing this post?”. It’s not about remembering about that time. It’s about something else. Have ya ever heard that music can bring our feelings back? Right now I’m listening to a song that I used to listen in early 2009, and that brought the feeling back. I feel like I’m still in that year while I’m listening to it.

BTW, I know I shouldn’t talk about suffering from depression in public as most people think people who suffer from depression got schizofrenia and randomly decide to kill people. If you think that, ya should be ashamed of yourself. Depression is just the lack of pleasure of living. If someone who suffers from it kills somebody, it surely will be themselves, not other people. But seriously, I had to write about that.

PS: comments saying depression is the lack of Jesus in my life will be ignored. I don’t need Jesus as I already have the Flying Spaghetti Monster.

When things can’t get worse, they GET worse :(

No Comments

Ya know those movies where the character’s life is fucked up and they say that it cannot get worse and suddenly something bad happens? Too bad it exists outside the movies. My life is a big piece of shit since a couple months ago. Yeah, that was bad, but yesterday it got even worse. And I didn’t even say anything. When I got home I toke my wallet from my pocket and when I was putting my hand in my other pocket to take my iPhone from it, well, there was no iPhone. I really got desperate when I couldn’t find it. Maybe I already toke it from there and didn’t notice it? I checked all over the place and that was just not the case. So I opened my iCloud account and Find My iPhone was not able to locate anything. I said “DAMN!”. In a minute it found my iPhone. Shit, it must have got out of my pocket in the buss considering the place it was. So I ran to the bus stop and waited for the bus. After 2 buses, I found NOTHING! So I went to the civil police department and told them my phone was missing and that I was able to find it using Find My iPhone. They said they could not do anything and told me to call the military police. Brazil is one of the most expensive countries to live and the one who has the third highest taxes and what we get for that? NOTHING! So I got home and tried to locate it again and no luck. Waited a few more hours and no luck. The only thing I can think of is that someone found it and turned it off.

Today I had to get a new cellphone. I couldn’t afford another iPhone as they are very expensive here(in fact, Brazil has the world’s most expensive iPhone). My options were limited to 2 Android phones with 2 inch screens and a BlackBerry. I ended up getting the BB as it would be nearly impossible to type on those phones. Seriously guys, now I understand why Research In Motion is about to face a bankruptcy. This phone just sucks! I mean, those guys don’t really know what usability is. The keyboard is just to small. A touch screen phone is MUCH better.

I still have a very small hope of finding my iPhone. I will call the bus company on monday to see if they know anything. In case they don’t, I will just give it up and call every single Brazilian carrier and inform them the phone IMEI so no one will be able to active it on their networks. I just hope I will have money to buy another iPhone soon. :(

[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.

Easy multithreading, a courtesy of NSOperation

No Comments

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:

More

Documents folder and UIFileSharing

No Comments

On the iOS, we can only save files on the documents folder. The bundle for example, is not writable. Getting the path of the documents folder is easy. Just use the following code:

NSArray *array = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documents = [[array objectAtIndex:0] copy];

The variable documents will be the path to the documents folder. Now if you want to create an URL from it, use the following code:

NSURL *url = [NSURL URLWithString:documents];

Say you saved a couple files and want your users to be able to transfer it to their computers. On iOS 3.2, Apple introduced UIFileSharing. It allows users to transfer files from their iOS devices to any computer running iTunes. To enable that, just add the Application supports iTunes file sharing line to your info.plist and check the box.

Your users will be able to transfer any file from the documents folder to a computer. To do that, open iTunes then click on your device name. Go to the apps tab and scroll down.

Just drag and drop any file to/from the documents table view.

FVImageSequence for Mac OS X/iOS

2 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.

End of AT&T monopoly?

No Comments

First my friend who works at Verizon Wireless said it’s true. iPhone will be available to Verizon customers. I was surfing on CNN website and I found a video saying it’s probably gonna happen. I’m so happy to know that when I move to the US, I will not have to sign a contract with an carrier that sucks balls :)