问题: storyboard新建viewcontroller后,无法关联第一控制器,显示黑屏,console显示 Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 解决办法: In your story board file select the viewController you w
1:第一种多线程 func fun1(){ for i in 200...300{ NSLog("%d",i); } } func fun2(){ for i in 300...400{ NSLog("%d",i); } } var th1 = NSThread(target:self,selector:"fun1",object:nil); th1.start(); //开启线程 NSThread.detachNewThreadSelector
1.Swift 无需写break,所以不会发生这种贯穿(fallthrough)的情况.2.//用不到变量名,可用"_"替换 for _ in 1...power { answer *= base } 3.case 可以匹配更多的类型模式,包括区间匹配(range matching),元组(tuple)和特定类型的描述. 可以这样用case case 1...3: naturalCount = "a few" 4.如果存在多个匹配,那么只会执行第一个被匹配到的 ca
1.//下面的这些浮点字面量都等于十进制的12.1875: let decimalDouble = 12.1875 let exponentDouble = 1.21875e1 let hexadecimalDouble = 0xC.3p0//==12+3*(1/16) 2.//类型别名,用typealias关键字来定义类型别名 typealias AudioSample = UInt16 var maxAmplitudeFound = AudioSample.min 3.//元组 let ht