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
// | |
// BETTestSemaphor.h | |
// TwitterClient | |
// | |
// Created by Rafael Aguilar Martín on 11/11/12. | |
// Copyright (c) 2012 Rafael Aguilar Martín. All rights reserved. | |
// | |
#import <Foundation/Foundation.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
$ /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\LaunchServices.framework/Versions/A/Support/\ | |
lsregister -kill -r -domain local -domain user | |
$ killall Finder |
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://stackoverflow.com/a/23119866/1379492 | |
- (void)prepareForReuse | |
{ | |
[super prepareForReuse]; | |
self.textView.editable = YES; | |
self.textView.editable = NO; | |
self.textView.text = nil; | |
} |
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
/** | |
MKCoordinateRegion viewRegion = [self RegionForAnnotations:_arrayPois]; | |
[_mapView setRegion:viewRegion animated:YES]; | |
*/ | |
- (MKCoordinateRegion)RegionForAnnotations:(NSArray *)records { | |
MKCoordinateRegion region; | |
// center the map arround our records | |
// @see https://devforums.apple.com/message/48525#48525 |
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
/** | |
@see http://stackoverflow.com/questions/3889687/how-to-compress-an-image-taken-by-the-camera-in-iphone-sdk | |
UIImage *image = [self scaleImage:myImage toSize:CGSizeMake(320.0,480.0)]; | |
*/ | |
-(UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)newSize { | |
UIGraphicsBeginImageContext(newSize); | |
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; | |
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |
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
/** | |
@see http://www.dbsnippets.com/2012/09/11/objective-c-redondear-esquinas-de-un-uiview/ | |
You must import basic Core Animation classes | |
#import <QuartzCore/QuartzCore.h> | |
Example: | |
[self roundView:backgroundColorView onCorner:(UIRectCornerAllCorners) radius:10.0]; | |
[self roundView:imgView onCorner:(UIRectCornerTopLeft|UIRectCornerBottomLeft) radius:5.0]; | |
*/ |
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
static bool debuggerRunning(void) { | |
int junk; | |
int mib[4]; | |
struct kinfo_proc info; | |
size_t size; | |
info.kp_proc.p_flag = 0; | |
mib[0] = CTL_KERN; | |
mib[1] = KERN_PROC; |
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
__weak typeof(self) weakSelf = self; |
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
#pragma mark - Reveal | |
#import <dlfcn.h> | |
- (void)startReveal | |
{ | |
NSString *revealLibName = @"libReveal"; | |
NSString *revealLibExtension = @"dylib"; | |
NSString *dyLibPath = [[NSBundle mainBundle] pathForResource:revealLibName ofType:revealLibExtension]; | |
NSLog(@"Loading dynamic library: %@", dyLibPath); | |
void *revealLib = NULL; |
OlderNewer