This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)locationManager:(CLLocationManager *)manager | |
didUpdateLocations:(NSArray *)locations{ | |
CLLocation *currentLocation = [locations lastObject]; | |
if (currentLocation != nil) { | |
NSLog(@" Longitude: %@",[NSString stringWithFormat:@"%.8f", currentLocation.coordinate.longitude]); | |
NSLog(@"Latitude: %@",[NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude]); | |
} | |
[self.locationManager stopUpdatingLocation]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ | |
int length = [[self formatNumber:[textField text]] length]; | |
if (length == 10) { | |
// [self textFieldShouldEndEditing:textField]; | |
if(range.length == 0) { | |
return NO; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void swap(int a. int b ) { | |
a= a^b; | |
b= a^b; | |
a= a^b; // XOR operation | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void swap (int a, int b){ | |
a = a+b; //9 = 4+5 | |
b = a-b; //4 = 9-5 | |
a = a-b; //5 = 9-4 | |
} |
NewerOlder