如何过滤swift 4的对象数组,然后删除(How to filter array of objects swift 4 then remove after)
我想避免出现此错误图像的错误
这是INDEX超出范围。 我试图通过一个数组循环,但是当我找到我想要删除的东西时,我将它删除,但数组的.count与for循环的迭代保持不变,我该如何解决这个问题?
这是运行时的控制台
test i:0 count: 3 test i:1 count: 3 test i:2 count: 2
然而,to:in
for i in stride(from: 0, to: count, by: 1)
仍然似乎是3 ...
有人可以告诉我如何过滤这个数组或循环并移除? 只要它工作,我不在乎它是什么
I want to avoid getting this error image of error
which is INDEX out of range. Im trying to loop through an array but when I find something I want to remove , I delete it yet the .count of the array remains the same for that iteration of the for loop , how can I fix this?
here is console when run
test i:0 count: 3 test i:1 count: 3 test i:2 count: 2
yet the to: in
for i in stride(from: 0, to: count, by: 1)
still seems to be 3...
Can Someone show me how to filter this array or loop through and remove? as long as it works i dont care what it is
原文:https://stackoverflow.com/questions/50119824
满意答案
Unable to update the EntitySet because it has a DefiningQuery and no element exists in the element to support the current operation.
Make sure that your table has a primary key !
If not add the primary key and update the Entity Framework model and run again.
相关问答
更多db.SaveChanges()爆炸与事务异常(db.SaveChanges() Exploding with Transaction Exception)
db.SaveChanges始终提供以下内容:无法定义两个对象之间的关系(db.SaveChanges always gives the following :The relationship between the two objects cannot be defined)
参数超出EF中的db.SaveChanges()范围(Parameter is out of range on db.SaveChanges() in EF)
db.savechanges()不起作用(db.savechanges() is not working)
实体框架Db.SaveChanges()不起作用?(Entity Framework Db.SaveChanges() not working?)
EF:db.SaveChanges()vs dbTransaction.Commit(EF: db.SaveChanges() vs dbTransaction.Commit)
ASP MVC5-Custom要求验证在db.savechanges失败(ASP MVC5-Custom requiredif validation failing at db.savechanges)
实体框架SaveChanges被调用但它不起作用(Entity Framework SaveChanges is called but its not working)
我一直在尝试实现自定义登录,我将更新密码,但db.savechanges不能使用我的代码(i have been trying to implement custom login where i'll be updating the password but db.savechanges isn't working with my code)
mvc4 - db.SaveChanges() - 十进制值超出范围(mvc4 - db.SaveChanges() - decimal value out of range)
相关文章
更多千锋首发Swift视频教程
Swift入门视频教程-尚学堂视频教程
lucene4.7 过滤Filter(六)
Guava Objects类详解
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter的解决方案
一个较完整的关键字过滤解决方案(中)
lucene自定义过滤器
Solr4:利用Filter实现两组关键词组合查询
利用Decommission从Hadoop集群中Remove节点
过滤器引起的classcastException
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!