2012年3月31日 星期六

http://stackoverflow.com/questions/6568210/how-to-save-video-from-assets-url
http://stackoverflow.com/questions/4545982/getting-video-from-alasset

2012年3月28日 星期三

控制storyboard , reload storyboard , segue

好用參考來源
http://ryan.easymorse.com/?p=39

---------------------------

要使每次載入都回到login
可在applicationWillEnterForeground加上



    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    
    self.window.rootViewController = [storyboard instantiateInitialViewController];
    
    [self.window makeKeyAndVisible];

這樣可以reload整個storyboard,等於跟剛開啟一樣

-------------------

還有控制segue
    
    [self performSegueWithIdentifier:@"push to photolibrary" sender:nil];

詳細猜考來源

--------------------

直接載入特定storyboard

    UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    [self presentViewController:[storybord instantiateViewControllerWithIdentifier:@"PhotoLibrary"] animated:NO completion:nil];





如何製作圓角tableview, 加上textfield


    tableview.dataSource = self;
    tableview.delegate = self;
   
    //tableview 圓角 邊框 分隔線 coustom
    //圓角
    tableview.layer.cornerRadius = 13.0;
    tableview.layer.masksToBounds = YES;
    //分隔線
    [self.tv setSeparatorColor:[UIColor lightGrayColor]];
    //邊框
    tableview.layer.borderWidth = 1;
    tableview.layer.borderColor = [[UIColor lightGrayColor] CGColor];
   

    接著製作cell  並在裡面加上textfield
   
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [self.tv dequeueReusableCellWithIdentifier:CellIdentifier];
   
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier];
    }
    cell.accessoryType = UITableViewCellAccessoryNone;
    // Configure the cell...
    if([indexPath row]==0){

        //這是原本的cell text label

        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSString *tmp = [defaults objectForKey:@"question"];
        cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0];
        cell.textLabel.text = [NSString stringWithFormat:@"%@%@", @"密碼保護問題 : ", tmp];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }else if ([indexPath row]==2) {

        /這是textfield      

        u3 = [[UITextField alloc] initWithFrame:CGRectMake(9.5, 10, 300, 60)];
        u3.placeholder = @"新密碼";
        u3.returnKeyType = UIReturnKeyDone;
        u3.delegate = self;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell addSubview:u3];      
    }

    依此類推......

}

避免textfield被鍵盤檔到

http://www.cppblog.com/kongque/archive/2011/08/24/154256.html 簡單易懂的教學

2012年3月21日 星期三

push到storyboard的view上

給 storyboard 的 view 一個Identifier

UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

[self presentViewController:[storybord instantiateViewControllerWithIdentifier:@"PhotoLibrary"] animated:NOcompletion:nil];

粗體 => 取得view

--------------------------------------------------------------------------------------

建立一個segue 並加上idIdentifier
就可利用以下方法任意觸發

[self performSegueWithIdentifier:@"touch to push" sender:nil];


資料來源:http://ryan.easymorse.com/?p=39

2012年3月15日 星期四

不要讓法律嚇你!

有鑑於之前遇到的一些事情,讓我覺得這個資訊格外有用,不要被人家用法律嚇你!


設計手機上網填報之應用程式是否會侵害他人著作權? 作者:章忠信

引用來源網址:http://www.copyrightnote.org/crnote/bbs.php?board=3&act=read&id=1388

1783◎設計一款手機應用程式,讓使用者在手機上填報瓦斯使用度數,直接上載至瓦斯公司的瓦斯自報度數網頁,不需要到瓦斯公司的自報度數網頁去填寫,要不要獲得瓦斯公司之同意?

手機應用程式是屬於著作權法第五條第一項第十款所保護的電腦程式著作,依第十條規定,自創作完成起就自動受保護,不待作任何申請。

手機應用程式之功能具備讓使用者在手機上填報瓦斯使用度數,直接上載至瓦斯公司的瓦斯自報度數網頁,不需要到瓦斯公司的自報度數網頁去填寫。這種功能並沒有使用到瓦斯公司的著作,應該不必獲得瓦斯公司之同意。

這程式有兩個問題是瓦斯公司所關切。一是使用者會跳過瓦斯公司網頁,減少瓦斯公司網頁之點閱率,降低廣告收入,或是讓消費者看不到瓦斯公司希望消費者看到的相關消費或用戶訊息,但卻增加程式公司自己的點閱率與廣告收入;二是程式撰寫者會使用到瓦斯公司的使用度數申報表格。

前一問題是有無違反公平交易法,這部分目前國內尚未見先例,成立可能性尚不高;後一問題是瓦斯公司的表格是否具通用性,因為著作權法第九條第一項第三款規定,「通用之表格」不得為著作權標的。若瓦斯公司的表格是「通用之表格」,不得為著作權標的,任何人都可以自由利用。