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
CGRect newFrame = [view.superview convertRect:view.frame toView:nil]; | |
[view.window addSubview:view]; | |
view.frame = newFrame; |
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
CGRect newFrame = [newSuperview convertRect:view.frame fromView:nil]; | |
[newSuperview addSubview:view]; | |
view.frame = newFrame; |
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)floatIntoWindow { | |
if(self.superview == self.window) return; | |
CGRect newFrame = [self.superview convertRect:self.frame toView:nil]; | |
[self.window addSubview:self]; | |
self.transform = [self transformForCurrentInterfaceOrientation]; | |
self.frame = newFrame; | |
} | |
- (void)unfloatIntoView:(UIView *)newSuperview { |
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
- (NSSize)sizeWithSize:(NSSize)size { | |
if([self length] < 1) return NSZeroSize; | |
NSTextContainer *textContainer = [[[NSTextContainer alloc] initWithContainerSize:size] autorelease]; | |
NSTextStorage *textStorage = [[[NSTextStorage alloc] initWithAttributedString:self] autorelease]; | |
NSLayoutManager *layoutManager = [[[NSLayoutManager alloc] init] autorelease]; | |
[layoutManager addTextContainer:textContainer]; | |
[textStorage addLayoutManager:layoutManager]; | |
[layoutManager setHyphenationFactor:0.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
NSString *base64Encode(NSData *data); | |
NSString *base64Encode(NSData *data) { | |
BIO *context = BIO_new(BIO_s_mem()); | |
BIO *command = BIO_new(BIO_f_base64()); | |
context = BIO_push(command, context); | |
BIO_write(context, [data bytes], (int) [data length]); | |
(void) BIO_flush(context); | |
char *outputBuffer; |
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
NSIndexSet *matches = [self.elements indexesOfObjectsWithOptions:NSEnumerationConcurrent | |
passingTest:(BOOL ^(ChiroXMLElement *element, NSUInteger index, BOOL *stop){ | |
return (BOOL)([name compare:element.tag options:options] == NSOrderedSame); | |
}) | |
]; |
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
#ifndef _DCT_WEAK_H | |
#define _DCT_WEAK_H | |
// Macros for portable support of notionally weak properties with ARC | |
// Forked from https://gist.github.com/1354106 | |
// Updated by Rowan James | |
// Available at https://gist.github.com/1530868 | |
// Defines: | |
// dct_weak to be used as a replacement for the 'weak' keyword: | |
// @property (dct_weak) NSObject* propertyName; |
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
@interface MyClass : NSObject | |
@annotate(APIKey="object_id") | |
@property (nonatomic, strong) NSString *objectID; | |
@annotate(APIKey="full_name") | |
@property (nonatomic, strong) NSString *name; | |
@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
[[[NSUserDefaults standardUserDefaults] rac_subscribableForKeyPath:@"MyUserDefault" onObject:self] subscribeNext:^(id x) { | |
NSLog(@"%@", x); | |
}]; |
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
Thread 6 Crashed:: Dispatch queue: com.apple.root.default-priority | |
0 ??? 0x000000010116a390 0 + 4313228176 | |
1 libdispatch.dylib 0x00007fff9a3634e2 _dispatch_send_wakeup_main_thread + 66 | |
2 libdispatch.dylib 0x00007fff9a364e1c _dispatch_queue_wakeup_main + 48 | |
3 libdispatch.dylib 0x00007fff9a364e91 _dispatch_wakeup + 72 | |
4 libdispatch.dylib 0x00007fff9a364eef _dispatch_queue_push_list_slow + 33 |
OlderNewer