首先,keyPath一定是frame,而不是frame.origin.x之类的路径,因为再点下去的话,就是访问结构体内部的值了,KVO是无法检测的,会报错找不到KeyPath。代码如下:1
[_funcMenuVC.view addObserver:self forKeyPath:@"fra...
分类:
其他好文 时间:
2014-06-02 20:07:13
阅读次数:
218
在不使用GCD下载情况:-(void)btnPress:(id)sender{self.labContent.text=@"";self.indicator.hidden=NO;[self.indicatorstartAnimating];NSOperationQueue*que=[[NSOperationQueuealloc]init];NSInvocationOperation*op=[[NSInvocationOperationalloc]initWithTarget:selfsele..
分类:
Web程序 时间:
2014-06-02 14:27:37
阅读次数:
265
【题目】
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" ...
分类:
其他好文 时间:
2014-06-02 10:38:17
阅读次数:
246
Subsets
Total Accepted: 13267 Total
Submissions: 48509My Submissions
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-desc...
分类:
其他好文 时间:
2014-06-02 10:28:35
阅读次数:
186
?通过UITextField的代理方法能够监听键盘最右下角按钮的点击1.成为UITextField的代理self.textField.delegate
= self;2.遵守UITextFieldDelegate协议,实现代理方法- (BOOL)textFieldShouldReturn:(UITe...
分类:
其他好文 时间:
2014-06-02 06:43:59
阅读次数:
207
可视化语法 Visual Format SyntaxThe following are
examples of constraints you can specify using the visual format. Note how the
text visually matches the im...
分类:
移动开发 时间:
2014-06-02 05:37:46
阅读次数:
351
iOS7刚发布的时候,总是出现这个 Can't add self as subview 的崩溃,团队内部没出现过,但是外部用户的crash频频上报这个崩溃。
异常描述和崩溃堆栈是这样的:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add se...
分类:
其他好文 时间:
2014-06-01 17:32:08
阅读次数:
489
【题目】
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list.
【题意】
...
分类:
其他好文 时间:
2014-06-01 15:08:34
阅读次数:
237
【题目】
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solution is trivial, could you do it iteratively?
confused what "{1,#,2...
分类:
其他好文 时间:
2014-06-01 13:01:23
阅读次数:
279
Merge Sorted ArrayGiven two sorted integer
arrays A and B, merge B into A as one sorted array.Note: You may assume that A
has enough space (size that ...
分类:
其他好文 时间:
2014-06-01 12:04:32
阅读次数:
175