键盘的隐藏,两种方法:一、叫出键盘的那个控件(第一响应值),调用resignFirstResponder方法,就能隐藏键盘。 例如:定义一个文本框,@property (weak, nonatomic) IBOutlet UITextField *txtUserName; 可以这样实...
分类:
其他好文 时间:
2015-04-29 23:14:58
阅读次数:
142
iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存。但是学习还是很有必要的。 在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都很熟悉了,在此我也不介绍,网上...
分类:
其他好文 时间:
2015-04-29 17:42:08
阅读次数:
189
在不久前看AFNetworking的源码时候发现了这么一句:
1
2
3
4
5
6
7
8
9
10
// 不知道这行代码的使用场景的同学你该去自习看看ARC的注意事项和Block的使用了
// AFNetworking的写法
__weak __typeof(&*self)weakSelf = self;
// 我之前一直这么写的
__weak __typeof...
分类:
其他好文 时间:
2015-04-28 18:29:55
阅读次数:
186
strong。weak,copy的详解对象使用strong,ui控件使用weak,字符串用copy现在使用ARC,ARC判断准则:只要没有强指针指向对象中,找个对象就会被销毁。1. Strong/weak默认情况下下是强指针 Person *person = [[Person alloc] init...
分类:
移动开发 时间:
2015-04-28 18:16:41
阅读次数:
168
iOS培训------我的c语言笔记,期待与您交流!copy,assign,strong,retain,weak,readonly,readwrite,nonatomic,atomic,unsafe_unretained的使用与区别最近在学习iOS的过程个遇到了不少问题,知道概念也看过示例代码,但是...
分类:
其他好文 时间:
2015-04-28 15:29:18
阅读次数:
149
//C++智能指针模板类复习
#include
#include
using namespace std;
//智能指针用于确保程序不存在内存和资源泄漏且是异常安全的。
//C++98中提供了auto_ptr,C++11摒弃了auto_ptr,并提出了unique_ptr 、shared_ptr、weak_ptr
void show1()
{
int* p = ne...
分类:
编程语言 时间:
2015-04-27 21:57:40
阅读次数:
247
第一步,在storyboard中拖入一个iAd BannerView控件,做好布局就ok了。第二步,将控件引用到viewController中第四步,代码部分。import UIKit
import iAd
class ViewController: UIViewController,ADBannerViewDelegate { @IBOutlet weak var MyAd: ADBanne...
分类:
移动开发 时间:
2015-04-27 09:58:26
阅读次数:
177
在ios中可以采用声明是属性来定义实例变量和属性在.h文件中直接使用@property 在.m文件中使用扩张定义内部使用的的格式位@property(参数1,参数2)类型 名称参数有三类 1.读写属性的 :(readwrite/readonly/setter=/getter=) 2....
分类:
移动开发 时间:
2015-04-25 21:01:06
阅读次数:
178
nomantic、copy、retain等属性见前面的文章
今天看__unsafe_unretain、__strong、__weak、__autoreleasing这四种属性
__unsafe_unretain、__strong、__weak、__autoreleasing是出现在 LLVM 编译器 3.0版本之后。
而__unsafe_unretain、__strong、__autorel...
分类:
其他好文 时间:
2015-04-25 18:29:29
阅读次数:
189
static int myTime = 30;
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIButton *btn;
@property (weak, nonatomic) ...
分类:
移动开发 时间:
2015-04-24 09:22:10
阅读次数:
230