Loading

Thursday, August 26, 2010

Cell For Particular Index

\\Set YourButton.Tag When Create Custom Cell [YourButton SetTag:IndexPath.Row];

-(IBAction)YourButton_TouchUpInside:(id)sender
{
CustomTVCellComments *cell=[tblComment cellForRowAtIndexPath:[NSIndexPath indexPathForRow:[sender tag] inSection:0]];
cell.YouribOutletHere=Some Code;
}

Wednesday, August 25, 2010

Fade Effect For View

YourView.Alpha=0.0
[UIView beginAnimations:nil context:NULL];
// [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:YourView cache:YES];
[UIView setAnimationDuration:1.5];
[YourView setAlpha:1.0];
[UIView commitAnimations];

Tuesday, August 24, 2010

Compas Working

1. --> in .h File include -->CLLocationManagerDelegate

2. in .m FIle --- >
a. ViewDidLoad LManager=[[CLLocationManager alloc]init];
LManager.desiredAccuracy = kCLLocationAccuracyBest;
LManager.delegate=self;
[LManager startUpdatingHeading];
Degree=0;


b. Delegate Methods - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
Compass_Not_Dect_Camera.hidden=YES;
double curLocation=newHeading.magneticHeading;
if(PreLocation-curLocation>5 || PreLocation-curLocation<-5)
{
CGAffineTransform rotate = CGAffineTransformMakeRotation( newHeading.magneticHeading/180*3.14 );
[arrow setTransform:rotate];
Degree=newHeading.magneticHeading;
Degree=Degree/90;
PreLocation=newHeading.magneticHeading;
}
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{

[LManager stopUpdatingLocation];
[LManager release];
Compass_Not_Dect_lbl.text=@"Compass Not Detected";

}

Image Of An Image View through Url

NSURL* _picUrl=[NSURL URLWithString:@"ImageUrl"];
NSData* _picData=[[NSData alloc] initWithContentsOfURL:_picUrl];
imgDetails.image=[UIImage imageWithData:_picData];

Detect Shake in iPhone

1. in .h File --->#define kAccelerationThreshold 2.2

2. include UIAccelerometerDelegate

3. in .m File --> ViewDidload -->[[UIAccelerometer sharedAccelerometer] setDelegate:self];

4. #pragma mark -
#pragma mark Shake event

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
if (fabsf(acceleration.x) > GlobalRate || fabsf(acceleration.y) > GlobalRate || fabsf(acceleration.z) > GlobalRate)
{
// Your Code Here
}
}

Wednesday, August 4, 2010