2011年2月24日 星期四

iOS-programming_question

1). Iphone 開發方式?
XCode , 搭配 Git
2). Iphone 如何與網路溝通? 實例?
httprequest ?
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFHTTPTasks/CFHTTPTasks.html
CFNetwork Concepts
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Concepts/Concepts.html#//apple_ref/doc/uid/TP30001132-CH4-DontLinkElementID_13

3). Iphone 如何取得網站上的資料, 並進行解析?
    . XML 如何進行交換, 實例?
http://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html  
  
    . 如何將網站上的資料和圖片下載至手機裡, 以供使用?
Working with Streams
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFStreamTasks/CFStreamTasks.html#//apple_ref/doc/uid/TP30000230-61466

    . 如何將手機上的圖片上傳至網站裡?

4). SQLite 如何應用實做? 如何將交換(XML)所得資料寫入 SQLite?
http://iphoneipad-develop.blogspot.com/2011/02/using-sqlite.html

5). Iphone, Ipad 的開發方式有何不同? 我該如何著手開發 Ipad?
6). 帶領我和榆翔實作一個小的 Project, 例如:產品資訊(含圖片)下載 Demo App.
7). 量 GG App 的實做是否可能?
8). 如何撰寫 Iphone 開發文件?
9). Object-C 如何使用 base64 編碼?
10). 委派的實作與原理

A: 請delegate幫我摘水果
A: 要當我的delegate必須遵守我的protocol 也就是會爬樹

B: 我來當A的delegate
Compiler: B你有遵守protocol嗎
B: 有 我會爬樹

B to A: 我摘到水果了 請吃

C: 我也要當A的delegate
Compiler: C你有遵守protocol嗎
C: 沒有 我不會爬樹
Compiler: 那C你會害我們crash
Basically, delegation is a way of allowing objects to interact with each other without creating strong interdependencies between them, since this makes the design of your application less flexible. Instead of objects controlling one another, they can have a delegate which they send (or delegate) messages to, and the delegate does whatever they do, in order to respond and act to this message, and then usually return something back to the other object.
Delegation is also a better alternative to subclassing. Instead of you having to create your own custom classes to slightly alter the way that other objects behave, or pass them data, delegation allows objects to send messages to their delegates to do work for them without the overhead of creating subclasses to make minor changes to other objects.
Of course, the main disadvantage of delegation is that the delegate methods available are dependent on what the Apple engineers foresee as being useful and what common implementations they expect people to need, which imposes a restriction on what you can achieve. Although, as Quinn Taylor pointed out, this is specific to the Cocoa frameworks and so doesn't apply in all situations.
If delegation is an option over subclassing, then take it, because it's a much cleaner way to manage your code and interactions between objects.

11). Object-C 如何判斷變數型態? ( C++ 是 typeof ) ->  (instanceof) ?
Try [myObject class] for returning the class of an object.
[myObject isKindOfClass:[NSString class]]
[myObject isKindOfClass:[UIImageView class]]

12). 如何設計一支 APP, 能在網頁上直接點圖下載? 或是點了圖後, 會出現是否下載的對話框?
13). Xcode 裡選擇開發型態的差別:什麼時候該用 application based on windows? ... 什麼是時候該 ...

14). 如何在 Object-C 裡使用 base64 或其他編碼, 進行編解碼 ?

15). Open GL 如何使用? or 2D 繪圖?
http://www.discuss.com.hk/archiver/?tid-12945915.html

Using SQLite

iPhone 上的應用程式可以使用 Plist 或 XML 檔案去記錄資料,如果資料類型比較簡單,資料和資料之間沒有關聯性,資料數量不多,使用 Plist 或 XML 檔案已經足夠應付。如果需要記錄大量並擁複雜關聯性的資料時,還是建議使用資料庫去去儲存資料好。

iPhone 的應用程式可以使用 SQLite 去作為資料庫系統,SQLite 是超輕量版的一款資料庫系統,完全不像常用的資料庫系統,例如: MySQL,PostgreSQL,Oracle 等等。SQLite 不用安裝,整個資料庫就是以一個檔案的型式存在,存取資料靠 iPhone SDK 提供的 Library 就可以了。由於iPhone SDK 已經內置了 SQLite 的 Library 檔案,所以不用擔心兼容性的問題,就算是遲些出到 iPhone 5, 6, 7 也沒問題的。操作方面和常用的資料庫系統差不多,一樣可以使用 SQL 去操作。

在寫程式之前要先製作好資料庫才可以,我建議使用 FireFox 的插件 - SQLite Manager
下載網址: https://addons.mozilla.org/en-US/firefox/addon/5817/

SQLite Manager 在 Mac OSX, Linux 或 Windows 環境也一樣可以用到,只要裝到 FireFox 就可以用到。

怎麼使用 SQLite Manager 就不多講了,以下是我的資訊庫的 DDL 加上 DML:

DROP TABLE IF EXISTS "customer";
CREATE TABLE "customer" ("pid" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , "first_name" VARCHAR, "last_name" VARCHAR);
INSERT INTO "customer" VALUES(1,'Lawrence','Cheung');
INSERT INTO "customer" VALUES(2,'Tom','Chan');
INSERT INTO "customer" VALUES(3,'Ken','Choi');
DROP TABLE IF EXISTS "sqlite_sequence";
CREATE TABLE sqlite_sequence(name,seq);
INSERT INTO "sqlite_sequence" VALUES('customer',3);

你要先在 Project 內增加 SQLIte 的 Library 才使用到 SQLIte 資料庫,將 libsqlite3.0.dylib 加入到 Framework 內。

為了不經常打開資料庫的連接,我使用一個 Singleton 類別去保持資料庫的連接。這個類別的程式碼:
DBHelper.h:
#import <sqlite3.h>

@interface DBHelper : NSObject {
 sqlite3 *database;
}

@property(readonly, nonatomic) sqlite3 *database;

+ (DBHelper *) newInstance;
- (void) openDatabase;
- (void) closeDatabase;
- (NSString *) getDatabaseFullPath;
- (void) copyDatabaseIfNeeded;
- (sqlite3_stmt *) executeQuery:(NSString *) query;

@end

DBHelper.m:
#import "DBHelper.h"

@implementation DBHelper

static DBHelper *instance = nil;

NSString *DB_NAME = @"sample";
NSString *DB_EXT = @".sqlite";

@synthesize database;

+ (DBHelper *) newInstance{
   @synchronized(self) {
      if (instance == nil){
         instance = [[DBHelper alloc]init];
         [instance openDatabase];
      }
   }
   return instance;
}

+ (id)allocWithZone:(NSZone *)zone {
   @synchronized(self) {
      if (instance == nil) {
         instance = [super allocWithZone:zone];
         return instance;        
      }
   }
   return nil;
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (id)retain {
    return self;
}

- (unsigned)retainCount {
    return UINT_MAX;
}

- (void)release {
    //do nothing
}

- (id)autorelease {
    return self;
}

- (void) openDatabase{
    if (!database){
      [self copyDatabaseIfNeeded];
      int result = sqlite3_open([[self getDatabaseFullPath] UTF8String], &database);
      if (result != SQLITE_OK){
         NSAssert(0, @"Failed to open database");
      }
   }
}

- (void) closeDatabase{
    if (database){
        sqlite3_close(database);
    }
}

- (void) copyDatabaseIfNeeded{
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDatabaseFullPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath]; 
 
    if(!success) {
  
        NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%@", DB_NAME, DB_EXT]];
        success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];
        NSLog(@"Database file copied from bundle to %@", dbPath);
  
        if (!success){ 
            NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
        }
        
    } else {
        
        NSLog(@"Database file found at path %@", dbPath);
  
    }
}

- (NSString *) getDatabaseFullPath{
   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
   NSString *documentsDirectory = [paths objectAtIndex:0];
   NSString *path = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%@", DB_NAME, DB_EXT]];
   return path;
}

- (sqlite3_stmt *) executeQuery:(NSString *) query{
   sqlite3_stmt *statement;
   sqlite3_prepare_v2(database, [query UTF8String], -1, &statement, nil);
   return statement;
}

@end

我在這個類別初始化同時會打開資料庫的連接,要在 iPhone 開啟 SQLite 資料庫前,必須要將資料庫複製到 Documents 目錄內,而其他類別要用 SQL 向資料庫查詢資料只要執行executeQuery 就可以了。

向資料庫查詢資料:
DBHelper *dbHelper = [DBHelper newInstance];
    
NSString *sql = @"SELECT customer.pid, customer.first_name, customer.last_name FROM customer";
sqlite3_stmt *statement = [dbHelper executeQuery:sql];
    
while(sqlite3_step(statement) == SQLITE_ROW){
    int pid = sqlite3_column_int(statement, 0);
    NSString *firstName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 1)];
    NSString *lastName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 2)];
    NSLog(@"pid: %i, first name: %@, last name: %@", pid, firstName, lastName);
}

執行時在 Console 內會打印出以下文字:
[Session started at 2010-07-20 11:31:39 +0800.]
2010-07-20 11:31:41.545 sqlite[39544:207] Database file found at path /Users/Lawrence/Library/Application Support/iPhone Simulator/4.0/Applications/999BFA7F-6D9B-490A-B542-CDCA79B1590E/Documents/sample.sqlite
2010-07-20 11:31:41.547 sqlite[39544:207] pid: 1, first name: Lawrence, last name: Cheung
2010-07-20 11:31:41.548 sqlite[39544:207] pid: 2, first name: Tom, last name: Chan
2010-07-20 11:31:41.549 sqlite[39544:207] pid: 3, first name: Ken, last name: Choi

應用程式完結時記得要將資料庫連接關閉:
[[DBHelper newInstance] closeDatabase];

文章來源 :
http://pro.ctlok.com/p/about.html

2011年2月23日 星期三

運算加速





位元運算在C’ C++ 等語言中都相當常見,優點運算效率高,缺點可讀性低。如專案中需要以高效能來執行的話,可當你專案完成後再來進行最佳化哦。以下來介紹位元運算加速技巧:

1. 左移運算(Left Shift) = 乘上2 的倍數數值,加速 300%。
   x = x* 2; 
   x = x* 64; 
   //改為: 
   x = x << 1; // 2 = 21 
   x = x << 6; // 64 = 26


2. 右移運算 = 除上 2 的倍數數值,加速 350%。
   x = x/ 2; 
   x = x/ 64; 
   //改為: 
   x = x >> 1; // 2 = 21 
   x = x >> 6; // 64 = 26


3. 數值轉整數加速 10%
   x = int(1.232) 
   //改為: 
   x = 1.232 >> 0;

4. 交換兩個數值(swap),使用 XOR 可以加速 20%
   var t:int = a; 
   a = b; 
   b = t; 
   //equals: 
   a^= b; 
   b^= a; 
   a^= b;

5. 正負號轉換,可以加入 300%
   i = -i; 
   //改為 
   i = ~i+ 1; // NOT 寫法 
   //或 
   i = (i^ -1) + 1; // XOR 寫法

6. 取餘數,如果除數為 2 的倍數,利用 AND 運算加速 600%
   x = 131 % 4; 
   //equals: 
   x = 131 & (4 - 1);

7. 利用 AND 運算檢查整數是否為 2 的倍數,可以加速 600%
   isEven= (i% 2) == 0; 
   //equals: 
   isEven= (i& 1) == 0;

8. 加速 Math.abs 600% 的寫法1,寫法2 又比寫法1加速 20%
   //寫法1 
   i= x< 0 ? -x: x; 
   //寫法2 
   i= (x^ (x>> 31)) - (x>> 31);

9. 比較兩數值相乘之後是否擁有相同的符號,加速 35%
   eqSign= a* b> 0; 
   //equals: 
   eqSign= a^ b> 0;
   其他位元運算技巧 

10. RGB 色彩分離 
   var 24bitColor:uint = 0xff00cc; 
   var r:uint = 24bitColor >> 16; 
   var g:uint = 24bitColor >> 8 & 0xFF; 
   var b:uint = 24bitColor & 0xFF;

11. RGB 色彩合併
   var r:uint = 0xff; 
   var g:uint = 0x00; 
   var b:uint = 0xcc; 
   var 24bitColor:uint = r<< 16 | g<< 8 | b;



參考資料:
[1] Bitwise gems - fast integer math
[2] Bitwise Operations in C

Git 介紹

What Git is ? and what's the difference between git,CVS and SVN ?

http://www.youtube.com/watch?v=74yphulj3uo&feature=related

Local Git Repositry

2011年2月21日 星期一

Git 使用教學

架設好之後,接下來就是測試看看,順便利用 Git 建立 Local Repository,剛開始的目錄 /path/git/prj1 裡面是沒有任何一個 Repository,我們可以利用下面指令建立:
1
2
3
mkdir /path/git/prj1
cd /path/git/prj1
git init
第一次 Commit to Remote Repository,需要底下步驟完成,才可以 clone,你在本機或者是其他機器使用下面步驟都是可以的
1
2
3
4
5
6
7
8
mkdir prj2
cd prj2
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@REMOTE_SERVER:/path/git/prj2
git push origin master
建立好之後,測試看看,Git clone 資料, 資料修改後上傳.(分兩個目錄測試)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 建立兩個測試目錄
mkdir /tmp/a /tmp/b
# 切換到 a 目錄
cd /tmp/a
# 先把遠端 repo 抓下來
git clone http://example.com/path/git/prj2
cd /tmp/b
git clone http://example.com/path/git/prj2
cd php
# 增加 test.php 檔案
echo "test" > test.php
# 新增到 server
git add test.php
# 送出 commit 
git commit -m "add test.php"
# push 到伺服器
git push
#切換 a 目錄
cd /tmp/a/php
# 抓取伺服器上面新檔案 test.php
git pull


首先,開啟一個專案只要輸入


git init


再來,每次修改好了以後,可以先將修改存入stage


git add <modified files>


若一次修改大量檔案,可以將所有檔案修改都add進去stage


git add .


之後commit提交一次的修改


git commit -m "註解"


另外也可以把git add與git commit用一個指令完成


git commit -a -m "註解"


git特別的一點是,他可以在本地端開啟並使用。上面這些用法完全不用伺服器,本機就可以執行。

本地端會有自己的repo,可以在飛機上,各種沒有網路的地方都可以順利使用並提交任何變更。

等您覺得修改好了,可以放上伺服器的時候,確保網路連線並輸入


git push


就可以將這邊的檔案與變更提交到github上面。
如果您在github上的版本較新,也可以輸入


git pull


更新本地端的repo。

如果今天tom的test repo有了新的變更,告訴billy,billy要將變更merge到自己的repo中,可以在本地端輸入


git pull git://github.com/tom/test.git


pull這個指令其實涵蓋了fetch(將變更複製回來)以及merge。
因此經過merge後,tom的變更就加入到billy的repo囉!

另外版本控制系統的branch功能也很有意思,若您的程式碼同時要修改bug,又要加入新功能,可以fork出一個branch,一個專門修bug,一個專門加入新功能,等到穩定後再來merge


git branch bug_fix #建立branch,名為bug_fix
git checkout bug_fix #切換到bug_fix這個branch
git checkout master #換為主要的repo
git merge bug_fix #把bug_fix這個branch和現在的branch合併
git push origin bug_fix:refs/heads/bug_fix #把bug_fix這個branch推至遠端repo上面


若有branch在remote,想要查看並checkout出來


git branch -r #查看遠端branch
git checkout -b bug_fix_local bug_fix_remote #把本機端切換為遠端的bug_fix_remote branch,並命名為bug_fix_local


還有其他可以觀看repo狀態的工具


git log #可以查看每次commit的改變
git diff #可以查看最近一次改變的內容,加上參數可以看其他的改變,並互相比較
git show #可以看某次的變更


若想知道目前repo的狀態,可以輸入


git status



這邊只是一些簡單的功能,還有更多的功能,等大家去摸
想要深入了解git,可以看
http://excess.org/article/2008/07/ogre-git-tutorial/
這個教學影片說明的很詳細。

也有很多小工具,比如這個
http://gugod.org/2008/11/github-badge.html
可以把您目前的github repos顯示在blog上面

希望大家也能在git上面使用github開心的開發!

參考資料
http://github.com/guides/home
http://kylecordes.com/2008/04/30/git-windows-go/
http://nathanj.github.com/gitguide/creating.html
http://www.qweruiop.org/nchcrails/posts/49





http://slobozincur.appspot.com/777bar.blogspot.com/2011/01/git.html

2011年1月23日 星期日

iPhone 常用路徑說明 (iOS4適用)

=======================================

【電腦】

電腦跟iTunes同步的應用程式資料夾 (預設)
C:\Documents and Settings\使用者名稱\My Documents\My Music\iTunes\iTunes Media\Mobile Applications\

電腦用iTunes做備份的位置 ( Windows XP )
C:\Documents and Settings\使用者名稱\Application Data\Apple Computer\MobileSync\Backup\

電腦用iTunes做備份的位置 ( Windows Vista、Windows 7 )
C:\使用者\使用者名稱\AppData\Roaming\Apple Computer\MobileSync\Backup\

電腦用iTunes做備份的位置 ( Mac )
~/資源庫/Application Support/MobileSync/Backup/

=======================================

【iTunes】

iTunes同步的應用程式 ( ipa )
/private/var/mobile/Applications/

iTunes同步的音樂 ( mp3、m4a、wav、aac、aiff )
/private/var/mobile/Media/iTunes_Control/Music/

iTunes同步的影片 ( mp4、mov、m4v )
/private/var/mobile/Media/iTunes_Control/Music/

iTunes同步的鈴聲 ( m4r )
/private/var/mobile/Media/itunes_control/Ringtones/

iTunes同步的圖片 ( jpg、png、gif )
/private/var/mobile/Media/Photos/Thumbs/

iTunes同步的電話簿 ( Windows通訊錄 )
/private/var/mobile/Library/AddressBook/

=======================================

【Cydia】

Cydia安裝的應用程式 ( deb )
/Applications/

Cydia的deb檔手動安裝放置位置
/private/var/root/Media/Cydia/AutoInstall/

Cydia手動添加Soucre源的設定檔
/private/etc/apt/sources.list.d/cydia.list

=======================================

【各種App應用程式】

Winterboard對應的主題位置
/Library/Themes/

SBSettings對應的開關位置
/private/var/mobile/Library/SBSettings/Toggles/

SBSettings對應的主題位置
/private/var/mobile/Library/SBSettings/Themes/

MxTube下載的位置
/private/var/mobile/Media/MxTube/

Safari下載的位置
/private/var/mobile/Media/Downloads/

Safari Download下載的位置
/private/var/mobile/Media/Downloads/

Atomic Web Brower下載的位置
/private/var/mobile/Media/Downloads/

YXplayer2同步的位置
/private/var/mobile/Applications/yxplayer2/Documents/

Downloads同步的位置
/private/var/mobile/Applications/downloads/Documents/

iFile同步的位置
/private/var/mobile/Documents/

iFile看檔案產生的臨時文件 (會造成iTunes的"其他"容量莫名其妙增加) (可以全部刪除)
/private/var/spool/mdt/

GoodReader同步的位置
/private/var/mobile/Applications/goodreader/Documents/

iComic同步的位置 ( 將漫畫圖檔壓縮成.zip )
/private/var/mobile/Applications/icomic/Documents/

Stanza同步的位置
/private/var/mobile/Applications/stanza/Documents

FStream電台的設定檔
/private/var/mobile/Applications/FStream/Library/Preferences/com.sourcemac.fstream.plist

FastFinga同步的位置
/private/var/mobile/Applications/FastFinga/Documents/

Quickoffice同步的位置
/private/var/mobile/Applications/Quickoffice/Documents/

=======================================

【iPhone系統預設的資料夾】

手機拍的照片 ( jpg )
/private/var/mobile/Media/DCIM/100APPLE/

按Power+Home鍵拍的螢幕畫面 ( png )
/private/var/mobile/Media/DCIM/100APPLE/

錄影檔 ( mov )
/private/var/mobile/Media/DCIM/100APPLE/

錄音檔 ( m4a )
/private/var/mobile/Media/Recordings/

來電鈴聲 ( m4r )
/Library/Ringtones/

簡訊鈴聲 ( caf )
/System/Library/Audio/UISounds/sms-received1.caf ( 三全音 )
/System/Library/Audio/UISounds/sms-received2.caf ( 管鐘 )
/System/Library/Audio/UISounds/sms-received3.caf ( 玻璃 )
/System/Library/Audio/UISounds/sms-received4.caf ( 銅管/管樂器 )
/System/Library/Audio/UISounds/sms-received5.caf ( 鐘琴 )
/System/Library/Audio/UISounds/sms-received6.caf ( 電子音樂 )

桌面圖庫 ( png )
/Library/Wallpaper/iPhone/

簡訊 ( db )
/private/var/mobile/Library/SMS/sms.db

電子郵件
/private/var/mobile/Library/Mail/

電子郵件信箱設定檔
/private/var/mobile/Library/Preferences/com.apple.accountsettings.plist

語音信箱
/private/var/mobile/Library/Voicemail/voicemail.db

通話紀錄
/private/var/wireless/Library/CallHistory/

聯絡人
/private/var/mobile/Library/AddressBook/

備忘錄
/private/var/mobile/Library/Notes/

行事曆
/private/var/mobile/Library/Calendar/

天氣
/private/var/mobile/Library/Weather/

股票
/private/var/mobile/Library/Stocks/

Safari的書籤
/private/var/mobile/Library/Safari/

=======================================

【系統字型】

中文字型
/System/Library/Fonts/Cache/STHeiti-Light.ttc
/System/Library/Fonts/Cache/STHeiti-Medium.ttc

英文字型
/System/Library/Fonts/Cache/Helvetica.ttc
/System/Library/Fonts/Cache/HelveticaNeue.ttc

解鎖畫面的時間字型
/System/Library/Fonts/Cache/LockClock.ttf

備忘錄字型
/System/Library/Fonts/Cache/MarkerFeltThin.ttf

打字時的字型
/System/Library/Fonts/Cache/PhoneKeyCaps.ttf

電話鍵盤的字型
/System/Library/Fonts/Cache/PhonepadTwo.ttf

=======================================

【桌面】

桌面的背景 (使用中)
/private/var/mobile/Library/SpringBoard/HomeBackground.jpg
/private/var/mobile/Library/SpringBoard/HomeBackgroundPortrait.jpg
/private/var/mobile/Library/SpringBoard/HomeBackgroundThumbnail.jpg

桌面的Dock背景
/System/Library/CoreServices/SpringBoard.app/SBDockBG@2x.png

桌面的Dock反射背景
/System/Library/CoreServices/SpringBoard.app/SBDockMask@2x.png

應用程式的提示圖示
/System/Library/CoreServices/SpringBoard.app/SBBadgeBG@2x.png
/System/Library/CoreServices/SpringBoard.app/SBBadgeBGMask@2x.png
/System/Library/CoreServices/SpringBoard.app/SBBadgeExclamation@2x.png
/System/Library/CoreServices/SpringBoard.app/SBBadgeTargetGlyph@2x.png

應用程式的移除圖示
/System/Library/CoreServices/SpringBoard.app/closebox@2x.png

應用程式的群組圖示
/System/Library/CoreServices/SpringBoard.app/FolderIconBG@2x.png

應用程式群組的背景
/System/Library/CoreServices/SpringBoard.app/FolderSwitcherBG@2x.png

iPod控制面版的背景
/System/Library/CoreServices/SpringBoard.app/SBLockScreenControlsLCD@2x.png

iPod播放鍵圖示
/System/Library/CoreServices/SpringBoard.app/play@2x.png

iPod暫停鍵圖示
/System/Library/CoreServices/SpringBoard.app/pause@2x.png

iPod前進鍵圖示
/System/Library/CoreServices/SpringBoard.app/nexttrack@2x.png

iPod後退鍵圖示
/System/Library/CoreServices/SpringBoard.app/prevtrack@2x.png

iPod隨機播放圖示
/System/Library/CoreServices/SpringBoard.app/recalibrateBezel@2x.png

靜音開關-ON圖示
/System/Library/CoreServices/SpringBoard.app/silent@2x.png

靜音開關-OFF圖示
/System/Library/CoreServices/SpringBoard.app/ring@2x.png

音量鍵圖示
/System/Library/CoreServices/SpringBoard.app/speaker@2x.png
/System/Library/CoreServices/SpringBoard.app/mute@2x.png

藍芽圖示
/System/Library/CoreServices/SpringBoard.app/routeButtonBlue@2x.png
/System/Library/CoreServices/SpringBoard.app/routeButtonWhite@2x.png

亮度圖示
/System/Library/CoreServices/SpringBoard.app/brightness@2x.png

=======================================

電信圖示 (使用中)
/private/var/mobile/Library/Carrier Bundle.bundle/

所有內建的電信圖示
/System/Library/Carrier Bundles/

=======================================

【多工列】

多工列的背景
/System/Library/CoreServices/SpringBoard.app/FolderSwitcherBG@2x.png

多工列的應用程式關閉圖示
/System/Library/CoreServices/SpringBoard.app/SwitcherQuitBox@2x.png

多工列的方向鎖定鍵的背景
/System/Library/CoreServices/SpringBoard.app/RotationLockButton@2x.png
/System/Library/CoreServices/SpringBoard.app/RotationUnlockButton@2x.png

多工列的iPod播放鍵圖示
/System/Library/CoreServices/SpringBoard.app/MCPlay@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPlay_d@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPlay_p@2x.png

多工列的iPod暫停鍵圖示
/System/Library/CoreServices/SpringBoard.app/MCPause@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPause_d@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPause_p@2x.png

多工列的iPod前進鍵圖示
/System/Library/CoreServices/SpringBoard.app/MCNext@2x.png
/System/Library/CoreServices/SpringBoard.app/MCNext_d@2x.png
/System/Library/CoreServices/SpringBoard.app/MCNext_p@2x.png

多工列的iPod後退鍵圖示
/System/Library/CoreServices/SpringBoard.app/MCPrev@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPrev_d@2x.png
/System/Library/CoreServices/SpringBoard.app/MCPrev_p@2x.png

=======================================

【解鎖畫面】

解鎖畫面的背景 (使用中)
/private/var/mobile/Library/SpringBoard/LockBackground.jpg
/private/var/mobile/Library/SpringBoard/LockBackgroundPortrait.jpg
/private/var/mobile/Library/SpringBoard/LockBackgroundThumbnail.jpg

解鎖畫面的時間背景
//System/Library/PrivateFrameworks/TelephonyUI.framework/BarLCD@2x.png

解鎖畫面的電池充電圖示
/System/Library/CoreServices/SpringBoard.app/BatteryBG_1@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_2@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_3@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_4@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_5@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_6@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_7@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_8@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_9@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_10@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_11@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_12@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_13@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_14@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_15@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_16@2x.png
/System/Library/CoreServices/SpringBoard.app/BatteryBG_17@2x.png

解鎖畫面的藍芽耳機充電圖示
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_1@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_2@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_3@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_4@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_5@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_6@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_7@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_8@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_9@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_10@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_11@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_12@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_13@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_14@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_15@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_16@2x.png
/System/Library/CoreServices/SpringBoard.app/HeadsetBatteryBG_17@2x.png

=======================================

【滑桿】

解鎖滑桿的圖示
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarknobgray@2x.png

解鎖滑桿的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarbkgndlock@2x.png

來電滑桿的圖示
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarknobgreen@2x.png

來電滑桿的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarbkgnd@2x.png

關機滑桿的圖示
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarknobred@2x.png

關機滑桿的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/topbarbkgnd@2x.png

解鎖滑桿的文字顏色
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarlocktextmask@2x.png

全部滑桿的文字設定檔
/System/Library/CoreServices/SpringBoard.app/zh-TW.lproj/SpringBoard.strings

=======================================

【按鍵】


取消按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarclear@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarclear_pressed@2x.png

灰色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombargray@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombargray_pressed@2x.png

暗灰色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombardarkgray@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombardarkgray_pressed@2x.png

白色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarwhite@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarwhite_pressed@2x.png

綠色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombargreen@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombargreen_pressed@2x.png

紅色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarred@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarred_pressed@2x.png

火紅色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarredfire@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarredfire_pressed@2x.png

藍色按鍵的背景
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarblue@2x.png
/System/Library/PrivateFrameworks/TelephonyUI.framework/bottombarblue_pressed@2x.png

=======================================

【系統預設的應用程式圖示】

電話的圖示
/Applications/MobilePhone.app/icon@2x.png

時間的圖示
/Applications/MobileTimer.app/icon@2x.png

訊息的圖示
/Applications/MobileSMS.app/icon@2x.png

天氣的圖示
/Applications/Weather.app/icon@2x.png

行事曆的圖示
/Applications/MobileCal.app/icon@2x.png

相機的圖示
/Applications/MobileSlideShow.app/icon-Camera@2x.png

照片的圖示
/Applications/MobileSlideShow.app/icon-Photos@2x.png

語音備忘錄的圖示
/Applications/VoiceMemos.app/icon@2x.png

計算器的圖示
/Applications/Calculator.app/icon@2x.png

指南針的圖示
/Applications/Compass.app/Icon@2x.png

電子郵件的圖示
/Applications/MobileMail.app/icon@2x.png

備忘錄的圖示
/Applications/MobileNotes.app/icon@2x.png

地圖的圖示
/Applications/Maps.app/icon@2x.png

聯絡資訊的圖示
/Applications/Contacts.app/icon@2x.png

設定的圖示
/Applications/Preferences.app/icon@2x.png

股票的圖示
/Applications/Stocks.app/icon@2x.png

iPod的圖示
/Applications/MobileMusicPlayer.app/icon-MediaPlayer@2x.png

Nike+iPod的圖示
/Applications/Nike.app/icon@2x.png

App Store的圖示
/Applications/AppStore.app/icon@2x.png

iTunes的圖示
/Applications/MobileStore.app/icon@2x.png

YouTube的圖示
/Applications/YouTube.app/icon@2x.png

Safari的圖示
/Applications/MobileSafari.app/icon@2x.png

Game Center的圖示
/Applications/Game Center~iphone.app/icon@2x.png

Cydia的圖示
/Applications/Cydia.app/icon@2x.png

=======================================

【其他】

開機的Logo圖示 (白蘋果)
/System/Library/CoreServices/SpringBoard.app/AppleLogo@2x.png

連結iTunes的圖示
/System/Library/CoreServices/SpringBoard.app/Activate@2x.png

iPod喜好等級星星圖示
/System/Library/CoreServices/SpringBoard.app/StarOff.png
/System/Library/CoreServices/SpringBoard.app/StarOn.png

資料來源:
http://bbs.weiphone.com/read-htm-tid-1303334.html

2011年1月20日 星期四

iPad 應用大增,美高中實行iPad輔助教學計畫!

iPad 平板電腦 應用越來越多,其中如果可以好好的應用其硬體平台,以及相關的 framework。

其想像力是沒有限制的。


iPad攻佔校園!美高中實行iPad輔助教學計畫
2011/01/21-謝佩原

在美國,有越來越多學校正透過iPad協助教學。老師們利用多媒體影音教卡夫卡,透過遊戲教歷史知識,以及透過動畫逐步分解複雜的數學問題。

內文:
美國Roslyn高中日前施行1項實驗計畫,在兩門人文學科的課堂上發出共47台iPad供師生使用,而該學區期望最終能達成提供1,100台iPad給學區內學生使用的目標。這些iPad將在此學年中供學生於課堂上及返家後使用。不但可取代實體課本,學生也在iPad上完成老師指定的報告及該交的作業。於此同時,iPad也替學生的作品留下紀錄,形成1份數位履歷。在Roslyn高中任教的老師Larry Reiff表示,「它讓我們把教室延伸到圍牆之外。」他目前已將所有的課程教材全都上傳到網路上。


美Roslyn高中校方認為採用iPad可促進無紙化發展,有助省下列印及教科書的費用。法新社
當然,也有持反對意見者提出不同聲音,質疑花費這麼多預算在購買iPad上是否值得。Roslyn高中校方表示,iPad不應只被視為1個很酷的新玩具,事實上iPad是個非常有力並具多種用途的工具。它有極多的應用程式,其中用於教育用途的便多達上千種。Reiff認為iPad可用的應用程式推出速度極快,就算想用的種類目前沒有,不久後也會有廠商推出。

此外,Roslyn高中校方認為採用iPad亦可促進無紙化發展。該校負責人表示,就長遠眼光來看,iPad將有助省下列印及教科書的費用。校方預估這2個採用iPad教學的課程,每年將可省下美金7,200元。

資料來源: Digitimes (僅做資訊分享)
http://www.digitimes.com.tw/TW/DT/N/SHWNWS.ASP?F=Y&CT=B&ID=0000214349_GFY2DZFF5Z8LC28ICONE7

2011年1月18日 星期二

iPad / iPhone 螢幕擷取 (How to capture iPad screen? )

如何擷取 iPad 螢幕

按住 HOME 鍵不放,再同時按下 power 鍵。

即可將螢幕擷取至 照片集裡面。

//--------------- English ----------------------//

How to capture iPad screen ?

Push the Home button and don't release , the Power button

Then you will find the captured picture in your album.

2011年1月16日 星期日

iPhone / iPad -- 程式撰寫 教學篇 -- 如何呈現 360度 圖片旋轉 (interactive 360 degree product views)

今天要討論的,是如何做出 互動式的360度圖片旋轉。
(How to make a program that can do interactive 360 degree product views)

這個概念, 義信 是從 apple demo html5 的網站所得到。
各位可以前往 http://developer.apple.com/safaridemos/threesixty.php 觀看。

經由分析相關的程式碼,我們可以發現 apple 是採用 ajax相關語法,將多達80幾張圖片載入。
再根據現今所展示的圖片呈現出來,並配合使用者的操縱,更換呈現中的圖片。
分析可實現的方式後,我們把相關的步驟寫下。

1. 產生一個圖片陣列
2. 使用者操縱圖片,改變圖片的index
3. 呈現出圖片

在實際的程式寫作上,我們可以先用 UserInterface Builder,將相關的元件載入。

從元件庫拉入 Image ... 以Array 產生 Image Array



--------------------底下為英文版本----------------------------

Today we want to discuss is how to make a program that can do interactive 360 degree product views.
This concept is from apple's demo site for html5.
You can visit http://developer.apple.com/safaridemos/threesixty.php to check.

2011年1月10日 星期一

iPhone / iPad -- firmware 何處尋找?

想要做 JB JailBreak的人,一定都需要 firmware 韌體檔。

一般在做更新 iPad 韌體版本時,也都會在你的電腦裡面留下該檔案。

但要到哪裡去找了??

小編找了一下
1. 直接用windows 搜尋,真是不認真找,竟然跟我說 找不到!! 怒~~

2. 自己憑直覺找,果然不出所料,一下子就被我找到了。

原來位在下面這裡
C:\Documents and Settings\[使用者名稱]\Application Data\Apple Computer\iTunes\iPad Software Updates

iPad1,1_4.2.1_8C148_Restore.ipsw ← 檔名如左。

後面是版本的名稱,有了這個,就可以再做下一階段的JB囉!!


網路上找到的 firmware
http://www.techorz.com/tablet/apple-iphone-ipod-ipad-firmware/
http://www.felixbruns.de/iPod/firmware/

2011年1月8日 星期六

iPad iPhone 轉換影片工具

轉換影片工具介紹
http://www.wretch.cc/blog/mcudesigner/22093043&page=6

http://notes.antonyho.net/2010/11/handbrakeipadmp4.html

轉換工具
http://handbrake.fr/downloads.php



what's 720p
720p is the shorthand name for a category of HDTV video modes having a resolution of 1280×720 (for a total of 0.92 megapixels or 921,600 pixels) and a progressive scan. The number 720 stands for the 720 horizontal scan lines of display resolution (also known as 720 pixels of vertical resolution), while the letter p stands for progressive scan or non-interlaced. When broadcast at 60[note 1] frames per second, 720p features the highest temporal (motion) resolution possible under the ATSC and DVB standards.