-(void)touchesBeganNSSet *)touches withEventUIEvent *)event
{
UITouch * touch = [touches anyObject];
if(touch.phase == UITouchPhaseBegan)
{
if(TableView.hidden == FALSE)
{
[TableView setHidden:TRUE];
}
}
}
Adding an MKMapView programmatically
MKMapView * map = [[MKMapView alloc] initWithFrame:
CGRectMake(0, 0, 320, 480)];
Map.delegate = self;
[self.view addSubview:map];
Getting User’s Profile Data from Facebook in iPhone
It uses Graph API of Facebook. Use your own login to get data from all Methods. It gives you everything like UserName, email, user profile picture, all albums, all friends etc etc.
This is the code Getting User’s Profile Data from Facebook in iPhone.
reallylongaddress-iPhone-Facebook-Graph-API-59e6399
How To Update ProgressBar in iPhone
//——————— .h File { NSTimer *timer; UIProgressView *myProgressBar; int StartingValue; } @property (nonatomic, retain) UIProgressView *myProgressBar; //———— .m File @synthesize myProgressBar; – (void)viewDidLoad { StartingValue = 0; myProgressBar = [[UIProgressView alloc] init]; myProgressBar.frame = CGRectMake(25, 100, 235...
How to add an icon to your iPhone application?
In this post we will learn how to add icon file to iphone application. First you must have icon file 57 x 57 pixels in png format. Once your icon is ready in 57 x 57 pixels and named Icon.png, right click the resources folder and add the Icon.png to resources and do not forget to check the ‘Copy items into Destination’s folder’ box. Then in Resources folder , find...
How to add MPMoviePlayerController in View
First Add Framework for MPMoviePlayerController : “MediaPlayer.Framework” .h File #import <UIKit/UIKit.h> #import <MediaPlayer/MediaPlayer.h> @class MPMoviePlayerController; @interface TestViewController : UIViewController { MPMoviePlayerController *moviePlayer; }...
How to get Latitude,Longitude of two cities and Calculate Distance in iphone
import Framework CoreLocation.framework MapKit.framework //———————————————————————— #import “ViewController.h” #import <MapKit/MapKit.h> NSMutableArray *citynamearray; NSMutableArray *latarray,*longarray; ...
How to manage application when orientation changes?
The problem is that when you rotate the device then (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation Method gets called but when you go to the next screen then this method does not get called. if you rotate your device again then that method gets called. So if you want to change next screen orientation as device current orientation, then check the...
For finding touch location on screen in cocos2d (ios)
Try This code and get touch location in cocos2d (ios)
- (void)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
UITouch *myTouch = [touches anyObject];
CGPoint location = [myTouch locationInView:[myTouch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
}
How to Create UILocalNotification, repeating every minute ?
There are two types of notifications in iOS, One is Local notification & other is PUsh notification. Added code to create Local notification. // creating notification NSDate *newDate = [NSDate dateWithTimeIntervalSinceNow:60]; // where 60 = seconds, so add your seconds here Class cls = NSClassFromString(@”UILocalNotification”); if (cls != nil) { UILocalNotification *notification =...