Obj-C对象有两个指针?

时间:2016-10-21 12:22:54

标签: ios objective-c xcode pointers

第一和第二指针有什么区别?

2 个答案:

答案 0 :(得分:10)

<head> <base href="https://polygit.org/polymer+1.7.0/components/"> <script src="webcomponentsjs/webcomponents-lite.min.js"></script> <link rel="import" href="polymer/polymer.html"> <link rel="import" href="iron-icons/iron-icons.html"> <link rel="import" href="paper-input/paper-input.html"> <link rel="import" href="paper-icon-button/paper-icon-button.html"> </head> <body> <x-foo></x-foo> <dom-module id="x-foo"> <template> <paper-input id="oldPassword" type="password" label="Old password" no-label-float required> <paper-icon-button suffix on-tap="toggleVisibility" icon="[[setVisibility(passVisible)]]"> </paper-icon-button> </paper-input> <paper-input id="newPassword" type="password" label="New password" no-label-float required> <paper-icon-button suffix on-tap="toggleVisibility" icon="[[setVisibility(passVisible)]]"> </paper-icon-button> </paper-input> </template> </dom-module> </body>是一个指向object实例的变量。该实例位于您标记为#2的地址的内存中。

但是,变量本身必须存在于某处,它位于您标记为#1的地址。

或者,从另一个角度来看,你可以写NSObjectNSObject *object;的内容是地址#2,但object的位置是地址#1。

答案 1 :(得分:3)

为了清晰起见,只需添加图片

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $collection = $this->_productCollectionFactory->create(); foreach($collection as $data){ $product=$this->_product->setStoreId(1)->load($data->getEntityId()); $product->setData('name',false); $product->save(); } 是变量address1的地址,obejct是变量`object'的内容地址

或者您可以说address2我们已将address1存储为值

enter image description here