今天在測試push時發生了
Error in registration. Error: Error Domain=NSCocoaErrorDomain Code=3000 "未找到應用程序的“aps-environment”的權利字符串"
其實是原本的profile太舊了、只要重新renew、再下載profile就行了
至於push的教學可以參考以下網站
result945 發表在 痞客邦 留言(0) 人氣(373)
主要參考這篇文章
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/
result945 發表在 痞客邦 留言(0) 人氣(114)
UIViewController<UITextFieldDelegate>
//inputtext
result945 發表在 痞客邦 留言(0) 人氣(413)
字串處理相關網站
http://hi.baidu.com/rone2000_/blog/item/9d30ce1dc06f5b6cdab4bd97.html
計算字串長度
CGFloat word_width = [yourstring sizeWithFont:[UIFont fontWithName:@"Arial" size:18]].width;
result945 發表在 痞客邦 留言(0) 人氣(587)
有一串內文要計算scroll view所需要的長度
CGSize constraint = CGSizeMake(300 - (0 * 2), 20000.0f);
result945 發表在 痞客邦 留言(0) 人氣(154)
export PATH=$PATH:/usr/bin:/usr/sbin
就是指在原有的執行文件目錄上再添加/usr/bin和/usr/sbin這兩個文件搜尋目錄,
比如說你的一個可執行文件放在/usr/bin下,你添加了/usr/bin這個目錄後,
执行/usr/bin下的可執行文件,就不用输入全路径了,
可直接输入可執行的名稱,就可以執行了。
result945 發表在 痞客邦 留言(0) 人氣(169)
寫了一段自動讀取頁面的JQuery
結果發現ie並不會執行
$("#content").load("answer.php");
var refreshId = setInterval(function() {
$("#content").load('answer.php?randval='+ Math.random());
}, 1000);
$.ajaxSetup ({
// Disable caching of AJAX responses
cache: false
});
result945 發表在 痞客邦 留言(0) 人氣(810)
最近要幫伺服器定期備份MySQL
首先、先把原本的資料庫全部備份起來
mysqldump --user=root -p --all-database > /backup/mysql.sql
result945 發表在 痞客邦 留言(0) 人氣(1,143)
最近看到朋友用聽電影和看字幕來練習英文
所以就也想來學習他的方法
但字幕檔裡還有時間、因此就想把不需要的時間濾掉
<?php
$fn = "test.srt";//字慕檔名稱
$fp = fopen($fn, 'r'); //讀取字幕檔
while(!feof($fp)){
$line = fgets($fp);//讀取每一行
if(!ereg("^[0-9]", $line)) //如果開頭不是數字則顯示
echo $line . '<br/>';
}
?>
result945 發表在 痞客邦 留言(1) 人氣(381)
//普通bbutton
UIButton *nearBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
nearBtn.frame = CGRectMake(115.0f, 150.0f, 88.0f, 40.0f);
NSString *near_btnName = [NSString stringWithFormat:@"test button"];
[nearBtn setTitle:near_btnName forState:UIControlStateNormal];
[nearBtn setTitleColor: [UIColor blackColor] forState: UIControlStateNormal];
[nearBtn addTarget:self action:@selector(go_nearPage:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:nearBtn];
result945 發表在 痞客邦 留言(0) 人氣(2,994)