99热99这里只有精品6国产,亚洲中文字幕在线天天更新,在线观看亚洲精品国产福利片 ,久久久久综合网

歡迎加入QQ討論群258996829
Daniel 頭像
蘋果1袋
1
Daniel

蘋果Mac Pro垃圾桶 最低配的ME253CH

發(fā)布時(shí)間:2017-03-23 13:20  回復(fù):61  查看:31338   最后回復(fù):2017-05-31 21:13  
Swift 頭像
蘋果5袋
5
Swift   2017-04-30 10:37
Equatable我是從 [The Swift Programming Language (Swift 3.0)] 中文版里看到的,鏈接: 泛型 - Swift 3.0 教程
Sequence的介紹我也沒有看到,是我自己根據(jù)字面意思做的解釋。
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-07 01:02

Currently I am studying the 3rd book "Swift Programming", I think it is a quite useful book.

I can send electronic copies of the book to you if you want (send me an e-mail).

dkychang@qq.com

Swift 頭像
蘋果5袋
5
Swift   2017-05-08 00:31
已收到,謝謝!
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-08 11:48
I have two iOS books (front pages shown before) which I have not yet started reading because I have no Mac machine yet.
Are you interested in having their electronic copies?
dkychang@qq.com
Swift 頭像
蘋果5袋
5
Swift   2017-05-08 22:53
謝謝,暫時(shí)不需要了,全英文的看著有點(diǎn)吃力,我還是先看看中文視頻。
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-09 16:49
同你相反, 我看中文的計(jì)算機(jī)書有點(diǎn)吃力.
Satlantisy 頭像
蘋果0袋
0
Satlantisy   2017-05-09 21:17
買個(gè)macbook air或者mini最便宜的也夠用了  網(wǎng)頁版沒有實(shí)時(shí)顯示效果 
Satlantisy 頭像
蘋果0袋
0
Satlantisy   2017-05-09 21:20
@Daniel
I have two iOS books (front pages shown before) which I have not yet started reading because I have no Mac machine yet.
Are you interested in having their electronic copies?
dkychang@qq.com
Hey Daniel, I'd like to read those IOS books, email me a copy please.
I appreciate for your help!
szp895@gmail.com

Swift 頭像
蘋果5袋
5
Swift   2017-05-09 23:35
@Daniel
同你相反, 我看中文的計(jì)算機(jī)書有點(diǎn)吃力.
?
Swift 頭像
蘋果5袋
5
Swift   2017-05-09 23:38
@Satlantisy
買個(gè)macbook air或者mini最便宜的也夠用了  網(wǎng)頁版沒有實(shí)時(shí)顯示效果 
是指這個(gè)網(wǎng)站嗎?能具體說一下情況嗎?
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-13 07:42
@Swift
已收到,謝謝!
Do you understand the following code of Listing 18.16 of the book that you received?
Especially the 2nd init of the class definition (like a recursive definition?)

fileprivate	class	IntArrayBuffer	{
	var	storage:	[Int]
	init()	{
		storage	=	[]
	}
	init(buffer:	IntArrayBuffer)	{
		storage	=	buffer.storage
	}
 }
struct	IntArray	{
	private	var	buffer:	IntArrayBuffer
	init()	{
		buffer	=	IntArrayBuffer()
	}
	func	describe()	{
		print(buffer.storage)
	}
 }

Swift 頭像
蘋果5袋
5
Swift   2017-05-13 23:40
@Daniel 
//兩個(gè)init是獨(dú)立的,只是多了一個(gè)方式來創(chuàng)建IntArrayBuffer
fileprivate	class	IntArrayBuffer	{
	var	storage:	[Int]
        //這個(gè)沒有傳遞參數(shù),把storage初始化為空數(shù)組。
	init()	{
		storage	=	[]
	}

        //這個(gè)有一個(gè)IntArrayBuffer類型的參數(shù),storage初始化為buffer.storage
	init(buffer:	IntArrayBuffer)	{
		storage	=	buffer.storage
	}
 }
struct	IntArray	{
	private	var	buffer:	IntArrayBuffer
	init()	{
		buffer	=	IntArrayBuffer()
	}
	func	describe()	{
		print(buffer.storage)
	}
 }
下面的代碼展示如何使用IntArrayBuffer
private var bufferA = IntArrayBuffer()
bufferA.storage = [1,2,3]

//把bufferA.storage復(fù)制到bufferB.storage
private var bufferB = IntArrayBuffer(buffer: bufferA)
print(bufferB.storage) //print [1,2,3]
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-16 20:34
@Swift
已收到,謝謝!
I have tried all examples in the first 25 chapters of the book(2nd edition), also corrected their mistakes and put them into a file. I can send you the file if you want it
Chapter 24 (from Listing 24.7 until the chapter end) is not easy to understand even I saw the examples working.
.
Swift 頭像
蘋果5袋
5
Swift   2017-05-17 17:37
@Daniel Thanks, Please send to me.
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-24 15:00
Do you understand the purpose of the keyword let in the following code? if you do, please explain.
I know that the code can not even be compiled without the two let.
enum ShapeDimensions {
// point has no associated value - it is dimensionless
	case point
// square's associated value is the length of one side
	case square(side: Double)
// rectangle's associated value defines its width and height
	case rectangle(width: Double, height: Double)
	func area() -> Double {
		switch self {
		case ShapeDimensions.point:
			return 0
		case let ShapeDimensions.square(side: side):
			return side * side
		case let ShapeDimensions.rectangle(width: w, height: h):
			return w * h
		}
	} 
}

var squareShape = ShapeDimensions.square(side: 10.0)
var rectShape = ShapeDimensions.rectangle(width: 5.0, height: 10.0)
var pointShape = ShapeDimensions.point
print("square's area = \(squareShape.area())") 
print("rectangle's area = \(rectShape.area())")
print("point's area = \(pointShape.area())")
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-26 19:11
Why deinit is called for the second assignment in the following code?
struct Town {

}

class Monster {

}

class Zombie: Monster {
var walksWithLimp: Bool
	init(limp: Bool, town: Town?){
		walksWithLimp = limp
	}
	convenience init(limp: Bool) {
		self.init(limp: limp, town: nil)
	}
	deinit {
		print("ZZZZombie is no longer with us.")
	}
}

var convenientZombie = Zombie(limp: true)

    convenientZombie = Zombie(limp: true)
Daniel 頭像
蘋果1袋
1
Daniel   2017-05-26 20:52
The above code can be simplified as follows. 
Why  deinit  is executed for the second assignment?
class Zombie {
var walksWithLimp: Bool

	init(limp: Bool){
		walksWithLimp = limp
	}

	deinit {
		print("ZZZZombie is no longer with us.")
	}
}

var convenientZombie = Zombie(limp: true)

   convenientZombie = Zombie(limp: true)

Daniel 頭像
蘋果1袋
1
Daniel   2017-05-26 21:29
I understand  deinit  now:
In the above code, when the 2nd assignment (line 15) is executed, the memory allocated for the Right Hand Side of the 1st assignment (line 13) is no longer used, hence the system will automatically call deinit to clean up the memory for us.

Swift 頭像
蘋果5袋
5
Swift   2017-05-27 11:50
@Daniel  關(guān)于let,剛開始我也看得不太明白,后來看了下官方文檔枚舉章節(jié),知道這個(gè)let是把后面的參數(shù)定義為常量的意思,但是你這個(gè)例子和 官方文檔里的有些區(qū)別,所以我做了一下修改:
enum ShapeDimensions {
    case point
    //原文:case square(side: Double)
    //去掉了side
    case square(Double)
    //原文:case rectangle(width: Double, height: Double)
    //去掉了width,height
    case rectangle(Double, Double)
    func area() -> Double {
        switch self {
        case ShapeDimensions.point:
            return 0
        //原文:case let ShapeDimensions.square(side: side):
        //原文中的side: side,2個(gè)side感覺有兩個(gè)變量名似的,看起來不好理解。
        //因?yàn)樽钌厦媸沁@樣寫的:case square(side: Double)
        //所以這里我覺得應(yīng)該這樣寫:case let ShapeDimensions.square(side: Double):
        //但是這樣寫編譯不通過
        //通過下面這樣的寫法就好理解為什么加let了,因?yàn)閟ide是個(gè)常量名,不能無中生有,必須用let定義出來。當(dāng)然let也可以改成var
        case let ShapeDimensions.square(side):
            return side * side
        //原文:case let ShapeDimensions.rectangle(width: w, height: h):
        //let加在case后面是這句的簡寫:case ShapeDimensions.rectangle(let w, let h):
        case let ShapeDimensions.rectangle(w, h):
            return w * h
        }
    }
}

var squareShape = ShapeDimensions.square(10.0) //原文:square(side: 10.0)
var rectShape = ShapeDimensions.rectangle(5.0, 10.0) //原文:rectangle(width: 5.0, height: 10.0)
var pointShape = ShapeDimensions.point
print("square's area = \(squareShape.area())")
print("rectangle's area = \(rectShape.area())")
print("point's area = \(pointShape.area())")

Daniel 頭像
蘋果1袋
1
Daniel   2017-05-31 10:10
我買的第3本Swift的書{Swift Programming 2nd ed.]看了二遍,還有許多高級一些的內(nèi)容不懂, 現(xiàn)在又買了第4本Swift的書[Advanced Swift3],有中文及英文版本,現(xiàn)在只收到中文版的,還沒有收到英文版的. 在我年底或明年初買到蘋果計(jì)算機(jī)前只能學(xué)Swift編程而不能開始字習(xí)iOS編程.
蘋果Mac Pro垃圾桶 最低配的ME253CH

您還未登錄,請先登錄

熱門帖子

最新帖子

?