码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
一个消除if语句的例子
// 一个按钮点击事件,判断点击按钮是那一个显示出他的信息- (IBAction)buttonPressed:(id)sender { if (sender == self.leftButton) { NSLog(@"%@", self.leftButton.currentTit...
分类:其他好文   时间:2014-07-16 18:19:06    阅读次数:167
IOS代码库
1 /* 九宫格计算 */ 2 int totalCol = 5;//指定总列数 3 4 CGFloat viewW = 50;//subview宽度 5 CGFloat viewH = 50;//subview高度 6 7 CGFloat marginX = (self.view.bound...
分类:移动开发   时间:2014-07-16 18:15:23    阅读次数:204
python 实现求和、计数、最大最小值、平均值、中位数、标准偏差、百分比。
import sys class Stats: def __init__(self, sequence): # sequence of numbers we will process # convert all items to floats for numeri...
分类:编程语言   时间:2014-07-16 18:06:48    阅读次数:257
【leetcode】Reorder List (python)
问题的思路是这样: 循环取头部合并,其实也可以换个角度来看,就是将后面的链表结点,一次隔空插入到第一部分的链表中。 class Solution: # @param head, a ListNode # @return nothing def reorderList(self, head): if None == head or None == ...
分类:编程语言   时间:2014-07-16 17:23:30    阅读次数:207
【leetcode】Linked List Cycle (python)
题目分析见这里 class Solution: # @param head, a ListNode # @return a list node def detectCycle(self, head): if None == head or None == head.next: return None pfast = ...
分类:编程语言   时间:2014-07-16 17:18:53    阅读次数:248
What the difference between __weak and __block reference?
近日遇到一个很细的知识点,关于block的循环引用问题,相比很多人都遇到了,也能顺利解决了,至于block方面的技术文章,那就更多了,这里不再赘述,但是有这样一个问题: What the difference between __weak and __block reference?  使用场景: __block typeof(self) tmpSelf = self; [self meth...
分类:其他好文   时间:2014-07-16 17:09:11    阅读次数:203
设置背景为白色,避免从A视图跳转到B视图的时候出现卡顿
- (void)viewDidLoad{ [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor];}
分类:其他好文   时间:2014-07-16 17:06:52    阅读次数:163
popToViewController的用法(跳转到你想跳转到的那个控制器)
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:?] animated:YES];或for (UIViewController *temp ...
分类:其他好文   时间:2014-07-16 11:56:24    阅读次数:188
【leetcode】Linked List Cycle (python)
class Solution: # @param head, a ListNode # @return a boolean def hasCycle(self, head): if None == head or None == head.next: return False pfast = head ...
分类:编程语言   时间:2014-07-16 09:50:21    阅读次数:271
Lua面向对象设计
面向对象的基础是类,但Lua中没有提供类的概念,所以我们需要利用Lua现有的机制来实现类似于类的有关oop的一整套概念。基本方案是使用table来实现类机制,并且结合使用self参数和冒号操作。我们先来看看self参数和冒号操作符的用法: self参数的使用是很多面向对象语言的要点,大多数OO...
分类:其他好文   时间:2014-07-16 00:43:18    阅读次数:296
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!