-
UUID (Universally Unique Identifier): A sequence of 128 bits that can guarantee uniqueness across space and time, defined by [RFC 4122][rfc4122].
-
GUID (Globally Unique Identifier): Microsoft's implementation of the UUID specification; often used interchangeably with UUID.
-
UDID _(Unique Device Identifier)): A sequence of 40 hexadecimal characters that uniquely identify an iOS device (the device's Social Security Number, if you will). This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.
This file contains hidden or 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
typedef enum { | |
NotiContact=0, | |
NotiChatNoti, | |
NotiMyNoti | |
} NotiSelect; | |
//Colors | |
#define COLOR(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] | |
#define COLOR_BACKGROUND [UIColor colorWithRed:(230.0/255) green:(224.0/255) blue:(202.0/255) alpha:1.0] |
This file contains hidden or 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
NSURLConnection | NSURLSession | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| N |
This file contains hidden or 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
-(NSString *)StringFromDate:(NSDate *)DateLocal{ | |
NSDateFormatter *prefixDateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[prefixDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; | |
[prefixDateFormatter setDateFormat:@"MMMM d., yyyy"];//June 13th, 2013 | |
NSString * prefixDateString = [prefixDateFormatter stringFromDate:DateLocal]; | |
NSDateFormatter *monthDayFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[monthDayFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; | |
[monthDayFormatter setDateFormat:@"d"]; | |
int date_day = [[monthDayFormatter stringFromDate:DateLocal] intValue]; |
This file contains hidden or 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
-(NSString *)StringFromDate:(NSDate *)DateLocal{ | |
NSDateFormatter *prefixDateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[prefixDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; | |
[prefixDateFormatter setDateFormat:@"MMMM d., yyyy"];//June 13th, 2013 | |
NSString * prefixDateString = [prefixDateFormatter stringFromDate:DateLocal]; | |
NSDateFormatter *monthDayFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[monthDayFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; | |
[monthDayFormatter setDateFormat:@"d"]; | |
int date_day = [[monthDayFormatter stringFromDate:DateLocal] intValue]; |
This file contains hidden or 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
#import <CoreLocation/CoreLocation.h> | |
#import <ImageIO/ImageIO.h> | |
@interface CLLocation (EXIFGPS) | |
- (NSDictionary*) EXIFMetadataWithHeading:(CLHeading*)heading; | |
@end | |
@interface NSDate (EXIFGPS) |
This file contains hidden or 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
-(MKCoordinateRegion) regionForAnnotations:(NSMutableArray *)annotations | |
{ | |
double minLat=90.0f, maxLat=-90.0f; | |
double minLon=180.0f, maxLon=-180.0f; | |
for (id<MKAnnotation> mka in annotations) { | |
if ( mka.coordinate.latitude < minLat ) minLat = mka.coordinate.latitude; | |
if ( mka.coordinate.latitude > maxLat ) maxLat = mka.coordinate.latitude; | |
if ( mka.coordinate.longitude < minLon ) minLon = mka.coordinate.longitude; | |
if ( mka.coordinate.longitude > maxLon ) maxLon = mka.coordinate.longitude; |
This file contains hidden or 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
#pragma mark - | |
#pragma mark - Creating Object | |
-(id)createObjectForEntity:(NSString *)entityName | |
{ | |
if (entityName!=nil || [entityName isEqualToString:@""]) | |
{ | |
return [NSEntityDescription | |
insertNewObjectForEntityForName:entityName | |
inManagedObjectContext:appDelegate.managedObjectContext]; |
This file contains hidden or 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
# pragma mark - | |
# pragma mark - Scale and Rotate according to Orientation | |
- (UIImage *)scaleAndRotateImage:(UIImage *)image | |
{ | |
int kMaxResolution = 450; // Or whatever | |
CGImageRef imgRef = image.CGImage; | |
CGFloat width = CGImageGetWidth(imgRef); |
This file contains hidden or 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
These are a few patterns commonly used. | |
1 - Digits only: (\\d+) | |
2 - Names without special characters: ([A-Za-z\\s]+) | |
3 - Email: (([\\w\\.\\-]*?@)([\\w\\.\\-]+)(\\.[a-z]{2,4}) # Incompatible with versions previous to 1.1.2 of NSStringMask | |
4 - Dates: (\\d{2})/(\\d{2})/(\\d{4}) | |
5 - SSN: (\\d{3})-(\\d{2})-(\\d{3}) | |
6 - Telephone: (\\d{3})-(\\d{3})-(\\d{4}) | |
Brasil: |