Posts Tagged ‘Objective-C’

Using Google Chart in Objective-C

April 14, 2012 1 comment

Google chart is a very nice tool where you can generate some very nice figures for your data. By calling their API, you could simply embed it into your web page or download the image for whatever you use. At their website, google includes some most commonly used ones, but some are missing such as meter bar. You could probably find others that fit your goal by just ‘googling’ 🙂

Here’s a code snip for how to use it in Objective-C. I use chf=bg,s,65432100 to make it a clear/transparent background.

- (UIImage *) getGoogleChartImage {

NSString* url=@",40&chs=250x100&chl=Hello|World&chf=bg,s,65432100";
NSString *myurl=[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:myurl] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];

NSURLResponse* response;
NSError* error;
NSData *googleImageData=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];


UIImage *googleImage = [[UIImage alloc] initWithData:googleImageData];
NSLog(@"Retrived Google Image Width: %f", googleImage.size.width);

return googleImage;


Tutorial Sites For iOS Developer

April 7, 2012 Leave a comment

Cocoa & Objective-C is the base of Mac Os X.
Objective-C Language is an extensive to C and makes C OO(Object Oriented).

ObjectiveC Quick Learning:

ObjectiveC Tutorial:    ( very cool one)

How to generate certificat signing request ( I like their QA part, include a lot of basic points you will need to start your ios development):

The developer video site:

Delegate is sth like callback function or notify mechanism. When some events happens, we call the corresponding method defined in the delegate class. As to application delegate, the delegate object specified in the UIApplicationMain is responsible to respond to the event which will affect the whole application. For example, when the application is about to run out of memory, the method ‘didReceiveMemoryWarning’ is invoked, and this is defined by an ObjectiveC protocal——UIApplicationDelegate. This protocal defines when and which delegate method should be invoked. For an application delegate class, it should declare in its .h file that it will implement a certain protocal , and then implement all the method which was not taged with ‘optional’ in the protocal.

For example:
There are a lot of other delegate protocal defined in the iPhone. If we want to implement some delegate class to handle certain events generated from a text field in the UI, we can choose UITextFieldDelegate protocal. This protocal defines the methods which will be invoked by the events which are generated by a text, like content changed.
The last thing we need to do is to assign the delegate class of a certain control or view with the delegate class we just implemented.

Some useful links:

iPhone Camera Focussing:


OpencvFrameWork for iOS:

UIColor CheatSheet:  ~~~ I love this one 🙂

The Coordinates of CGRectMake

Categories: MacOS, Programming, Video Tags: ,