show code js

2012年9月23日 星期日

simple example


1.open Xcode
2.set project config
3.choose Single View Application
4.open MainStoryboard.storyboard
(A)Add a label to frame in view controllor 1
(B)Add a button to frame in view controllor 1
5.add a view controller is 2
6.create a second page
(A)click and hold right mouse button on button in view controller 1
(B)move mouse fouce to view controller 2 and release mouse button
(C)choose modal
7.create some code
(A)open (name)AppViewController.h
(B)add code in @interface xxx : UIViewController { ....(in here)... } @end
(C)code > IBOutlet UIButton *myButton;
(D)open (name)AppViewController.m
(E)add code in viewDidload{ [super viewDidload];  ....(in here)... }
(F)code > [myButton setTitle:@"Hello" forState:UIControlStateNormal];
8.Run

2012年9月12日 星期三

open svn function on mac


  • Open Function

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/svn /usr/bin/svn


  • Checkout

mkdir svn_project
cd svn_project
svn checkout http://domain/svn/trunk
ls.....
svn_project/trunk/ code .......

2012年9月9日 星期日

mac disable double .filename and .ds_store


Open terminal and command below to disable.
If you want enable them, use reverse like true => false or false => true
  • Disable .DS_Store 
defaults write com.apple.desktopservices DSDontWriteNetworkStores true

  • Disable Apple Double (.filename) 
export COPYFILE_DISABLE=true

git on mac


Server:
1.get dropbox account and download & install dropbox
2.download and install git
3.goto dropbox directory
(A)mkdir project [for all git root]
(B)cd project and mkdir new_project.git
(C)cd new_project.git and command:git init --bare [to format]

Client:
1.New directory
(A)mkdir a project
(B)cd project
(C)git init
(D)git remote add origin ~/Dropbox/project/myproj.git

2.from a project
(A)git init or git clone ~/Dropbox/project/myproj.git [to format and get code from git server]
(B)git remote add origin ~/Dropbox/project/myproj.git

3.add new document to git server
(A)git add filename.xxx
(B)git commit {-a} -m "Add a filename.xxx"
(C)first time:git push origin master, next time:git push

4.modify and update to git server
(A)git commit -m "desc:modify"
(B)first time:git push origin master, next time:git push

5.update from git server
(A)first time:git pull origin master, next time:git pull

6.add ignore:
add a .gitignore in project root directory and set
data/*
xml/*.dat
password.file

7.see log
(A)git log


8.mirror a new project :
mkdir ../new_directory
git archive master | tar -x -C ../new_directory

2012年9月8日 星期六

zend studio



  • download from www.zend.com
  • install Zend Studio trial on mac
  • open zend studio
  • change encoding
  1. open Preferences>General>Workspace
  2. see "Text file encoding" and modify it to utf-8
  • hide .svn
  1. right click item
  2. Build Path -> Configure Inclusion / Exclusion Filters… .
  3. in "Exclusion patterns" click add and keyin "**/.svn/" before click ok button
  4. click finish button
  • install language package
  1. click help and install new software
  2. keyin "http://archive.eclipse.org/technology/babel/update-site/R0.9.1/helios/" in work with and enter to waiting pending
  3. pending finish will list more package let you choose
  4. checkbox "Babel Language Packs in [language name]", click next
  5. click allow or finish to waiting for install package