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
for (NSUInteger i = 0; i < [info.allKeys count]; i++) | |
{ | |
NSString *field = info.allKeys[i]; | |
SEL setField = NSSelectorFromString([NSString stringWithFormat:@"set%@", field]); | |
if ([newUser respondsToSelector:setField]) | |
{ | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" |
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
public interface XMPPActions | |
{ | |
public abstract void sendMessageWithBody(String text, String jid); | |
} | |
public class XMPPNormalActions implements XMPPActions | |
{ | |
- void sendMessageWithBody(String text, String jid) | |
{ | |
/** código relacionado ao envio de mensagem usando chat normal **/ |
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
NSDictionary *original = @{ | |
@"Campo de Teste" : @{@"order" : @"1"}, | |
@"Alguma coisa" : @{@"order" : @"4"}, | |
@"outro teste" : @{@"order" : @"2"}, | |
@"fala cara" : @{@"order" : @"3"}, | |
}; | |
NSArray *sortedArray; | |
sortedArray = [original.allKeys sortedArrayUsingComparator:^NSComparisonResult(NSString *a, NSString *b) { |
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)enableKeyboardNotifications | |
{ | |
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; | |
[defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; | |
[defaultCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; | |
} | |
- (void)keyboardWillShow:(NSNotification *)aNotification | |
{ |
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
Try to reduce the size of images | |
If you cannot reduce the size for any reasons, try the below code (operationQueue is an ivar of the instance of NSOperationQueue) | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"]; | |
[operationQueue addOperationWithBlock:^{ |
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
self.tableView.layer.shadowColor = [UIColor darkGrayColor].CGColor; | |
self.tableView.layer.shadowOffset = CGSizeMake(1.0f, 1.0f); | |
self.tableView.layer.shadowOpacity = 0.4; | |
self.tableView.layer.shadowRadius = 5.0f; | |
self.tableView.clipsToBounds = NO; | |
self.tableView.layer.masksToBounds = NO; |
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
*** initializing submodules *** | |
$ git submodule init | |
$ git submodule update |
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 <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
unsigned int unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit; | |
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | |
NSDate *date1 = [dateFormatter dateFromString:@"2013-06-28 00:00:00"]; |
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 <Foundation/Foundation.h> | |
/** | |
Author: Sérgio Vieira - [email protected] - 2013 | |
**/ | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSUInteger max = 100; | |
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 <iostream> | |
#include <cstdio> | |
#include <queue> | |
/** | |
Author: Sérgio Vieira - [email protected] - 2013 | |
Usage: banco < entrada.txt | |
**/ | |
using namespace std; |
OlderNewer