Initialize and allocate multiple variables/objects | Objective C
问题 How would I turn this: xmlObject *system_domain = [xmlObject alloc] xmlObject *system_description = [xmlObject alloc] xmlObject *system_type = [xmlObject alloc] Into something where I would only have to write xmlObject and [xmlObject alloc] once. xmlObject *system_domain, *system_description, *system_type = [xmlObject alloc] This makes all of them xmlObjects, but does not allocate each one. Any help would be much appreciated. 回答1: If you've got a set of related objects, and being able to