【发布时间】:2016-07-03 06:58:18
【问题描述】:
当我使用ReactiveCocoa时,我想观察我的tableView的框架,但是出现了一个问题:
__block CGRect tmp_rect;
[RACObserve(self, self.tableView.frame) subscribeNext:^(id x) {
NSLog(@"%@",x);
tmp_rect= (CGRect)x; // this line appear issue:
'Used type 'CGRect' (aka 'struct CGRect') where arithmetic or pointer type is required'
double width_radio = x.origin.x/[UIScreen mainScreen].bounds.size.width;
back_nav.alpha = 1 - width_radio;
}];
我不知道这个问题出现了什么。
【问题讨论】:
-
什么是 CGRext?没听说过。nslog的结果是什么。
-
我很抱歉,我已经编辑了我的问题。
-
不用担心。区块第一行的nslog结果是什么?
-
@Fogmeister 它记录:NSRect: {{152, 0}, {375, 667}}
标签: ios objective-c block reactive-cocoa