Skip to content
pjc0247 edited this page Oct 23, 2014 · 2 revisions

create함수의 구조.

class Object{
public:
  static Object *create(int arg);
  bool init(int arg);
};
Object *Object::create(int arg){
  Object *o = new Object();

  if(o && o->init(arg)){
    o->autorelease();
    return o;
  }
  else{
    delete o;
    return nullptr;
  }
}

Clone this wiki locally