2012年5月27日日曜日

HDIM経由でデモビデオの作成

こいつを使うと、AirPlay ミラーリングでアプリデモ画面をHDMI経由で録画できるようです。

でもよく考えるとThundervolt対応のMac持ってなかったし・・とりあえず自家ビデオ撮影で。

http://www.macotakara.jp/blog/index.php?ID=15835 

 

2012年5月21日月曜日

iOS開発。初心者にもどろう。

 えー、iOS5、特にXCode4になっていらい、どうも開発意欲が湧いてこない。


 これはどういうことだ。XCode4になってから新しい技術、ストーリーボードが導入され、さらにはコーディングスタイルまで変更となったARCが導入され、頭を入れ替えなくてはいけなくなっているからだ。


 このような状況で、ストーリーボードもARCも教科書的に勉強はするものの、今ひとつ見についていない。


 これはなぜかといえば、新しいスタイルでの開発が体に身についていないことに原因があると分析する。こういうものを作りたいという欲求に対し、体をどう動かせば良いのかが、イメージできないのだ。


 自分の開発の基礎となったのは「はじめてのiPhone3プログラミング」だ。


 ここで示されるコードを、写経のようにXCodeに打ち込みながら、それを拡張する形で物をつくった。分かるところは変更し、分からないものはそのまま書き写す。そうしていくうちに、いろいろなバリエーションでものが作れるようになり、そして応用をする度に、わからないことが少なくなっていき、そして基礎から離れ、ほぼ応用だけで組みたれられるようになる。


 しかしながら、XCode4/iOS5に相当する整理された基礎的な書籍というものはない。だから開発のための訓練ができない。だから思いを形にできないのだ。


 ないのであれば、自分で作るしかない。
 「はじめてのiPhone3プログラミング」をもとに、現代の技術であるXCode4、ARCを前提とするプログラミングスタイルを確立しようではないか。


 いちから勉強しながらものづくりし、技術を身につけるのだ。

2012年5月17日木曜日

Twitter社が提供するObjective-C用テキスト処理ライブラリ

Twitter社からURLやハッシュタグを抽出するObjective-Cライブラリが提供されているようです。
そろそろ取り掛からないとなぁ。

http://cocoadays-info.blogspot.jp/2012/05/twitter-obj-c.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+blogspot/qpplRt+(Cocoaの日々情報局)

2012年4月29日日曜日

VMWareFusion アップデートでハマった。

VMWare Fusion4.1.2のバージョンアップが来たため、ササッとインストールしてしまったがハマった。

Windowsが動かない。動かないというか、いろいろ触ってみると、どうやら1/100くらいのスピードで動いている。

なんだかよく分からなかったた、シマンテックのAutoProtectがコケたあと、なんとなく動くようになり、さらにVMWareツールがインストール開始して、ようやくまともに動くようになった。

いまだによくわからないが、VMWare Fusionのアップデート後は辛抱強く待つことが必要なようだ。

2012年3月20日火曜日

objective-c の基礎

Objective-c も年々進化してきており、heap領域の解放を自動で組み込んでくれるARC(Automatic Reference Counting)記法(ガーベジコレクションではなく、コンパイル時に組み込みます)が登場しています。

 また、Objective-cをオブジェクトとして、またMVC(model view controller)モデルに従った拡張性の高い構造で構築するには、それに則った機能を使わなくてはなりません。

 2011年秋のStanfordの公開講座ではそれらの基礎が解説されており、これらの変化や基本を知る上で必見です。 http://deimos3.apple.com/WebObjects/Core.woa/FeedEnclosure/itunes.stanford.edu-dz.10655206402.010655206404.11199595098/enclosure.pdf

2012年3月19日月曜日

Could not find MainStoryboard

ソースサンプルの実行時にMainStoryBoardが見つからないときの対処方法 http://stackoverflow.com/questions/9113329/xcode-4-2-mainstoryboard-not-found

2012年3月4日日曜日

TWRequest Class Reference

TWRequest Class

TWRequest(Twitter Framework)は in iOS 5.0以降で動作する。

TWRequestオブジェクトは、Twitterの操作とユーザ認証のためのHTTPリクエストを含んでいる。
・URL 識別
・HTTP メソッド(GET, POST or DELETE)
・要求ごとの問い合わせパラメータのセット
・分割POST
詳細はTwittter APIドキュメントを参照のこと。
メソッド initWithURL:parameters:requestMethod: は、新しいTWRequestオブジェクトを生成しする。
メソッド addMultiPartData:withName:type: は分割POTSTの本体を定義する。
メソッド performRequestWithHandler: ハンドラーに定義された要求を実行する。あるいは, 代わりにsignedURLRequest メソッドで NSURLConnection オブジェクトで処理する。
もし、Twitterの承認が必要な場合は、アカウントを登録をACAccountオブジェクトで実施する。

ーーーーーーーーーーーーーーーーーーーーーーーーーー

Initializing Requests
– initWithURL:parameters:requestMethod:

Accessing Properties
account
requestMethod
URL
parameters
– addMultiPartData:withName:type:

Sending Requests
– performRequestWithHandler:
– signedURLRequest

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー



プロパティ

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

account
  オーソライズが要求されるリクエストで使用するアカウント情報(オプション)
@property(nonatomic, retain) ACAccount *account
    据えてのTwitterへの要求がオーソライズを必要とするわけではない。デフォルト値nil

parameters
  この要求のためのパラメータ(読み取り専用)
 @property(nonatomic, readonly) NSDictionary *parameters
    これらはHTTPリクエストのための問い合わせパラメータであり、Twitter API ドキュメントに従って記述する。

requestMethod
  この要求のためのメソッド
 @property(nonatomic, readonly) TWRequestMethod requestMethod
このプロパティは、 HTTPリクエストのメソッドとして定義さる。取りうる値は“TWRequestMethod.”で記述される。

URL
この要求のためのURL
@property(nonatomic, readonly) NSURL *URL
このプロパティは、HTTPリクエストのためのURLを意味する。取りうる値はTwitter API ドキュメントに記載されている。


ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
インスタンスメソッド
ーーーーーーーーーーーーーーーーーーー
 addMultiPartData:withName:type:
この要求の分割ポストの本体の名前を定義する。

- (void)addMultiPartData:(NSData *)data withName:(NSString *)name type:(NSString *)type

パラーメタ
data
分割ポストの本体のデータ
name
分割ポストの本体の名前
type
分割ポストの本体の型
ーーーーーーーーーーーーーーーーーーーーー
 initWithURL:parameters:requestMethod:
  プロパティで指定された内容で新しいオブジェクトを初期化する。

 - (id)initWithURL:(NSURL *)url parameters:(NSDictionary *)parameters requestMethod:(TWRequestMethod)requestMethod

パラメータ
url
このHTTPリクエストのためのURL
parameters
このHTTPリクエストのためのパラメータ
request. requestMethod
HTTリクエストで使用するメソッド
Return Value
新しい初期化オブジェクト

ーーーーーーーーーーーーーーーーーーーーー

performRequestWithHandler: 
Performs the request and when done calls the specified handler. - (void)performRequestWithHandler:(TWRequestHandler)handler Parameters handler The handler to call when the request is done. The parameters to this handler are described in TWRequestHandler. This handler is not guaranteed to be called on any particular thread. Availability Available in iOS 5.0 and later. Declared In TWRequest.h signedURLRequest Returns an authorized request that can be sent using an NSURLConnection object. - (NSURLRequest *)signedURLRequest Return Value An OAuth compatible NSURLRequest object that allows an application to act on behalf of the user while keeping the user’s password private. Availability Available in iOS 5.0 and later. Declared In TWRequest.h Constants TWRequestMethod Indicates the method used in the request. enum TWRequestMethod { TWRequestMethodGET, TWRequestMethodPOST, TWRequestMethodDELETE }; typedef enum TWRequestMethod TWRequestMethod; Constants TWRequestMethodGET Requests a representation of the specified resource. Available in iOS 5.0 and later. Declared in TWRequest.h. TWRequestMethodPOST Submits data to be processed. Available in iOS 5.0 and later. Declared in TWRequest.h. TWRequestMethodDELETE Deletes the specified resource. Available in iOS 5.0 and later. Declared in TWRequest.h. Discussion Use this constant to set the requestMethod property. TWRequestHandler The callback handler for a Twitter request. typedef void(^TWRequestHandler)(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error); Discussion The parameters to this handler are: responseData The data returned by the Twitter request. urlResponse The URL response returned by the Twitter request that includes the HTTP response codes. error An error sending the Twitter request if it occurs. Refer to Twitter API Documentation for possible values of these parameters. Availability Available in iOS 5.0 and later. Declared In TWRequest.h

参考:
    iOS5のTwitter APIを使って実装してみる          
     TwitterFrameworkの利用