1.__weak typeof(self) myself = self;2.__weak RecommendViewController *recommendVC = self;以上两种写法是一种效果typeof(self) 是获取到self的类型,这样定义出的weakSelf就是和self一个类型...
分类:
其他好文 时间:
2016-01-06 23:50:20
阅读次数:
481
BowenCollectionViewCell.xib 1 #import 2 3 @interface BowenCollectionViewCell : UICollectionViewCell 4 5 @property (weak, nonatomic) IBOutlet U...
分类:
移动开发 时间:
2016-01-06 17:23:36
阅读次数:
911
不知道大家有没有遇到要设置某些字体的颜色和大小等属性的设置,下面就让我们一起走进字体的变形王国吧!!!1.在storyboard中拖一个控件label,拖线设置属性为:@property (weak, nonatomic) IBOutlet UILabel *EasyLabel;2.在viewDid...
分类:
其他好文 时间:
2016-01-06 15:27:12
阅读次数:
136
一.NSThread线程间通信#import "ViewController.h"@interface ViewController ()@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;@property (weak, ...
分类:
编程语言 时间:
2016-01-05 22:14:49
阅读次数:
530
一、实现效果实现图片的自动轮播 二、实现代码storyboard中布局代码: 1 #import "ViewController.h" 2 #define HMImageCount 5 3 @interface ViewController () 4 @property (weak, ...
分类:
移动开发 时间:
2016-01-03 20:56:11
阅读次数:
1120
1.什么情况使用 weak 关键字,相比 assign 有什么不同? (1)什么情况使用 weak 关键字? 在ARC中,在有可能出现循环引用的时候,往往要通过让其中一端使用weak来解决,比如:delegate代理属性。 自身已经对它进行一次强引用,没有必要再强引用一次,此时也会...
分类:
移动开发 时间:
2016-01-03 17:07:17
阅读次数:
199
帧动画的完整实现: 直接上代码演示更加清晰 1 帧动画完整代码实现: 2 #import "ViewController.h" 3 @interface ViewController () 4 5 @property (weak, nonatomic) IBOutlet UIImageView *....
分类:
其他好文 时间:
2016-01-02 01:02:32
阅读次数:
204
C语言方面:1.字符串2.递归OC语法方面:1.copy2.block3.ARC4.weak指针 strong指针iOS开发:1.MVC 总结自斯坦福大学iOS课程
分类:
其他好文 时间:
2015-12-30 23:36:11
阅读次数:
222
import UIKitclass ViewController: UIViewController { @IBOutlet weak var wc: UIWebView! override func viewDidLoad() { super.viewDidLoad() let url = NSU...
分类:
移动开发 时间:
2015-12-29 12:27:27
阅读次数:
154
@property与@synthesize是成对出现的,可以自动生成某个类成员变量的存取方法。在Xcode4.5以及以后的版本,@synthesize可以省略。1.atomic与nonatomicatomic:默认是有该属性的,这个属性是为了保证程序在多线程情况,编译器会自动生成一些互斥加锁代码,避...
分类:
其他好文 时间:
2015-12-28 18:33:25
阅读次数:
130