search

Home  >  Q&A  >  body text

objective-c - ios block 置空处理用NULL还是nil

最近写代码发现一个问题, 只是想细致推敲下.
一些三方的方法会这样写:
[self.navigationController presentViewController:vc animated:YES completion:NULL];
这句我一般会写成:
[self.navigationController presentViewController:vc animated:YES completion:nil];

问题来了, completion对应的是个block. block置空是用NULL好些呢还是nil?

淡淡烟草味淡淡烟草味2757 days ago560

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-02 09:35:59

    Block is an object, generally usednil,当然你用NULLno problem

    reply
    0
  • Cancelreply