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
// | |
// MyController.h | |
// | |
// Created by Ben Copsey on 20/07/2009. | |
// Copyright 2009 All-Seeing Interactive. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <GHUnit/GHUnit.h> | |
@class ASINetworkQueue; |
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
// Do any additional setup after loading the view, typically from a nib. | |
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.imdida.org/json/city/ip"]]; | |
NSURLResponse * response; | |
NSError *error; | |
NSData * jsonData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; | |
NSDictionary * results = [jsonData objectFromJSONData]; | |
NSLog(@"%@",[results objectForKey:@"ip"]); |
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
// | |
// ARC Helper | |
// | |
// Version 2.1 | |
// | |
// Created by Nick Lockwood on 05/01/2012. | |
// Copyright 2012 Charcoal Design | |
// | |
// Distributed under the permissive zlib license | |
// Get the latest version from here: |
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
iewController的初始化: | |
从Storyboards中加载的时候,会调用initWithCode,如果不存在则调用init。之后对里面的每个对象调用awakeFromNib方法。 | |
从内存中alloc出来的情况下,调init方法。 | |
ViewController查找与其关联的view,其顺序是: | |
1 先判断子类是否重写了loadView,如果有直接调用。之后调viewDidLoad完成View的加载。 | |
2 如果是外部通过调用initWithNibName:bundle指定nib文件名的话,ViewController记载此nib来创建View。 | |
3 如果initWithNibName:bundle的name参数为nil,则ViewController会通过以下两个步骤找到与其关联的nib。 | |
A 如果类名包含Controller,例如ViewController的类名是MyViewController,则查找是否存在MyView.nib; |
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
http://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/MobileHIG.pdf | |
1.状态栏(20) | |
[1]:http://www.apple.com.cn/developer/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/art/ui_statusbartypes.jpg | |
高度:20px | |
颜色:灰色(默认)、黑色、半透明黑色(α值为0.5的黑色)3种可选 | |
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
http://developer.apple.com/library/ios/#samplecode/SpeakHere/Listings/AudioViews_AQLevelMeter_mm.html |
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
UIImage *rawBackground = [UIImage imageNamed:@"picture"]; | |
UIImage *background = [rawBackground stretchableImageWithLeftCapWidth:13 topCapHeight:22]; | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:background]; | |
imageView.frame = CGRectMake(0, 0, containerView.frame.size.width, containerView.frame.size.height); | |
imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; |
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 library在编译时需要进行 _all_load -Objc 等linker flag注意 |
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
Global ignore file: | |
echo ".DS_Store" >> ~/.gitignore | |
git config --global core.excludesfile ~/.gitignore | |
SVN-like shortcuts for often used commands: | |
git config --global alias.st status | |
git config --global alias.ci commit | |
git config --global alias.co checkout | |
git config --global alias.br branch |
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
PHP array assignment (PHP array assignment is copy by value) | |
$a = array('a', 'b', 'c'); | |
$a2 = $a; | |
上面的直接覆值是一种copy机制,会产生两个不同的数组供使用 | |
A duplicate copy of the array (copy by value) is made | |
Change in one array have no impact on other | |
$a = array("original"); | |
$b = $a; | |
$a[0] = "new"; // $b[0] will remain as "original" |
OlderNewer