Posts

Showing posts from July, 2016

IOS 考題

IOS 考題 1. 宣告一個方法 帶入兩個名字 例如:JASON&OLIVIA ,方法不回傳值, 並且印出[JASON LOVE OLIVIA]。 -( void )jasonSayHelloToOlivia:( NSString *)name1:( NSString *)name2 { NSString * name1 = JASON; NSString * name2 = OLIVIA; NSLog (@ "%@ LOVE %@ " , name1 , name2 ); } 2. 宣告一個方法 帶入兩個整數,這個方法會回傳[比較大]的整數。 如果兩個整數相等,回傳任一個整數 -( int )comparteWithBigOne:( int )numberOne AndNumberTwo:( int )numberTwo { if (numberOne>numberTwo) { return numberOne; } else { return numberTwo; } 3. 宣告一個陣列,放入分數,分別是1,2,3,4,5,6。 另外宣告一個方法收到這個陣列,並求出平均 let scores = [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 ] var avg= 0.0 var sum= 0.0 let G = scores.count for i in 0. .<G { sum = sum + scores[i] print (scores[i]) } let b = Double(G) avg = sum / b print ( "sum=" + "\(sum)" ) print ( "average=" + "\(avg)" ) 4. 有一個菜單如下 黑咖啡 25 鬆餅 40 冰淇淋 50 拿鐵 60 每日點心 60 請宣告一個方法,帶入客人所點的品項名稱,並將總金額計算出來並回傳。 5. 請另外宣告一個方法,會帶入客人所點的品項與

AP102 2016/7/25 下午silvia RWD

專案管理 https://trello.com git / svn https://backlogtool.com/git-guide/tw/ 設計流程 0.使用CardSorting 1.SiteMap 2.FlowChart 3.Wireframe(不要放顏色,放圖檔) 可轉換成線稿 https://www.wirify.com/ 或者使用手繪 Paper prototyping 4.Mockup https://gomockingbird.com/ 5.Prototype(for 內部測試) http://www.teehanlax.com/tools/iphone/ 測試是否是RWD responsive Design bookmark 不要換頁 40 120 888 84 pt 繪圖範圍 標準 72dpi 1px = 1pt Retina 2px = 1pt RWD常用 em單位 16px = 1em 1/1.62 Media Queries Fluid Grid http://960.gs header : width:100% padding margin border if positrion:absolute 不要再寫padding

IOS Topic

Error Handling https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ErrorHandling.html  iphone size http://www.apple.com/iphone/compare/

Html 視窗與位置

Html 視窗與位置 依此方法可以連到特定區域 < h1 id = "t1target" > < a href = "www.google.com#t1target" > 開新視窗 “`

Html-連線上網

Html-連線上網 受歡迎的主機商推薦 http://www.wickedlysmart.com/hosting-providers/ %ftp www .google .com Connected to www .google .com Name: XXX password: XXX dir cd google put index .html dir mkdir images cd images bye put <filename> //傳送指定檔案至伺服器 get <filename> //從伺服器取得指定檔案,傳回電腦中 FTP MAC OSX Fetch $ Transmit $ Cyberduck (free) Windows Smart FTP $ WS_FTP (basic version is free Advanced version $) Cyberduck (free) URL Uniform Resource Locators (統一資源定位碼) 網址名稱 www.google.com google.com是網域名稱 www.google.com是網站名稱 http://www.google.com/index.html https:協定(protocol) www.gooogle.com網站名稱 index.html絕對路徑 微軟的預設檔案為default.htm 少一個l較為特殊 Web常用Unicode代碼 http://www.w3schools.com/charsets/ref_html_symbols.asp Unicode代碼 http://www.unicode.org/charts/

IOS多執行緒

IOS多執行緒 关于iOS多线程,你看我就够了 http://www.jianshu.com/p/0b0d9b1f1f19 NSURLSession 教程 http://www.jianshu.com/p/045cdfdaaf6e NSURLSession with NSBlockOperation and queues http://stackoverflow.com/questions/21198404/nsurlsession-with-nsblockoperation-and-queues iOS 並行程式設計: 初探 NSOperation 和 Dispatch Queues http://www.appcoda.com.tw/ios-concurrency/ background-transfer-service-ios7 http://www.appcoda.com/background-transfer-service-ios7/ Parsing JSON in Swift http://chris.eidhof.nl/post/json-parsing-in-swift/ How do I use NSOperationQueue with NSURLSession? http://stackoverflow.com/questions/21918722/how-do-i-use-nsoperationqueue-with-nsurlsession Operation Queues Cocoa operations are an object-oriented way to encapsulate work that you want to perform asynchronously. Operations are designed to be used either in conjunction with an operation queue or by themselves. Because they are Objective-C based, operations are most commonly used in Cocoa-based applications in OS

closure

closure Swift functions are closures. 意思就是closure可以在function的範圍內抓外部變數來引用 來看一下這段程式碼 class Dog { var whatThisDogSays = "woof" func bark() { print ( self .whatThisDogSays) } } 這段程式碼裡面函式指向一個變數whatThisDogSays 那變數在函式外部,因為它宣告在函式的外部,但內部的還是可以看到他並使用,因此函式bark 可以傳遞value,但whatThisDogSays 的reference 是怎麼傳遞的? func doThis(f : Void -> Void ) { f() } let d = Dog() d . whatThisDogSays = "arf" let f = d . bark doThis(f) // arf 在上面這段程式碼裡面,我們並沒有直接呼叫bark 我們創造一個Dog的實體物件d,然後傳遞bark的方法值到doThis 現在whatThisDogSays 是一個實體屬性屬於Dog類別 雖然在doThis這個方法裡面沒有whatThisDogSays 的確,在方法內doThis沒有Dog 的物件,但f()仍然可以運作 這個方法d.bark,即使他被到處傳遞,卻仍然可以看到被宣告在外的變數whatThisDogSays ,即使whatThisDogSays 這個被呼叫的變數不屬於Dog類別的物件,也不屬於任何物件的方法。 bark方法

Title3

Image
Title3 版本控制工具(Version Control System, VCS),傳統上先鎖定,然後再取出修改。 再完成修改與回傳前,其他人不能修改。 後來採用分散式作法,隨時取得然後合併(merge),Git就是這種分散式的系統。 市面上目前常用的VCS工具主要有 1.SVN 2.GiT 從2014年以後GIT正式超越SVN git的開發者是Linux的作者 Linus Torvalds 一開始 Linus Torvalds 使用BitKeeper一開始免費使用,後來開始營利。 但卻找不到免費可使用得好的版本控制工具。 當時Git的程式碼用來管理有將近七百萬行的Linux專案 Git下載 https://git-scm.com/ 在安裝畫面記得放上

IOS-charts 方法

IOS-charts 方法 var ViewForLine : [LineChartView] = [] var ViewForBar : [BarChartView] = [] //label: "Line Chart" 圖表示意 let lineChartDataSet = LineChartDataSet(yVals: dataEntries, label: "Line Chart" ) let lineChartData = LineChartData(xVals: dataPoints, dataSet: lineChartDataSet) //資料來源 ViewForLine .first ! .data = lineChartData //圖表背景顏色 ViewForLine .first ! .backgroundColor = UIColor(red: 85 / 255 , green: 85 / 255 , blue: 85 / 255 , alpha: 1 ) // X 軸圖標位置 ViewForLine .first ! .xAxis .labelPosition = .Bottom //右軸是否開啟 ViewForLine .first ? .rightAxis .enabled = false //左軸圖標位置 ViewForLine .first ? .leftAxis .labelTextColor = UIColor .whiteColor () // X 軸的 X 刻度標記顏色 ViewForLine .first ? .xAxis .labelTextColor = UIColor .whiteColor () //圖表描述文字色彩 ViewForLine .first ? .descriptionTextColor

Title24

Title24 // // BarLineChartViewBase.swift // Charts // // Created by Daniel Cohen Gindi on 4/3/15. // // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda // A port of MPAndroidChart for iOS // Licensed under Apache License 2.0 // // https://github.com/danielgindi/Charts // import Foundation import CoreGraphics #if ! os(OSX) import UIKit #endif /// Base-class of LineChart, BarChart, ScatterChart and CandleStickChart. public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartDataProvider, NSUIGestureRecognizerDelegate { 最大可顯示數值計算 /// the maximum number of entries to which values will be drawn /// (entry numbers greater than this value will cause value-labels to disappear) ## 最大可顯示數值計算 internal var _maxVisibleValueCount = 100 自動顯示比例 /// flag that indicates if auto scaling on the y axis is enabled private var _autoScaleMinMaxEnabled = false private var _autoScale

Title23

Title23 AppDelegate.m - ( BOOL )application:( UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions { // Override point for customization after application launch. return YES ; } AppDelegate.h/m define a class that manages the application overall. AppDelegate.h/m 定義了一個類別可以管理整個應用程式 The app will create one instance of that class and send that object messages that let the delegate influence the app’s behavior at well-defined times. For example, 這個應用程式會創造一個實體給類別去傳送物件訊息 讓代理影響明確定義到所有的應用程式行為 例如: -application:didFinishLaunchingWithOptions: is sent when the app has finished launching and is ready to do something interesting. 當應用程序已經完成啟動,並準備做一些有趣的事情被發送。 Take a look at the UIApplicationDelegate reference page for a list of messages that the app delegate can implement to modify the behavior of the application. 看看在UIApplicationDelegate參考頁的應用程序委託可以實現修改應用程序的行為信息的列表。 相當於Asp.Net 中的 Global.ascx ,做全域變數的控制。 AppDele

IOS Target

IOS Target Target算是單一執行檔 通常商業版 一個專案會有多個Target 可以同時服務三種版本 例如:免費版,付費版,旗艦版

如何在Mac 中顯示隱藏檔案

如何在Mac 中顯示隱藏檔案 顯示隱藏檔案: defaults write com .apple .finder AppleShowAllFiles TRUE ;\killall Finder 不顯示隱藏檔案: defaults write com .apple .finder AppleShowAllFiles FALSE ;\killall Finder

Title22

Title22 windows 1. install USB driver 華碩是最好安裝的 2. 開發人員選項 對著版本號碼 點七下 跳出關於開發人員選項 要讓Allow USB debugging出現勾選確認 Mac

Title21

Title21 top buttom 與文字的順序有關 左到右的文字是左邊是Leading右邊是trailing Leading trailing Size Class Compact Regular w/h table W:compact W:ragular H:compact iphone lay down iPhone6 Plus H:ragular iphone ipad 1. 2.ARC的機制是什麼? NSString * var1 =@”This is ARC “ “This is ARC” 被宣告了記憶體 宣告時,指標var1這個counting 被+1 此時不能release NSString * today = var1 var1此時已被呼叫兩次 reference counting已經+2 [var1 retain] [var1 retain] 後面要有對稱的release @property (weak,nonatomic) weak時 reference counting不會+1 但strong會 weak>>會設成nil assign>>不會設成nil alloc copy new 都會讓reference counting+1 1.Serial(一次一個) Serial Queue (private dispatch queues) 依照放入的順序一次執行一個 block,通常用於存取指定的資源。 我們可以依照需求建立許多不同的 Serial Queue 2.Concurrent(一次可執行多個) Concurrent Queue (global dispatch queue) 依照放入的順序和系統目前 資源的狀態執行多個block。 3.Main dispatch queue(Serial) 在應用程式的main thread中執行被指定的動作。 Closure 算是一種物件,也是ARC Closure = block