2013年5月2日 星期四

UIWeb + JavaScript

出現錯誤訊息:warning: no rule to process file '$(PROJECT_DIR)/jquery.flot.resize.js' of type sourcecode.javascript for architecture i386


解決方式:
Target => BuildPhase => Compile Sources => Remove jquery.flot.resize.js
Target => BuildPhase => Copy Bundle Resources => add jquery.flot.resize.js

2013年4月18日 星期四

兩個步驟,把網頁轉成 ePub!

2013/08/01 更新


以前就很喜歡用 Bookmarklet (說明)

所以偶爾也會自己寫寫  自己想用的

自從 mobile device 盛行  又更方便了


1. 跨平台、跨 browser

2. 免安裝

3. lightweight

4. 快速

5. 不中斷使用者操作

今天要來教大家  兩招  把喜歡的網頁轉成 ePub 電子書 珍藏起來!


以 iPhone 為例

先把以下兩個 Bookmarklet 加到書籤

可讀

可讀=>EPUB

第一個可讀 Bookmarklet 是 Readability 提供

但是他有個很棒的功能   轉 ePub 沒有提供手機平台

於是乎我稍微寫了一小段   讓他可以支援  就是 可讀=>EPUB

一般來說,我們在使用手機瀏覽,常常會遇到,不符合手機尺寸的網站,


叫出我們的小書籤,「可讀」。



手機上的文章馬上變得好看多了!



有時候覺得,想珍藏喜歡的文章 該怎麼辦?

再次叫出小書籤,選擇 「可讀=>EPUB」



剛剛那篇文章,馬上變成 ePub 格式了!

此時趕快點選 在"iBooks"打開



你喜歡的文章,馬上變成電子書,還直接加到 iBooks 書櫃,

不但可以 筆記、書籤 還可以 搜尋 歐!



2013年1月21日 星期一

Json 和 Dictionary之間的轉換

NSDictionary + Json .h

#import <Foundation/Foundation.h>

@interface NSDictionary (Json)


//把網址上Json的數據,轉換成字典
+(NSDictionary*)dictionaryWithContentsOfURLString:(NSString*)urlAddress;

//把字典轉成Json對象
-(NSData*)toJSON;

@end


NSDictionary + Json .m

#import "NSDictionary+Json.h"

@implementation NSDictionary (Json)
// 直把远程的地址上Json数据转,换成Dictionary对象
+(NSDictionary*)dictionaryWithContentsOfURLString:(NSString*)urlAddress
{
    // 请求远程数据,存放到NSData对象中
    NSData* data =[NSDatadataWithContentsOfURL:[NSURLURLWithString: urlAddress]];
    
    // 定义一个错误信息的对象
    __autoreleasingNSError *error =nil;
    
    // 序列化字符串
    id result =[NSJSONSerialization JSONObjectWithData:data
                                               options:kNilOptions error:&error];
    if(error !=nil)
        return nil;
    
    return result;
}

// 把当前的Dictionary对象,转成Json对象
-(NSData*)toJSON{
    NSError *error =nil;
    // 把当前的Dictionary对象转换成字符串
    id result =[NSJSONSerializationdataWithJSONObject:self
                                               options:kNilOptions error:&error];
    if(error !=nil)
        return nil;
    
    return result;
}

@end

2012年12月22日 星期六

certificate identity iPhone developer: appears more than once in the keychain.the code sign tool requires there only be one.


certificate identity iPhone developer: appears more than once in the keychain.the code sign tool requires there only be one.


最快的方式是,把key chia上的所有憑證和鑰匙都砍掉,全部重做。
原因是,自己砍,也沒有砍完全。

全部重做時,連.p12也都要重做,重做後,回到Http://developer.apple.com裡,把所有專案也都重新下載。
要記得在Actions > Edit > Modify > Certificates裡,開發者要勾選,Sumit後才下載新的專案憑證。
Development 和 Distribution都要做呦!~

2012年12月19日 星期三

Xcode一張憑證,多台MAC使用

1.先在原開發機上下載當初製作的開發憑證。


2.把輸出的.p12放在雲端上(EX:DropBox)
輸出檔名為.p12,附檔名不要亂改名字呦!~



3.因為這張憑證很重要,所以請給他一個密碼保護他。
等等在另一台電腦上,會要打開他來用,所以不能忘記呦。

4.填入登入系統的密碼,按下允許。


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

接下來換到另一台要當開發機的電腦上嘍!~

1.把「鑰匙圈存取」叫出來,檔案 > 輸入項目

2.到DropBox裡把剛剛存的.p12打開



3.輸入剛剛所填的保護檔案用的密碼。

4.這樣回到鑰匙圈主視窗後,在「憑證」裡就可以看到他了。







2012年12月18日 星期二

Xcode開發者憑證

1.先到鑰匙圈存取裡製作憑證。


2.輸入mail、名稱

3.按繼續做出.cer憑證。
4.到http://developer.apple.com登入開發者帳號
.在Certificates > Development,把剛剛的.cer上傳。

5.Distribution也把剛剛的.cer上傳哩



2012年12月13日 星期四

The model used to open the store is incompatible with the one used to create the store。


The model used to open the store is incompatible with the one used to create the store。
表示與目前現行版本的資料庫不同,要砍掉讓他自動產生新的。