I have been trying to write a php script which can email using smtp may be Google account or any other account, but after spending lot of time, I found that Godaddy (where I have my hosting account) doesn’t even allow scripts to make socket connection. Embarrassing, isn’t it ! Have a look into this [...]
I got stuck for this requirement when I was getting response from server in two languages, English and Arabic, for English it was giving normal text but for Arabic, it was returning text something like this… نريد أن نرى هذا في اللغة العربية So then I figured out from ‘Stackoverflow.com’ that these are code for [...]
When we make games, usually we go for landscape orientation. So if you have selected the project template as “View based Application”, Interface builder automatically creates ViewController in Portrait mode for you, which you can make as landscape by clicking on top right “arrow” icon in view controller xib at Interface builder. But still you [...]
We can communicate in many ways with server. One way is using JSON, this is explained as below: 1. Starting Communication [[[NSURLConnection alloc] initWithRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:urlStr]] delegate:self startImmediately:YES] autorelease]; //urlStr is NSString ref 2. Start receiving data – (void)connection:(NSURLConnection *)connection didReceiveResponse: (NSURLResponse *)response{ [receivedData setLength:0]; } //receivedData is NSMutableData ref 3. Get data in [...]
We have open source Chipmunk library to implement physics engine in iPhone gaming apps. Here is the source This source is the powerful physics 2D engine to use in iPhone game programming. We can have every motion of any real world object in whatever place it is. We can add gravity, friction, external force which [...]
Some times in our app we want to change the coordinate system of UIView, mostly when we change the orientation of iPhone like Landscape Right or left, So that time, coordinate system as well as appearance of UIView should also change, so here is the code to do that… application.statusBarHidden=YES; [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:YES]; myUIView = [...]
There are several things which we need to keep in mind when we use UIImage as follows: 1. UIImage has 4 class methods to create its autorelease instance and 3 instance methods to load image. 2. When you want to cache the image, so that it can be easily loaded in no time whenever required, [...]
We all know that to do animation using UIImageView, we load images in the NSArray and then set it to animationImages property of UIImageView and then call function startAnimating. But when you try to repeat animation by loading again and again with different images using this method, you start experiencing Crash on iPhone device with [...]