2012년 8월 20일 월요일

モダルビューアからキーボードを非表示にする方法


- (IBAction)close:(id)sender {
    [textField resignFirstResponder];
    @try
    {
        Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl");
        id activeInstance = [UIKeyboardImpl performSelector:@selector(activeInstance)];
        [activeInstance performSelector:@selector(dismissKeyboard)];
    }
    @catch (NSException *exception)
    {
        NSLog(@"%@", exception);
    }
}

2012년 8월 15일 수요일

Xcode 4におけるiOS Frameworkの作成方法(URL参照)

http://mobileapplication.blog.fc2.com/blog-entry-8.html
http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/

UITextView コピー禁止する方法


@implementation UITextView(Private)
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
[UIMenuController sharedMenuController].menuVisible = NO; //do not display the menu
[self resignFirstResponder]; //do not allow the user to selected anything
return NO;
}
@end
上記カテゴリを追加する

IOS デバイス使用可能容量取得


デバイスのルートディレクトリには、/etcと/varというフォルダがあるようです。
基本的なアプリは/varに入ります。/etcはおそらくシステムフォルダでしょう。

【例】
NSDictionary *dict = [[NSFileManager defaultManager] fileSystemAttributesAtPath:@"/var" ];

NSNumber *free = [dict valueForKey:NSFileSystemFreeSize];<br />NSNumber *system = [dict valueForKey:"NSFileSystemSize"];
NSLog("free:%.3f",[free floatValue]/1024/1024/1024);<br />NSLog("sys:%.3f",[system floatValue]/1024/1024/1024);

IOS イメージサイス整理


Application icon (in pixels)
iPad:72x72
iPad Retina:144x144
iPhone:57x57
iPhone Retina:114x114

Launch image (in pixels)
iPad:768 x 1004 (portrait) 1024 x 748 (landscape)
iPad Retina:1536 x 2008 (portrait) 2048 x 1496 (landscape)
iPhone:320 x 480
iPhone Retina:640 x 960

Tab bar icon (in pixels)
iPad:Approximately 30 x 30
iPad Retina:Approximately 60 x 60
iPhone:Approximately 30 x 30
iPhone Retina:Approximately 60 x 60

Toolbar and navigation bar icon (in pixels)
iPad:Approximately 20 x 20
iPad Retina:Approximately 40 x 40
iPhone:Approximately 20 x 20
iPhone Retina:Approximately 40 x 40

IOS5.0.1からDocumentフォルダがiTunesとiCloudバックアップ対象外設定できる


IOS5.0.1以後、Documentフォルダのファイルをバックアップ(iTunesとiCloud)対象外にするとこができるようになりました。
以下のURLを参考してください。
http://developer.apple.com/library/ios/#qa/qa1719/_index.html#//apple_ref/doc/uid/DTS40011342

IOS5以後、Cachesフォルダシステムが削除する


IOS5以後、Library/Cacheフォルダのファイルを使用可能容量が
100MB~0MB(想定)の場合システムが自動に削除するようになりました。
以下のURLを参考してください。
https://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html%23//apple_ref/doc/uid/TP40010672-CH2-SW2