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
yourTextView.editable = NO; | |
yourTextView.dataDetectorTypes = UIDataDetectorTypeAll; |
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
// | |
// UIImageRounded.h | |
// BDD Restaurantes | |
// | |
// Created by Sendoa Portuondo on 03/10/11. | |
// Copyright 2011 Qbikode Solutions, S.L. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
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
#import <UIKit/UIKit.h> | |
#define ApplicationDelegate ((QBKAppDelegate *)[UIApplication sharedApplication].delegate) | |
@interface QBKAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@property (copy, nonatomic) NSString* unaCadena; | |
@end |
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
// Disable the idle timer | |
[[UIApplication sharedApplication] setIdleTimerDisabled: YES]; | |
// Or for those who prefer dot syntax: | |
[UIApplication sharedApplication].idleTimerDisabled = YES; |
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
// http://objective-c.es/modern-objective-c-enum/ | |
// http://nshipster.com/ns_enum-ns_options/ | |
typedef NS_ENUM(NSUInteger, GBDaysOfWeek) { | |
GBSunday, | |
GBMonday, | |
GBTuesday, | |
GBWednesday, | |
GBThursday, | |
GBFriday, |
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
//http://mobiledevelopertips.com/core-services/create-universally-unique-identifier-uuid-the-ios-6-way.html | |
//The class NSUUID implements RFC 4122 creating values that are 128 bits long and guaranteed to be unique across space and time by using a unique value on the device as well as a value representing the elapsed time since October 15, 1582 at 00:00:00. | |
// iOS 6 | |
NSUUID *uuid = [NSUUID UUID]; | |
NSLog(@"UUID: %@", [uuid UUIDString]); | |
// Output: UUID: A84AFC3C-B3A7-31C7-B3E9-234AF423C6B1 |
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
#import <UIKit/UIKit.h> | |
#define ApplicationDelegate ((QBKAppDelegate *)[UIApplication sharedApplication].delegate) | |
@interface QBKAppDelegate : UIResponder <UIApplicationDelegate> | |
@property (strong, nonatomic) UIWindow *window; | |
@property (copy, nonatomic) NSString* unaCadena; | |
@end |
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
// Eliminar elementos duplicados en un NSArray | |
NSArray *cleanedArray = [[NSSet setWithArray:dates] allObjects]; |
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
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol * | |
// block typedef: | |
typedef void(^Block)(); | |
typedef void(^ConditionalBlock)(BOOL); | |
typedef NSString*(^BlockThatReturnsString)(); | |
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL); | |
// block property with typedef: |
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
#ifdef DEBUG | |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#else | |
#define DLog(...) do { } while (0) | |
#define ALog(...) [TestFlight passCheckpoint:[NSString stringWithFormat:__VA_ARGS__]] | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS | |
#endif | |
#endif |
NewerOlder