[TIP] XCode Header Search Path

September 26, 2009 | Filed Under Tips, XCode | 1 Comment

For many of you, this sounds like a stupid thing. But for those that just use gcc -I from command line, can be a pain find how to do it.

So, the problem is. How can I specify my Include path in XCode (gcc -I./mypath).

XCode Search Header Path

Tap on your project target, and click “Get Info“, tap on “Build” tab and search “Path” as showed in the figure above. Then click on the “Header Search Paths” options and add your favorite include paths for selected target.

iPhone: Touch, Drag, Hit!

May 1, 2009 | Filed Under Mac OS X, iPhone | 3 Comments

Yesterday, Fredrik has asked me something like “Drag & Drop with Hit Test” on the iPhone. Here’s a simple example.  There’s a simple UIView class that handles the touch events and a protocol that says that if the “DragMe View” has hit or not the “HitMe View”. Below you can see the result and the Source Code Link.

iPhone Touch Drag Hit

The source code is available here: Touch, Drag, Hit Source Code.

Qt/Cocoa DataStream (Binary Communication)

April 11, 2009 | Filed Under Cocoa | No Comments

In a time of REST protocols… I still love the Binary Communication. I don’t have much ideas this period, I need to find a different job (C# doesn’t fit my code necessity). The Example Source code, contains two Folder. One is the Qt4 TcpServer the second one is the ugly application that you can see below :)

Note: This example doesn’t have anything related to the Qt 4.5 Cocoa Support.

Run the Qt4 Server, and the Cocoa Application (Remember to change the SERVER_HOST in AppController.m) and try to send some binary data. The Qt Server will receive this data it will resend you. Protocol is Very easy 1 byte of Data Type (Int8, Int16, ..) and Data. Remember that Intel arch is Little Endian.

Qt Cocoa DataStream

Note: This is just a “Draft” a “non complete” example only to give the idea on how it works.

The Source Code is available here: Qt/Cocoa DataStream Source Code.

iPhone: Download and Display Gravatar

March 28, 2009 | Filed Under Mac OS X, iPhone | No Comments

Back to the real iPhone for a while… Gravatar, or globally recognized avatar, is an interesting free service. It can be integrated with AddressBook app or other apps that can have a picture related to email address. Here an Objective-C Example to retrive the Gravatar. It’s really simple!

iPhone GravatarThe Source Code is Available Here: iPhone Gravatar Example.

The Apple Worldwide Developers Conference (WWDC) takes place June 8-12, 2009 held at Moscone Center West in San Francisco. http://developer.apple.com/WWDC/.

Cocoa: Sidebar with Badges, Take 2

March 8, 2009 | Filed Under Cocoa | 13 Comments

Cocoa SidebarDo you remember the Cocoa Sidebar? No, Take a Look at this post Cocoa Sidebar with Badges.

Joel asked me to revise the Sidebar, allowing to add/remove and do other operation at any time.

I’ve rewritten all the code of the Sidebar, and I’ve added a couple of new features, like the default action handler and obviously the ability to add, remove items and badges at any time.

All the past features, like Drag & Drop are still present, but there’s something else to do to improve it. If You’ve suggestions, patches or something else post a comment or send me a mail!

The Source Code is Available Here: Cocoa Sidebar 2 Source Code.

Update 10 March 2008 – Source Updated with Fixes.

Cocoa: Drag & Drop

February 28, 2009 | Filed Under Cocoa | 1 Comment

Today a simple example of Drag & Drop with Cocoa and NSView. The screenshot below shows two groups. In the first one, you can drop the photos on your filesystem, taken from Desktop or Finder. In the second group, you can only drop the first group image.

Cocoa Drag & Drop Test App

You can find the source code here: Drag & Drop Test Source Code.

WebKit: Google Maps

February 1, 2009 | Filed Under Cocoa | No Comments

Following the Google StreetView post, another example on How Cocoa Application can Interact with Google. Today the WebKit shows Google Maps.
Cocoa Google Maps - Aliso Viejo
Like iPhoto ‘09 you can select you Map Type (Terrain, Satellite, Hybrid) and you can Zoom In or Zoom Out using controls of your Application.
Cocoa Google Maps - Red Wood
You can Find the Source Code Here: Cocoa Google Maps.

WebKit: Google StreetView

January 17, 2009 | Filed Under Cocoa | 2 Comments

Last iPhoto ‘09 presented at MacWorld contains a couple of interesting Features: Faces and Places. Today, I’ve a little bit of free time to play with my Mac, and the topic is How to embed Google StreetView into a Cocoa Application.
Cocoa Streetview Cuppertino
The Solution is using WebKit and Google Maps API. We’ve a simple HTML file that contains StreetView “Canvas” and a couple of javascript methods that interact with GStreetviewPanorama Object.
Cocoa Streetview San Francisco
The Source Code is Available Here: Cocoa StreetView Source.

Next Page »