我对使用自我内部块感到困惑,我浏览了一些Apple的文档,但仍然无法找到正确的答案.
有些人总是说在块内部使用弱自我,但有些人说在复制的块中使用弱自我,而不是总是使用.
样本1:
self.handler = ^(id response, NSError *error)
{
self.newresponse = response; //use weak self here
};
Run Code Online (Sandbox Code Playgroud)
样本2:
使用弱自我;
__weak myViewController *weakSelf = self;
[UIView animateWithDuration:interval delay:0.0 options:curve animations:^
{
[weakSelf.view.superview setTransform:CGAffineTransformMakeTranslation(0, -106)];
//in above is it use of weak is neassary
}
completion:^(BOOL finished)
{
}];
Run Code Online (Sandbox Code Playgroud)
没有弱小的自我;
__weak myViewController *weakSelf = self;
[UIView animateWithDuration:interval delay:0.0 options:curve animations:^
{
[myViewController.view.superview setTransform:CGAffineTransformMakeTranslation(0, -106)];
}
completion:^(BOOL finished)
{
}];
Run Code Online (Sandbox Code Playgroud)
在上面的样本中,哪些是正确的......?**我正在使用ARC
iPhone中是否有任何压缩技术可以使用AVfoundation压缩视频.或任何开源.
此致,Jeeva