我有一个UISearchDisplayController,它在tableview中显示结果.当我尝试滚动tableview时,contentsize正好是_keyboardHeight比它应该更高.这导致错误的底部偏移.tableview中有大于50个项目,因此下面不应有空格

我正在使用Charles来查看我的应用和服务器之间的流量.NTLM握手有3个步骤.2次失败然后成功.但是,在成功步骤中,我的NSURLRequest正文现在为null.我不会在我的应用程序中将其设置在任何位置,并且只能假设它位于iOS框架内部的某个深处.
一旦我通过身份验证,请求机构就会保持应有的状态.它只是在握手期间才打破.
FWIW,这是设置auth块的代码片段
[[operation HTTPRequestOperation] setWillSendRequestForAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
if (challenge.previousFailureCount <= 0)
{
NSURLCredential *credential = [self credential];
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
} else
{
[[RKObjectManager sharedManager].operationQueue cancelAllOperations];
[[NSNotificationCenter defaultCenter] postNotificationName:NSNotificationName_authenticationFailed object:nil];
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
}];
Run Code Online (Sandbox Code Playgroud)
有没有其他人遇到过这个?
在我的夹具setUp我有以下
-(void)setUp{
_vc = [OCMockObject partialMockForObject:[[InboxViewController alloc] init]];
//stub out the view stuff
[[_vc stub] removeTask:OCMOCK_ANY];
[[_vc stub] insertTask:OCMOCK_ANY];
}
Run Code Online (Sandbox Code Playgroud)
夹具中有15个测试,但是,我需要实际测试这两个方法是否被调用,所以我写了2个测试
-(void)someTest{
[[_vc expect] removeTask:OCMOCK_ANY];
[_vc removeAllTasksFromList:taskList notInList:newTaskList];
[_vc verify];
}
Run Code Online (Sandbox Code Playgroud)
但那次测试失败了
我也试过了
-(void)someTest{
[[_vc stopMocking];
[[_vc expect] removeTask:OCMOCK_ANY];
[[_vc stub] removeTask:OCMOCK_ANY];
[_vc removeAllTasksFromList:taskList notInList:newTaskList];
[_vc verify];
}
Run Code Online (Sandbox Code Playgroud)
但测试仍然失败.我错过了什么,或者这就是OCMock的工作方式?
我能让它发挥作用的唯一方法就是这样
-(void)someTest{
//re create and init the mock object
_vc = [OCMockObject partialMockForObject:[[InboxViewController alloc] init]];
[[_vc expect] removeTask:OCMOCK_ANY];
[[_vc stub] removeTask:OCMOCK_ANY];
[_vc removeAllTasksFromList:taskList notInList:newTaskList];
[_vc verify];
}
Run Code Online (Sandbox Code Playgroud) 是否可以为ICS版本设置一个开关小部件,但是有一个用于预ICS的复选框?如果是这样,怎么样?
我不担心其他组件,只有开关.
我的解决方案
看到switch和checkbox都从CompoundButton继承,我就是这么做的
((CompoundButton)findViewById(R.id.swTax)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
calculateValues();
}
});
Run Code Online (Sandbox Code Playgroud) class Batch extends Eloquent {
public function coupons() {
return $this->hasMany('Coupon');
}
}
class Coupon extends Eloquent {
public function batch() {
return $this->belongsTo('Batch');
}
public function price() {
$batch = $this->batch;
return $batch->price;
}
}
Run Code Online (Sandbox Code Playgroud)
$coupon->price 给我这个错误:
LogicException Relationship方法必须返回类型为Illuminate \ Database \ Eloquent \ Relations \ Relation的对象
但是,$coupon->batch->price工作正常。
我想念什么?