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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 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-truncateToSize | |
// Fast Fonts | |
// | |
// Created by Stuart Shelton on 28/03/2010. | |
// Copyright 2010 Stuart Shelton. | |
// | |
// NSString truncate function for Objective C / iPhone SDK by | |
// Stuart Shelton is licensed under a Creative Commons Attribution 3.0 | |
// Unported License (CC BY 3.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
// Load html from local file | |
NSString *imagePath = [[NSBundle mainBundle] resourcePath]; | |
imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; | |
imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; | |
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"localpage" ofType:@"html"]; | |
NSData *htmlData = [NSData dataWithContentsOfFile:htmlFile]; | |
[webView loadData:htmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",imagePath]]]; | |
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
// | |
// NSArray+BinarySearch.h | |
// BinarySearch | |
// | |
// Created by Ole Begemann on 19.04.10. | |
// Copyright 2010 Ole Begemann. 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
static MySingleton *sharedInstance = nil; | |
@implementation MySingleton | |
#pragma mark - | |
#pragma mark class instance methods | |
#pragma mark - | |
#pragma mark Singleton methods |
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
ASIHTTPRequest: https://github.com/pokeb/asi-http-request | |
JSONKit: https://github.com/johnezang/JSONKit | |
EGOImageLoading: https://github.com/enormego/EGOImageLoading | |
EGOCache: https://github.com/enormego/EGOCache | |
FMDB: https://github.com/ccgus/fmdb | |
three20: https://github.com/facebook/three20 | |
------------------------------- | |
Facebook SDK: https://github.com/facebook/facebook-ios-sdk | |
------------------------------- |
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 <sys/types.h> | |
#include <ifaddrs.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
- (NSString *)getIPAddress | |
{ | |
NSString *address = @"error"; | |
struct ifaddrs *interfaces = NULL; | |
struct ifaddrs *temp_addr = NULL; | |
int success = 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
// Enumerable.h | |
#import <Foundation/Foundation.h> | |
typedef id (^InjectBlock)(id, id); | |
@interface NSArray (Enumerable) | |
- (id) inject:(id) initial block:(InjectBlock) block; | |
@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
@protocol MyControlDelegate <NSObject> | |
@optional | |
- (void)delegateAction:(id)value; | |
@end | |
@interface MyControl : NSObject{ | |
id<MyControlDelegate> delegate; | |
} |
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
// A normal singleton | |
static AppInfo * sharedAppInfo = nil; | |
+ (AppInfo *) sharedAppInfo | |
{ | |
if ( sharedAppInfo == nil ) | |
{ | |
[[self alloc] init]; | |
} | |
return sharedAppInfo; |
NewerOlder