[Info] iOS5から導入された Core Image のチュートリアル

2011年11月15日火曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加


フィルタの適用や、適用後の画像をフォトアルバムへ書きだす方法などが説明されている。


(ネタ元)Twitter / @natsun_happy: Beginning Core Image in iO ...


[Info] メールアドレスピッカーライブラリ

2011年11月14日月曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

アドレス帳からメールアドレスを取得する簡易ライブラリ。利用しなくてもソースコードが参考になる(かも)。



[Info] 特定のファイルをiCloudバックアップ対象外にする

| Published in | 0 コメント

このエントリーをはてなブックマークに追加

iOS 5.0.1 から指定したファイルを iCloud および iTunes バックアップから除外できるようになった。その方法の紹介と関連してデータの種類毎の格納場所、バックアップの扱いの説明など。



データカテゴリ


データの用途によって4つのカテゴリが挙げられている。

カテゴリ用途ディレクトリバック
アップ対象
Critical Dataユーザが作成するデータ
または
再作成ができないデータ
Documents
Cached Data再ダウンロード
または
再作成が可能なデータ
Library/Caches×
Temporary Data使用期間の短い一時的な
データで保存が不要なデータ
tmp×
Offline Dataオフライン時に
利用するデータ
Documents または
Library/Private Documents
かつ拡張属性付与


拡張属性 "do not backkup"


iOS5.0.1 よりファイルに 拡張属性 "do not backup" を付与することで特定のファイルを iCloud/iTunesバックアップの対象外にできる。以下は Technical Q&A からの転載。
#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
    const char* filePath = [[URL path] fileSystemRepresentation];
 
    const char* attrName = "com.apple.MobileBackup";
    u_int8_t attrValue = 1;
 
    int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
    return result == 0;
}
拡張属性が認識されるのは iOS5.0.1以降。それ以前は機能しない(つまりバックアップされる)。


参考情報


setxattr(2) Mac OS X Developer Tools Manual Page

setxattr関数のマニュアル

[Info] BlocksKit

| Published in | 0 コメント

このエントリーをはてなブックマークに追加

Foundation や UIKit ライブラリの様々なクラスのメソッドを blocks 化したライブラリ。 iOS 4.0+ 、 Mac OS X 10.6+ で利用可能。


以下、READMEより転載。

What's In The Box

  • Performing blocks on an NSObject.
  • Key-value observation () with block handlers.
  • Associated objects in an Obj-C API. (Not directly block-related.)
  • NSArray, NSSet, NSDictionary, and NSIndexSet filtering and enumeration.
  • Macros for more quickly typing out the above.
  • NSInvocation creation using a block.
  • NSTimer block execution.
  • Both delegation and block callbacks on NSURLConnection.
  • Delegate callback for NSCache.

UIKit Extensions
  • UIAlertView, UIActionSheet with block callbacks and convenience methods.
  • Block initializers for UIControl and UIBarButtonItem
  • Block-backed initializers for UIGestureRecognizer.
  • On-touch utilities for UIView.
  • Block callbacks for MFMailComposeViewController and MFMessageComposeViewController.
  • Delegate alternative for UIWebView.
これはいい。ちょっとした処理を書くのにいちいちメソッドを起こさなくて済む。本来は Appleが提供して欲しいものだが。
リファレンスマニュアルが appledoc形式で提供されている。
BlocksKit Reference

以下、リファレンスから少し抜粋してみる。

UIActionSheet(BlocksKit)
UIActionSheet *testSheet = [UIActionSheet sheetWithTitle:@"Please select one."];
 [testSheet addButtonWithTitle:@"Zip" handler:^{ NSLog(@"Zip!"); }];
 [testSheet addButtonWithTitle:@"Zap" handler:^{ NSLog(@"Zap!"); }];
 [testSheet addButtonWithTitle:@"Zop" handler:^{ NSLog(@"Zop!"); }];
 [testSheet setDestructiveButtonWithTitle:@"No!" handler:^{ NSLog(@"Fine!"); }];
 [testSheet setCancelButtonWithTitle:nil handler:^{ NSLog(@"Never mind, then!"); }];
 [testSheet showInView:self.view];

NSObject(BlocksKit)
[object performBlock:^(){
  [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
} afterDelay:0.5f];


UIGestureRecognizer もある。
UIGestureRecognizer(BlocksKit)
UITapGestureRecognizer *singleTap = [UITapGestureRecognizer recognizerWithHandler:^(id sender) {
     NSLog(@"Single tap.");
 } delay:0.18];
 [self addGestureRecognizer:singleTap];


- - - -
かなり便利なので、いったん使い始めたら以後このライブラリ無しではコーディングできなくなりそうで怖い。。

[Info] AppStoreからインストールしたアプリのデバッグ

| Published in | 0 コメント

このエントリーをはてなブックマークに追加

AppStore や AdHocビルドからインストールしたアプリのデバッグ方法の説明。


iPhoneとMacを接続して Xcodeのオーガナイザを使うと、iPhoneのコンソール出力やアプリがクラッシュした時のログが取得できる。

クラシュログは iTunes経由で取得できるのでユーザに依頼してファイルを入手することも可能。以下はOS毎のログの置き場所。

またユーザが許可すればクラッシュレポートが Appleのサーバへ送られ、開発者は iTunes Connect で見ることができる。


先週気になった情報

2011年11月13日日曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

まとめ
Cocoaの日々: 情報/2011-11-06

個別リンク
Cocoaの日々: [Info] iPhoneで利用可能な URLスキームまとめサイトの紹介
Cocoaの日々: [Info] Xcodeブレークポイントの設定を活用する
Cocoaの日々: [Info] iCloud Storage API チュートリアル
Cocoaの日々: [Info] 便利メソッドを集めたライブラリ - GHKit
Cocoaの日々: [Info] 設定画面構成ライブラリ - QuickDialog
Cocoaの日々: [Info] コミニュティバグレポート - Open Rader
Cocoaの日々: [Info] ライブラリデータベースサイト -
Cocoaの日々: [Info] iOS開発情報サイト紹介 - iPhone and iPad development
Cocoaの日々: [Info] StoreKit 解説記事の紹介
Cocoaの日々: [Info] ARCチュートリアル
Cocoaの日々: [Info] ポップアップウィンドウライブラリ ALPopupView
Cocoaの日々: [Info] iOS5標準のJSONライブラリの紹介
Cocoaの日々: [Info] カスタムツールバーライブラリ ALToolbar
Cocoaの日々: [Info] iOS5 Twitter API のチュートリアル
Cocoaの日々: [Info] UIWebView で文字列を反転する

[Info] iOS5チュートリアルサイトの紹介記事

| Published in | 0 コメント

このエントリーをはてなブックマークに追加

@natsusan_happy さんの iOS5チュートリアルサイト紹介。読みやすい。



以下、紹介内容の抜粋。

  • User Interface Customization in iOS 5
  • Beginning Storyboards in iOS 5 Part 1
  • Beginning Storyboards in iOS 5 Part 2
  • Beginning OpenGL ES 2.0 with GLKit Part 1
  • Beginning OpenGL ES 2.0 with GLKit Part 2
  • Beginning ARC in iOS 5 Part1
  • Beginning ARC in iOS 5 Part2
  • Beginning Turn-Based Gaming with iOS 5 Part 1
  • Beginning Turn-Based Gaming with iOS 5 Part 2
  • Working with JSON in iOS 5
  • Beginning iCloud in iOS 5 Tutorial Part 1
  • Beginning iCloud in iOS 5 Tutorial Part 2
  • Beginning Twitter in iOS 5
  • The iOS Apprentice: Learn iPhone and iPad Programming via Tutorials!



人気の投稿(過去 30日間)