更新时间:2022-06-15 22:22:55
你设置属性的语法错误,应该是
Your syntax to set a property is wrong, it should be
products.nameProd = self.txtNameFeild.text;
编译器翻译成等价物
[products setNameProd:self.txtNameFeild.text];
并且 arrayOFProducts
应该声明为 NSMutableArray
如果您想向其中添加对象.
And arrayOFProducts
should be declared as NSMutableArray
if you want to add objects to it.
(请注意,您可以从源代码中删除 @synthesize
语句,当前的 Clang 编译器会自动合成属性.)
(Note that you can remove the @synthesize
statements from your source code,
the current Clang compiler synthesizes properties automatically.)