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
//其中 __OPTIMIZE__ 为 项目在 release模式下 | |
#ifndef __OPTIMIZE__ | |
# define NSLog(...) NSLog(__VA_ARGS__) | |
#else | |
# define NSLog(...) {} | |
#endif |
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
#coding=utf-8 | |
''' | |
Created on 2014年9月25日 | |
@author: cocoajin | |
''' | |
import httplib,urllib | |
base='httpbin.org' #不需要添加 "http://" |
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
#coding=utf-8 | |
''' | |
Created on 2014年9月17日 | |
@author: cocoajin | |
test | |
''' |
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
// Show a secure text entry alert with two custom buttons. | |
- (void)showSecureTextEntryAlert { | |
NSString *title = NSLocalizedString(@"A Short Title Is Best", nil); | |
NSString *message = NSLocalizedString(@"A message should be a short, complete sentence.", nil); | |
NSString *cancelButtonTitle = NSLocalizedString(@"Cancel", nil); | |
NSString *otherButtonTitle = NSLocalizedString(@"OK", nil); | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitle, nil]; | |
alert.alertViewStyle = UIAlertViewStyleSecureTextInput; |
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
/* | |
iOS上传所需基本图片 | |
icon | |
● Icon.png – 57×57 iPhone应用图标 | |
● [email protected] – 114×114 iPhone Retina显示屏应用图标 | |
● Icon-72.png – 72×72 iPad应用图标 |
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
/* | |
安装:配置 | |
1:所需frame.work; | |
CFNetwork, SystemConfiguration, MobileCoreServices, CoreGraphics and libz.dylib libxml2.dylib | |
3: 删除 Tests文件夹里面的测试 | |
2: ASI Tests 需要 https://github.com/gh-unit/gh-unit/tree/master 然后导入 :GHUnitIOS.framework | |
3:bulid setting Header search path 添加 /usr/include/libxml2 | |
4:在 test/ASIDataCompareTest.m中有个 NStask错误,删除文件即可; | |
5: 如果使用 Test文件加里面的东西,使用 GHUnitIOS.framework http://stackoverflow.com/questions/13925437/ghunitios-ghunit-h-file-not-found-in-xcode | |
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 *className = [item[kItemKeyClassPrefix] stringByAppendingString:@"ViewController"]; | |
if (NSClassFromString(className)) { | |
Class aClass = NSClassFromString(className); | |
id instance = [[aClass alloc] init]; | |
if ([instance isKindOfClass:[UIViewController class]]) { | |
[(UIViewController *)instance setTitle:item[kItemKeyTitle]]; |
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 *aArray = [[NSArray alloc]init]; | |
aArray = @[ | |
//dic 1 | |
@{@"key1": @"object1", | |
@"key2": @"object2", | |
}, | |
//dic 2 | |
@{@"key1": @"object1", | |
@"key2": @"object2", |