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
// in your subclass of UIScrollView | |
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
if (!self.dragging) { | |
[self.nextResponder touchesBegan:touches withEvent:event]; | |
} | |
else { | |
[super touchesBegan:touches withEvent:event]; | |
} |
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
NSLocale *lcl = [[NSLocale alloc] initWithLocaleIdentifier:@"en_SG"]; | |
NSNumberFormatter *fmtr = [[NSNumberFormatter alloc] init]; | |
[fmtr setNumberStyle:NSNumberFormatterCurrencyStyle]; | |
[fmtr setLocale:lcl]; | |
NSLog(@"Current Locale: %@", [NSLocale currentLocale]); | |
NSLog(@"Available Locales: %@",[NSLocale availableLocaleIdentifiers]); | |
NSLog( @"%@", [lcl displayNameForKey:NSLocaleCurrencySymbol value:@"en_SG"] ); | |
NSLog( @"%@", [fmtr currencySymbol] ); | |
NSLog(@"CurrencyCode: %@", [lcl objectForKey:NSLocaleCurrencyCode]); |
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
#include <netinet/in.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
#include <arpa/inet.h> | |
- (void)broadCast | |
{ | |
int socketSD = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); | |
if (socketSD <= 0) { | |
NSLog(@"Error: Could not open socket."); |