Posts

Showing posts from April, 2016

AP102 2016/4/29

物件方法 給物件用的方法 uppercase 例如 NSString*name=@"glee" [glee uppercase] message->uppercase 對物件傳遞訊息 -( )xxx:(int)xxxx -(NSString)uppercase:() 類別方法 給類別的用的方法 建立屬於自己的建構子(constructor) +(void) givemepass 建構子必須要產出東西 像上述這個不回傳的例子 不屬於建構子 下午 屬性是obj-c物件要做nonatomic,strong型別 不屬於的不能做nonatomic property 產生變數 產生getter 產生setter

ap102 2016/4/29 OO implementation

ap102 2016/4/29 OO implementation // Student.m // HelloClass #import "Student.h" @implementation Student -( NSString *)name { return name; } -( void )setname:( NSString *)studentName { name = studentName; } -( int )chineseScore:( int )StudentChineseScore { return StudentChineseScore; } -( int )mathScore:( int )StudentmathScore { return StudentmathScore; } -( void )setChineseScore:( int )score{ chineseScore = score; } @end // Student.h // HelloClass #import <Foundation/Foundation.h> @interface Student : NSObject { //宣告物件變數(instance variable) NSString *name; int chineseScore; int mathScore; } @property ( nonatomic ) int englishScore; -( NSString *)name; -( void )setname:( NSString *)studentName; -( void )setChineseScore:( int )score; //setter -( int )chineseScore; //getter -( int )mathScore; @end // // ViewController.m // HelloClass #import "ViewController.h&q

RWD調整圖片大小

CSS語法 max-width: 100%; height: auto;

Objetive-C objetive-oriented

Image

AP102 2016/4/27 e.target.nodeName

AP102 2016/4/27 e.target.nodeName <!doctype html> < html > < head > < meta charset = "utf-8" > < link rel = "stylesheet" href = "main.css" > < script src = "new.js" > </ script > < title > Events </ title > </ head > < body > < form id = "theForm" > < fieldset > < legend > Events </ legend > < p > Select the events you want to listen for </ p > < hr > < div > < input type = "checkbox" id = "click" name = "click" value = "click" > < label for = "click" > Click </ label > </ div > < div >

AP102 2016/4/27 getElementById

AP102 2016/4/27 getElementById HTML 利用 < form > < fieldset > < legend > </ legend > < label > </ label > < input type = "" name = "" id = "" > </ fieldset > </ form > 去做一個表單 <!doctype html> < html > < head > < meta charset = "utf-8" > < link rel = "stylesheet" href = "main.css" > < script src = "new.js" > </ script > < title > Calculator </ title > </ head > < body > < form id = "theForm" > < fieldset > < legend > Calculator </ legend > < div > < label for = "quantity" > Quantity : </ label > < input type = "number"

AP102 2016/4/27 JAVASRIPT getElementById

AP102 2016/4/27 JAVASRIPT getElementById HTML ../images/washDrawing/046.JPG 這個連結方式是相對連結 要記得換成自己的圖片 onclick是一種事件 呼叫animationPlay( )這個函式 <!doctype html> < html > < head > < meta charset = "utf-8" > < link rel = "stylesheet" href = "32_main.css" > < script src = "33_new.js" > </ script > < title > Animation--Play Or Pause </ title > </ head > < body > < img src = "../images/washDrawing/046.JPG" width = "250" id = "image" > < hr > < p > < button onclick = "animationPlay()" > Play </ button > < button onclick = "animationPause()" > Pause </ button > </ p > </ body > </ html > CSS 呼叫keyframes是 css3呼叫動畫的一種方式

AP102 2016/4/27 JavaScript querySelectorAll('')

AP102 2016/4/27 JavaScript querySelectorAll('') <!doctype html> < html > < head > < meta charset = "utf-8" > < link rel = "stylesheet" href = "" > < script src = "30_new.js" > </ script > < title > Query Selector All </ title > </ head > < body > < div > < p > First </ p > < p > Second </ p > < p > Third </ p > < p > Fourth </ p > </ div > </ body > </ html > 一開始我們先宣告一個函式 dofirst 然後建立一個陣列的資料型態 對p這個html標籤 在w3c school裡面的定義querySelectorAll(”)是 Definition and Usage The querySelectorAll() method returns all elements in the document that matches a specified CSS selector(s), as a static NodeList object. The NodeList object represents a collection of nodes. The

AP102 2016/4/27 JavaScript click alert

AP102 2016/4/27 JavaScript click alert <!doctype html> < html > < head > < meta charset = "utf-8" > < link rel = "stylesheet" href = "" > < script src = "28_new.js" > </ script > < title > Query Selector </ title > </ head > < body > < div > < p > First </ p > < p > Second </ p > < p > Third </ p > < p > Fourth </ p > </ div > </ body > </ html > function doFirst () { //先與畫面產生關聯,再建事件聆聽的功能 document.querySelector( 'p' ).onclick = talk; //talk是自定義 ,dofirst函式自定義名稱 } function talk () { alert( 'hi~~' ); } window.addEventListener( 'load' ,doFirst, false ); //固定寫法:建立與文件的連結 //window.onload=doFirst; //上列註解部分是過去的老舊寫法

AP102 2016/4/27

Image
AP102 2016/4/27 變數命名的問題 (X)cute name (X)無意義字尾 (X)l 和 1 o和0的差別 撰寫程式過程 1.確定目的 2.規劃程式 3.撰寫程式 enter code here 4.工具; 編譯/直譯器 檢查語法(除錯) 5.執行方程式 6.測試方程式 過去使用patch work–bottom-up的設計方式 現在是top-down的設計模式 variables datatype I/O 循序式 sequence 迴圈式 repetition 選擇式 selection JAVASCIRPT的特性 弱型別等於等好的右邊說是什麼就是什麼 沒有整數與浮點數的差別都是數值 var num=5; var num='ABC'; var num=true; var num=[4,4,6]; 1.變數命名可使用「$」及「底線」開頭,但不能與保留字相同 2.運算子多了 「===」(絕對等於)以及「!==」(絕對不等於) 3.要使用CSS語法時,方法.style.CSS語法(CSS語法中的 - 要將其拿掉,然後-後面連接的字改成大寫)

AP!02 2016/4/26

早上的三個重點 1. transition 2.animation 可以替代跑馬燈的功能 3.multi-column 多欄位排板 html5 reset css<重新詮釋html標籤> html5的架構標籤 下午是由學長進行的學習輔導 主要介紹的學習swift 與objective-c的資源 ibook apple official apple develop itune developing ios-standford 學習資訊 NSHipster RAYWENDERLICH

AP102 2016/4/25

Image
MVC Model是指與view完全無關的 controller介於model與view之間的仲介者 controller與view溝通的功能就稱為IBoutlet 而view要與controller溝通時必須要有action target要找到目標controller 設計模式 delegate model與controller溝通 KVO Notification 設計模式 觀察者obervation Controller 是指揮,當他需要資料時呼叫 Model,必須從Model獲取數據; 當需要 UI view或更新的時呼叫 View,創造 UI 顯示數據。 Controller 可以直接與 Model 和 View溝通,對於 nib (xib 或 storyboard)方式創建view,使用 outlet 来與 View聯繫。 Model 可不可以跟 Controller 聯繫? 一種是Model資料改變,需要通知 Controller,UI 需要 update 了。 可以,通過 廣播 radio 機制 ,也就是圖片中的 Notification & KVO。 iOS 中有一个 NotificationCenter,Model 在這裡登錄一個radio,它可以選擇自己在何時執行這個廣播,廣播中帶有資料。  Controller 中要登錄一个 Observer,也就是一個audience,隨時關注 Model 廣播,當收聽到到 Model 發送的廣播後,可以接收消息,也可以做出對應的動作。 當然,除了 KVO,也可以直接把 Model 的某些操作放在 Controller 中做,這樣就不需要這麼複雜,但會破壞 MVC 分工的模式,破壞其獨立性。 View 可不可以向 Controller 發送消息呢? 使用者對 View 產生 event, 如 touch。 可以,對於 nib 是用 IBAction,對於 code 是用 addTarget,這個消息是當某某事件發生的時候告诉 Contoller 你可以做出某些對應的動作。 還有一種場景對於某些 View,一般會有一些對應的操作,iOS 自

顏色範例程式碼

Image
顏色範例程式碼 #import "ViewController.h" @interface ViewController () @property ( weak , nonatomic ) IBOutlet UISlider *red; //Slider的IBoutlet @property ( weak , nonatomic ) IBOutlet UISlider *blue; //Slider的IBoutlet @property ( weak , nonatomic ) IBOutlet UISlider *green; //Slider的IBoutlet @property ( weak , nonatomic ) IBOutlet UILabel *redLabel; //Label的IBoutlet @property ( weak , nonatomic ) IBOutlet UILabel *blueLabel; //Label的IBoutlet @property ( weak , nonatomic ) IBOutlet UILabel *greenLabel; //Label的IBoutlet @end @implementation ViewController - ( IBAction )colorChange:(UISlider *)sender { float red= self .red .value ; float blue= self .blue .value ; float green= self .green .value ; _redLabel .text =[ NSString stringWithFormat:@ "Red:%.0f" ,red]; _blueLabel .text =[ NSString stringWithFormat:@ "Blue:%.0f" ,blue]; _greenLabel .text =[ NSString stringWithFormat:@ "Green:%.0f

歷屆APP需要付費的

AP102 2016/4/22

Image

SourceTree Github

Image
先進行登入 輸入你的GitHub 帳號密碼 複製github repository 建立起新的資料夾 此即為github的版本控制資料夾

OBJECTIVE-C 基礎教學3/5 codeschool

Image

OBJECTIVE-C 基礎教學2/5 codeschool

Image

OBJECTIVE-C 基礎教學1/5 codeschool

Image

Hello! stackEdit

Image
Hello! Welcome to StackEdit! Hey! I’m your first Markdown document in StackEdit 1 . Don’t delete me, I’m very helpful! I can be recovered anyway in the Utils tab of the Settings dialog. Documents StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline! Note: StackEdit is accessible offline after the application has been loaded for the first time. Your local documents are not shared between different browsers or computers. Clearing your browser’s data may delete all your local documents! Make sure your documents are synchronized with Google Drive or Dropbox (check out the Synchronization section). Create a document The document panel is accessible using the button in the navigation bar. You can create a new document by clicking New document in the document panel. Switch to another document All your local documents are listed in the document panel