#import "ViewController.h"@interface ViewController ()@property(nonatomic,weak)IBOutlet UIButton *button;@property(nonatomic,weak)IBOutlet UIImageView...
分类:
其他好文 时间:
2015-08-29 15:16:04
阅读次数:
157
#import "ViewController.h"
@interface ViewController ()
@property(nonatomic,weak)IBOutlet UIButton *button;
@property(nonatomic,weak)IBOutlet UIImageView *imageView;
@end
@implementation ViewCo...
分类:
其他好文 时间:
2015-08-29 14:03:17
阅读次数:
121
一、字典转模型(plist文件)模型的封装方法:(放到代码仓库中)1.在.h文件中添加与plist文件key值对应的属性名Array --- > NSArray
Dictionary --- > NSDictionary
string ---> NSString
number ---> NSNumber注意:属性名和plist中key值一定要一致2..h文件文件中属性的strong weak cop...
分类:
移动开发 时间:
2015-08-29 06:21:31
阅读次数:
188
1 #import "ViewController.h" 2 #import 3 4 @interface ViewController () 5 @property (weak, nonatomic) IBOutlet UILabel *nameLabel; 6 @proper...
分类:
其他好文 时间:
2015-08-28 15:12:51
阅读次数:
138
strong与weak是由ARC新引入的对象变量属性
xcode 4.2(ios sdk4.3和以下版本)和之前的版本使用的是retain和assign,是不支持ARC的。xcode 4.3(ios5和以上版本)之后就有了ARC,并且开始使用
strong与weak
assign: 用于非指针变量。用于
基础数据类型 (例如NSInteger)和C数据类型(int,...
分类:
其他好文 时间:
2015-08-27 13:28:18
阅读次数:
188
strong与weak是由ARC新引入的对象变量属性xcode 4.2(ios sdk4.3和以下版本)和之前的版本使用的是retain和assign,是不支持ARC的。xcode 4.3(ios5和以上版本)之后就有了ARC,并且开始使用strong与weakassign: 用于非指针变量。用于基...
分类:
其他好文 时间:
2015-08-27 12:33:34
阅读次数:
81
C++没有提供垃圾回收机制,C++11提供的智能指针能够在一定程度上解决C++内存泄漏的问题。C++11提供了共享智能指针(shared_ptr),独占智能指针(unique_ptr),弱引用指针指针(weak_ptr),使用时需要引用智能指针本质上存储动态分配(堆)对象的指正的模板类,用于对堆对象...
分类:
编程语言 时间:
2015-08-26 15:20:36
阅读次数:
338
iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存。但是学习还是很有必要的。
在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都很熟悉了,在此我也不介绍,网上有很多相关文章。
现在我们看看iOS5中新的关键字strong, weak, unsafe_unretained. 可以与以前的关键字对应学习strong与r...
分类:
移动开发 时间:
2015-08-26 12:14:57
阅读次数:
180
weak/拷贝1. weak只要没有strong指针指向对象,该对象就会被销毁2. 拷贝NSString和block用copycopy语法的作用产生一个副本修改了副本(源对象)并不会影响源对象(副本)实现拷贝的方法copy: 返回的是不可变副本可变字符串调用copy生成不可变的副本副本与源对象(不可...
分类:
其他好文 时间:
2015-08-25 23:11:19
阅读次数:
144
http://codeforces.com/problemset/problem/61/E
E. Enemy is weak
time limit per test
5 seconds
memory limit per test
256 megabytes
input
standard input
output
stan...
分类:
编程语言 时间:
2015-08-25 19:45:05
阅读次数:
600