- (void)viewDidLoad {NSString *path = [[NSBundle mainBundle] pathForResource:@"sortednames" ofType:@"plist"];NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];[dict release];}
=
- (void)viewDidLoad {NSString *path = [[NSBundle mainBundle] pathForResource:@"sortednames" ofType:@"plist"];NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];[dict release];}
| 按鍵或組合鍵 | 功能 |
| 將 detail Pane 隱藏 | |
| compile and run | |
refactoring | |
按鍵或組合鍵 | 功能 |
print screen | |
fn+shift+F11 | 顯示桌面 |
| 組合鍵 | 功能 |
| Command-A | 選擇前端 Finder 視窗中的所有項目(如果沒有開啟中視窗則是桌面) |
| Option-Command-A | 取消選取所有項目。 |
| Shift-Command-A | 開啟“應用程式”檔案夾 |
| Command-C | 拷貝選取項目/文字至剪貼板 |
| Shift-Command-C | 開啟“電腦”視窗 |
| Command-D | 複製選取項目 |
| Shift-Command-D | 開啟桌面檔案夾 |
| Command-E | 退出 |
| Command-F | 尋找任何相符的 Spotlight 屬性 |
| Shift-Command-F | 尋找 Spotlight 檔案名稱符合項目 |
| Option-Command-F | 移動到已經開啟的 Spotlight 視窗中的搜尋欄位 |
| Shift-Command-G | 前往檔案夾 |
| Shift-Command-H | 開啟目前登入使用者帳號的個人專屬檔案夾 |
| Command-I | 簡介 |
| Option-Command-I | 顯示檢閱器 |
| Control-Command-I | 取得摘要簡介 |
| Shift-Command-I | 開啟 iDisk |
| Command-J | 開啟顯示方式選項 |
| Command-K | 連接伺服器 |
| Shift-Command-K | 開啟“網路”視窗 |
| Command-L | 製作所選項目的替身 |
| Command-M | 視窗最小化 |
| Option-Command-M | 將全部視窗縮到最小 |
| Command-N | 新增 Finder 視窗 |
| Shift-Command-N | 新增檔案夾 |
| Option-Command-N | 新增智慧型檔案夾 |
| Command-O | 開啟選取項目 |
| Shift-Command-Q | 登出 |
| Option-Shift-Command-Q | 立即登出 |
| Command-R | 顯示替身的原項目 |
| Command-T | 加到側邊欄裡 |
| Shift-Command-T | 加到喜好項目 |
| Option-Command-T | 在“Finder”視窗中隱藏工具列 / 顯示工具列 |
| Shift-Command-U | 開啟“工具程式”檔案夾 |
| Command-V | 貼上 |
| Command-W | 關閉視窗 |
| Option-Command-W | 關閉所有視窗 |
| Command-X | 剪下 |
| Option-Command-Y | 幻燈片秀(Mac OS X 10.5 或以上版本) |
| Command-Z | 還原/重作 |
| Command-1 | 以圖像顯示 |
| Command-2 | 依列表顯示 |
| Command-3 | 依欄位顯示 |
| Command-4 | 依 Cover Flow 顯示(Mac OS X 10.5 或以上版本) |
| Command-,(Command 和逗號鍵) | 開啟 Finder 偏好設定 |
| Command-`(次重音符號鍵,在美式英文鍵盤佈局的 Tab 鍵上方) | 循環檢視開啟中的“Finder”視窗 |
| Command-Shift-? | 開啟 Mac 輔助說明 |
| Option-Shift-Command-Esc(按住三秒)- 僅限 Mac OS X v10.5、v10.6 或以上版本 | 強制結束最前面的應用程式 |
| Command-[ | 返回 |
| Command-] | 往前 |
| Command-向上鍵 | 開啟所含的檔案夾 |
| Control-Command-向上鍵 | 以新視窗開啟所含的檔案夾 |
| Command-向下鍵 | 開啟反白項目 |
| Command-Tab | 切換應用程式:向前循環 |
| Shift-Command-Tab | 切換應用程式:向後循環 |
| Command-Delete | 丟到垃圾桶 |
| Shift-Command-Delete | 清空垃圾桶 |
| Option-Shift-Command-Delete | 不顯示確認對話框便直接清空垃圾桶 |
| 空白鍵(或 Command-Y) | 快速查看(Mac OS X 10.5 或以上版本) |
| 按住 Command 鍵同時拖移 | 把拖移的項目移動到其他卷宗/位置(按住本鍵時游標圖像會改變,請參閱這篇文章) |
| 按住 Option 鍵同時拖移 | 拷貝拖移的項目(按住本鍵時游標圖像會改變,請參閱這篇文章) |
| 按住 Option-Command 組合鍵同時拖移 | 製作拖移項目的替身(按住本鍵時游標圖像會改變,請參閱這篇文章) |
<tr style="background-color: white; font-size: 10px;"><td style="border-bottom-color: rgb(161, 165, 169); border-bottom-style: solid; border-bottom-width: 1px; border-right-color: rgb(161, 165, 169); border-right-style: solid; border-right-width: 1px; font-size: 10px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"> <span class="Apple-style-span" style="border-collapse: separate;"> </span></div> </td><td style="border-bottom-color: rgb(161, 165, 169); border-bottom-style: solid; border-bottom-width: 1px; border-right-color: rgb(161, 165, 169); border-right-style: solid; border-right-width: 1px; font-size: 10px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"> </div> </td></tr>
class chat_message { public: enum { header_length = 4 }; enum { max_body_length = 512 }; chat_message() : body_length_(0) { } const char* data() const { return data_; } char* data() { return data_; } size_t length() const { return header_length + body_length_; } const char* body() const { return data_ + header_length; } char* body() { return data_ + header_length; } size_t body_length() const { return body_length_; } void body_length(size_t length) { body_length_ = length; if (body_length_ > max_body_length) body_length_ = max_body_length; } bool decode_header() { using namespace std; // For strncat and atoi. char header[header_length + 1] = ""; strncat(header, data_, header_length); body_length_ = atoi(header); if (body_length_ > max_body_length) { body_length_ = 0; return false; } return true; } void encode_header() { using namespace std; // For sprintf and memcpy. char header[header_length + 1] = ""; sprintf(header, "%4d", body_length_); memcpy(data_, header, header_length); } private: char data_[header_length + max_body_length]; size_t body_length_; };
boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query(argv[1], argv[2]); tcp::resolver::iterator iterator = resolver.resolve(query); chat_client c(io_service, iterator); boost::thread t(boost::bind(&boost::asio::io_service::run, &io_service)); char line[chat_message::max_body_length + 1]; while (std::cin.getline(line, chat_message::max_body_length + 1)) { using namespace std; // For strlen and memcpy. chat_message msg; msg.body_length(strlen(line)); memcpy(msg.body(), line, msg.body_length()); msg.encode_header(); c.write(msg); } c.close(); t.join();
boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query(argv[1], argv[2]); tcp::resolver::iterator iterator = resolver.resolve(query); tcp::resolver::iterator end; tcp::socket s(io_service); boost::system::error_code error = boost::asio::error::host_not_found; while (error && iterator != end) { s.close(); s.connect(*iterator++, error); } if (error) throw boost::system::system_error(error); char line[chat_message::max_body_length + 1]; strcpy(line,"hello.txt Seg "); chat_message write_msgs_; write_msgs_.body_length(strlen(line)); memcpy(write_msgs_.body(), line, write_msgs_.body_length()); write_msgs_.encode_header(); boost::asio::write(s, boost::asio::buffer(write_msgs_.data(), write_msgs_.length())); chat_message read_msg_; //boost::asio::read(sread_msg_.body(), read_msg_.body_length()), size_t reply_length_header = boost::asio::read(s, boost::asio::buffer(read_msg_.data(), chat_message::header_length)); std::cout << "reply_length_header = " << reply_length_header << std::endl; read_msg_.decode_header(); size_t reply_length_body = boost::asio::read(s, boost::asio::buffer(read_msg_.body(), read_msg_.body_length())); std::cout << read_msg_.body() << std::endl; s.close();
- NSString* imageName;
- [theScanner scanUpToCharactersFromSet:doSet intoString:&imageName];
- NSLog(@"imageName = %@",imageName);