我在哪里可以找到关于 iPhone/Objective-C 多线程的好的教程?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1004845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where can I find a good tutorial on iPhone/Objective-C multithreading?
提问by nevan king
I'm just starting to use multithreading and was looking for a good explanation. I'm not sure if there are differences in how multithreading works on Macs and iPhones. What is a good link to tutorials with example code?
我刚刚开始使用多线程并正在寻找一个很好的解释。我不确定多线程在 Mac 和 iPhone 上的工作方式是否存在差异。什么是带有示例代码的教程的好链接?
采纳答案by Robert Harvey
A simple, but complete example is Multithreading in Cocoa.
一个简单但完整的示例是Cocoa 中的多线程。
And a related Stack Overflow question is NSOperation on the iPhone.
一个相关的 Stack Overflow 问题是iPhone 上的 NSOperation。
回答by Brad Larson
Once again, if I may promote my iPhone development course, I had a class devoted to multithreading last semester, covering basic threading, locking, dealing with the UI on the main thread, and NSOperationQueues, for which the class notes can be found here. This fall semester that same class will be dominated by Grand Central Dispatch.
再说一次,如果我能宣传一下我的 iPhone 开发课程,上学期我有一节专门讲多线程的课程,涵盖了基本线程、锁定、处理主线程上的 UI 和 NSOperationQueues,课程笔记可以在这里找到。今年秋季学期,同一班级将由 Grand Central Dispatch 主导。
The video for the class can be downloaded for free from iTunes U.
该课程的视频可以从 iTunes U 免费下载。
回答by Thomas
Don't forget the official documentation from Apple: Threading Programming Guide
不要忘记 Apple 的官方文档:线程编程指南
You will find complete explanations and example code.
您将找到完整的说明和示例代码。
回答by Corey Floyd
回答by Olof
A good and short tutorial on NSInvocationOperation is Loading Images Asynchronously on iPhone using NSInvocationOperation.
关于 NSInvocationOperation 的一个很好的简短教程是使用 NSInvocationOperation 在 iPhone 上异步加载图像。

