顯示具有 IOS 標籤的文章。 顯示所有文章
顯示具有 IOS 標籤的文章。 顯示所有文章

2016年12月10日 星期六

iTools使用教學

要使用iTools連接手機,首先要先安裝Apple所提供的iTunes(若已有安裝的話則略過)
一.安裝 iTunes

下載網址如下:
http://www.apple.com/tw/itunes/download/

安裝完後,接上您的apple手機(或平板),應該會出現以下畫面
PS:第一次電腦可能會跳出信任裝置的詢問畫面,此時在手機上按信任即可
image

這樣就確定電腦可以正常跟手機連線了

二.安裝 iTools

下載網址如下:
http://pro.itools.cn/itools3

image

安裝完成後執行,程式會嚐試連接,以下為連接完成後的畫面

image

三.使用iTools管理音樂

點選上方功能表的[音樂]後,左方會出現選單,再點手機名稱下方的音樂,此為您手機中的音樂

image

這裏可以把支援音樂格式的音樂(例如MP3)直接從電腦拉進手機,
當然也可以從上方的功能表執行提供的功能

image

在歌曲上按Mouse右鍵,可編輯歌曲的相關資訊

image

四.使用iTools管理相片

點選上方的功能[照片],再點裝置名稱下方的照片,就可以看到手機裏的照片,
若要把照片存到電腦,一般會依年月存放,所以我們要:
1.先點[按月份展示]
2.若要全部匯入點選[全選],否則選取要匯入的照片
3.點選導出

image

導出後自動會建立年月的資料匣

image

2013年6月17日 星期一

IOS APP 名稱本地化(多國語言)

IOS APP 名稱本地化(多國語言)

1.找到您專案裏的檔案副檔名為 .plist (通常是您的bundle名稱+Info.plist)
新增一個key值,名為 Application has localized display name ,Value選擇Yes
意思為應用程式將使用本地顯示名稱

2.在專案上按右鍵,New File->選擇 IOS->Resource->Strings Files
輸入檔案名稱為InfoPlist.strings

3.點選InfoPlist.strings 在右側欄找到Localization的按鍵

4.新增您要本地化的語言

5.在各語言的InfoPlist.strings檔案中新增"CFBundleDisplayName"="您要顯示的App名稱";


2013年1月14日 星期一

UISearchBar-搜尋列整理

無搜尋結果顯示

image

代理:<UISearchBarDelegate>

@protocol UISearchBarDelegate <NSObject>

@optional

- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar;                      // return NO to not become first responder
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar;                     // called when text starts editing
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar;                        // return NO to not resign first responder
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar;                       // called when text ends editing
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText;   // called when text changes (including clear)
- (BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text NS_AVAILABLE_IOS(3_0); // called before text changes

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar;                     // called when keyboard search button pressed
- (void)searchBarBookmarkButtonClicked:(UISearchBar *)searchBar;                   // called when bookmark button pressed
- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar;                    // called when cancel button pressed
- (void)searchBarResultsListButtonClicked:(UISearchBar *)searchBar NS_AVAILABLE_IOS(3_2); // called when search results button pressed

- (void)searchBar:(UISearchBar *)searchBar selectedScopeButtonIndexDidChange:(NSInteger)selectedScope NS_AVAILABLE_IOS(3_0);

@end

帶有搜尋結果顯示

 image

代理:<UITableViewDataSource, UITableViewDelegate,UISearchBarDelegate,UISearchDisplayDelegate>

@protocol UISearchDisplayDelegate <NSObject>

@optional

// when we start/end showing the search UI
- (void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller;
- (void) searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller;
- (void) searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller;
- (void) searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller;

// called when the table is created destroyed, shown or hidden. configure as necessary.
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView;
- (void)searchDisplayController:(UISearchDisplayController *)controller willUnloadSearchResultsTableView:(UITableView *)tableView;

// called when table is shown/hidden
- (void)searchDisplayController:(UISearchDisplayController *)controller willShowSearchResultsTableView:(UITableView *)tableView;
- (void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView;
- (void)searchDisplayController:(UISearchDisplayController *)controller willHideSearchResultsTableView:(UITableView *)tableView;
- (void)searchDisplayController:(UISearchDisplayController *)controller didHideSearchResultsTableView:(UITableView *)tableView;

// return YES to reload table. called when search string/option changes. convenience methods on top UISearchBar delegate methods
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString;
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption;

@end

 

#以下範例為使用UISearchDisplayDelegate代理的方法

搜尋元件初始化:

無scope的設定方式

    searchData = [[NSMutableArray alloc] init];
    searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    searchBar.tintColor=bgColor;
    jobList.backgroundColor=bgColor;
    //searchBar.tintColor=[UIColor1 greenColor];
    // Do any additional setup after loading the view.
    /*the search bar widht must be > 1, the height must be at least 44
     (the real size of the search bar)*/
    searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
    /*contents controller is the UITableViewController, this let you to reuse
     the same TableViewController Delegate method used for the main table.*/
    searchDisplayController.delegate = self;
    searchDisplayController.searchResultsDataSource = self;
    searchDisplayController.searchResultsDelegate=self;
    //set the delegate = self. Previously declared in ViewController.h
    self.jobList.tableHeaderView = searchBar; //this line add the searchBar

引用代理方法:

//-----------------------------------搜尋----------------------------------------
-(void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView
{
    //載入搜尋的table,設定cell背景色
    tableView.backgroundColor=[UIColor colorWithRed:(222.0f/255.0f) green:(255.0f/255.0f) blue:(200.0f/255.0f) alpha:1];
}

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{

    [searchData removeAllObjects];
    jobBas *jobbas;
    for(jobbas in tablearr) //take the n group (eg. group1, group2, group3)
        //in the original data
    {
        NSLog(@"%@:%@",jobbas.jobReason,searchString);
        NSRange range = [jobbas.jobReason rangeOfString:searchString options:NSCaseInsensitiveSearch];
        if (range.length > 0) { //if the substring match
            [searchData addObject:jobbas]; //add the element to group
        }
    }
    return YES;
}

 

 

有scope的設定方式

searchData = [[NSMutableArray alloc] init];

    searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];

    searchBar.scopeButtonTitles=[NSArray arrayWithObjects:@"全部",@"加點",@"扣點", nil];

    searchBar.tintColor=jobList.backgroundColor;

    //searchBar.tintColor=[UIColor greenColor];

    // Do any additional setup after loading the view.

    /*the search bar widht must be > 1, the height must be at least 44

     (the real size of the search bar)*/

    searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];

    /*contents controller is the UITableViewController, this let you to reuse

     the same TableViewController Delegate method used for the main table.*/

    searchDisplayController.delegate = self;

    searchDisplayController.searchResultsDataSource = self;

    searchDisplayController.searchResultsDelegate=self;

    //set the delegate = self. Previously declared in ViewController.h

    for (id subview in searchDisplayController.searchBar.subviews )

    {

        if([subview isMemberOfClass:[UISegmentedControl class]])

        {

            UISegmentedControl *scopeBar=(UISegmentedControl *) subview;

            [scopeBar setSegmentedControlStyle:UISegmentedControlStyleBordered];

            [scopeBar setTintColor: [UIColor greenColor]];//you can also set RGB color here

            //scopeBar.tintColor =  [UIColor blackColor];

        }

    }

    self.jobList.tableHeaderView = searchBar; //this line add the searchBar

引用代理方法:

//-----------------------------------搜尋----------------------------------------

-(void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView
{
    //載入搜尋的table,設定cell背景色
    tableView.backgroundColor=[UIColor colorWithRed:(222.0f/255.0f) green:(255.0f/255.0f) blue:(200.0f/255.0f) alpha:1];
}

//
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
    /*
     Update the filtered array based on the search text and scope.
     */
    [searchData removeAllObjects]; // First clear the filtered array.
    /*
     Search the main list for products whose type matches the scope (if selected) and whose name matches searchText; add items that match to the filtered array.
     */
    for (jobBas *jobbas in tablearr)
    {
        NSString *wscope;
        if (jobbas.is_GoodJob) {
            wscope=@"加點";
        }else wscope=@"扣點";
        if ([scope isEqualToString:@"全部"] || [wscope isEqualToString:scope])
        {
            NSComparisonResult result = [jobbas.jobReason compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])];
            if (result == NSOrderedSame)
            {
                [searchData addObject:jobbas];
            }
        }
    }
}

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
    [self filterContentForSearchText:searchString scope:
     [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
    // Return YES to cause the search result table view to be reloaded.
    return YES;
}

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption
{
    [self filterContentForSearchText:[self.searchDisplayController.searchBar text] scope:
     [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:searchOption]];
    // Return YES to cause the search result table view to be reloaded.
    return YES;
}

 

   

2012年10月7日 星期日

XCODE 4.6 多國語言問題排除

按照XCODE國際化的作法做完之後,發現並不會自動切換

網路查到解決的方式

http://stackoverflow.com/questions/4297051/nslocalizedstring-problem

If you use xCode 4 you will face with such problem. Try next steps:

  1. Remove application from device
  2. Select root node of project tree to get project's properties
  3. Select "Build Phases" tab
  4. Click "Add build phase" and select "Copy files"
  5. Select "Resources" in "Copy files" view
  6. Add Localizable.strings file
  7. Perform "Clean" for the project
  8. "Build and Run"

事實上不用做這麼多

只要兩個步驟:

1.從裝置移除應用程式

2.Product->Clear

image

2012年4月27日 星期五

如何製作iphone的MP3鈴聲

IPhone 正常是無法以MP3當做鈴聲的(含鬧鈴),

這對使用android系統或早期的手機的人類來說是很不方便的,但也別無他法

但還有人開發了一些工具程式,方便我們也可以將MP3變成鈴聲

假設您已安裝好Itunes(Apple - iTunes - 下載iTunes

 

我來介紹一下這些工具:

下載MP3:

要把MP3當鈴聲,當然要有MP3囉

要下載MP3我目前推薦的來源有兩個:

1.Youtube :

要下載 Youtube 的影片成為MP3歌曲,需要JDownLoader工具程式(請先點廣告後,再輸入驗證碼即可下載),[使用教學]

2.搜狗:可輸入專輯名稱,歌手名稱,歌曲名稱交叉搜尋

image

點選[链接]後會出現下面視窗

SNAGHTML50a393d

在[链接]後的網址上按Mouse右鍵->另存連結為..

即可下載為MP3歌曲

下載MP3工具:

調整MP3的音量:因MP3的聲音大小不一定會相同,所以要先調整一下,請下載MP3Gain  [MP3Gain教學]

修改MP3資訊:當您拉進一首MP3到ITunes裏時,您可能會常看到一是堆亂碼,此時就需要MP3tag來修正

 

下載iTools工具:

請到http://itools.hk/tscms/下載最新版的Itoolsimage

 

好了,現在我們開始使用iTools將MP3傳到iPhone上當做鈴聲

1.請將您的Iphone連接到電腦

2.執行Itools ,會出現連結中,連結完成後就可以看到一些項目

SNAGHTML5229b4e

請點選左側項目[媒体管理],再於右側媒體類型內選取[鈴聲],最後再點選[製作鈴聲]

SNAGHTML52ce130

出現一個標題為"制作鈴聲"的視窗,請點選[選擇文件]

SNAGHTML52dd014

 

選取您要當鈴聲的MP3檔案後,如下

SNAGHTML533cfd9

編輯完成後,請點選[保存]->選取[導入到設備]

image

 

成功後,您的鈴聲裏就會出現這首歌了

SNAGHTML5381e05

 

最後在您的IPHONE或IPAD的鈴聲選項裏就會多出這首歌曲