最新发布第17页
What is a synchronous function? 什么是同步函数?-Stewed Noodles 资源

What is a synchronous function? 什么是同步函数?

By default, all Swift functions are synchronous, but what does that mean? A synchronous function is one that executes all its work in a simple, straight line on a single threa...
Swift Concurrency by Example-Stewed Noodles 资源

Swift Concurrency by Example

Async/await Sequences and streams Tasks and task groups Actors Testing Solutions
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri1年前
260
How to voluntarily suspend a task  如何自愿暂停任务-Stewed Noodles 资源

How to voluntarily suspend a task 如何自愿暂停任务

If you’re executing a long-running task that has few if any suspension points, for example if you’re repeatedly iterating over an intensive loop, you can call Task.yield()&n...
How to create a task group and add tasks to it 如何创建任务组并向其添加任务-Stewed Noodles 资源

How to create a task group and add tasks to it 如何创建任务组并向其添加任务

Swift’s task groups are collections of tasks that work together to produce a single result. Each task inside the group must return the same kind of data, but if you use enum assoc...
Understanding actor initialization 了解 actor 初始化-Stewed Noodles 资源

Understanding actor initialization 了解 actor 初始化

Swift's actors run on their own executor most of the time, so they manage how and where their work is done. However, during the actor's initialization its executor isn't ready to t...
1. 应用内购买介绍-Stewed Noodles 资源
MySQL 修改 user 表后无法登录-Stewed Noodles 资源

MySQL 修改 user 表后无法登录

修改my.cnf文件 打开my.cnf文件 vim /etc/my.cnf 把 sql-mode 的STRICT_TRANS_TABLES去掉 修改sql-mode 停止MySQL服务 输入以下的命令,停止MySQL服务。 systemctl stop mysqld.service 停止MyS...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri6个月前
0260
Day 21 - 贪吃蛇(下)-Stewed Noodles 资源

Day 21 – 贪吃蛇(下)

类继承 从现有类继承行为和外观的过程成为类继承。这里的行为和外观分别为类的方法和属性。类继承可以对现有的类进行属性以及方法的扩展。 # Fish类 class Fish: def __init__(self): '''初始化...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri2年前
0250
模型上下文-Stewed Noodles 资源

模型上下文

ModelContext 是 SwiftData 中负责跟踪所有在内存中创建、修改和删除的对象的组件。它确保这些对象能够在稍后某个时刻保存到模型容器中。ModelContext 提供了一个便捷的方式来管理对象的状态,...
jiulinxiri的头像-Stewed Noodles 资源烩之面大会员jiulinxiri1年前
0250
Important: Do not use an actor for your SwiftUI data models 重要提示:请勿将角色用于 SwiftUI 数据模型-Stewed Noodles 资源

Important: Do not use an actor for your SwiftUI data models 重要提示:请勿将角色用于 SwiftUI 数据模型

Swift’s actors allow us to share data in multiple parts of our app without causing problems with concurrency, because they automatically ensure two pieces of code cannot...