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
// Useful Macros. | |
// See http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ for details. | |
#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) | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS |
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
When connecting to a public HTTP server, a client should not maintain more | |
than two open connections to that server at one time. (RFC2616 §8.1.4) An | |
HTTP server is likely to impose its own limit on the number of simultaneous | |
connections from a single IP address anyway. Furthermore opening a large | |
number of simultaneous connections to a server may be seen as a denial of | |
service (DOS) attack upon the server. | |
Queuing HTTP 1.1 requests on a single, asynchronous connection such as | |
NSURLConnection is likely to offer the best throughput anyway - since both | |
the requests and the responses can be "pipelined" (sent back to back without |
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
[UIView animateWithDuration:1.5f | |
delay:0.0f | |
options:UIViewAnimationOptionTransitionFlipFromLeft | |
animations:^{ | |
[self.buttonsView removeFromSuperview]; | |
[self.view addSubview:self.textFieldView]; | |
} | |
completion:^(BOOL finish){NSLog(@"Finished Bool:%@",finish?@"Yes":@"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
[UIView transitionWithView:self.buttonsView duration:0.7f options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{ | |
[self.buttonsView removeFromSuperview], | |
[self.view addSubview:self.textFieldView]; | |
} completion:^(BOOL finished){ NSLog(@"Finished animation bool: %@",finished?@"YES":@"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
/// Written by Abizern | |
[UIView transitionWithView:self.view.superview duration:0.35f options:UIViewAnimationOptionTransitionFlipFromRight animations:^{ | |
UIView *containerView = self.view.superview; | |
AnalogueView *analogueView = timeViewController.analogueView; | |
[self.view removeFromSuperview]; | |
[containerView addSubview:analogueView]; | |
}completion:NULL]; | |
[UIView transitionWithView:containerView duration:0.35f options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{ |
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) downloadAndParse | |
{ | |
NSURL *nsurl = [[[NSURL alloc] initWithString:@"http://10.230.148.253:8080/IDP/services/login/authuser"] autorelease]; | |
NSMutableURLRequest* urlRequest = [[[NSMutableURLRequest alloc] initWithURL:nsurl] autorelease]; | |
NSURLConnection* conn = [NSURLConnection connectionWithRequest:urlRequest delegate:self]; | |
if(conn) | |
{ | |
// Declare an iVar NSMutableData* responseData | |
responseData = [[NSMutableData alloc] init]; | |
} |
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)setValue:(NSString *)aValue | |
{ | |
if (value != aValue) | |
{ | |
[value release]; | |
value = [aValue retain]; | |
} | |
} |
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 DownloadOperation : NSOperation | |
{ | |
NSURLRequest *request; | |
NSURLConnection *connection; | |
NSMutableData *receivedData; | |
} | |
@property(readonly) BOOL isExecuting; | |
@property(readonly) BOOL isFinished; |
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> | |
@interface NSNotificationCenter (ObserverAdditions) | |
- (void)registerObserver:(id)observer | |
forName:(NSString *)name | |
object:(id)obj | |
queue:(NSOperationQueue *)queue | |
usingBlock:(void (^)(NSNotification *note))block; |
OlderNewer