ios之alloc和init

 
复制代码
  1. SomeObject *obj = [[SomeObject alloc] initWithCenter:centerPoint radius:radius];







 
复制代码
  1. SomeObject *obj = [SomeObject alloc];[obj initWithCenter:centerPoint radius:radius];





这两句不是等效的。第二句的执行结果可能返回无效对象。

原文地址:https://www.cnblogs.com/yulang314/p/3551502.html