2012年12月19日水曜日

久しぶりの開発でオーガナイザーでハマった・・・

iOS 開発久しぶりのため、完全にはまりました。

プロビジョニングプロファイルが期限切れ・・・Renew しようかと思いましたが、どうにもできない・・・

いろいろいじってみると、オーガナイザーにデバイスが表示されるまでに1分、オーガナイザーはほぼハングアップ。Organizer落とすところだったよ・・・あぶね。

しかし、またプロファイルがRenewできない・・削除したりなんなりしてもだめ・・・

よくよく見るとデバイス右にあるランプが灰色・・・ボタンを押してみると、デバイスの画面に。開発用に登録しろと・・・ボタンポチってOK・・・疲れた・・・

でiOS Team Provisioning Profileは・・かってにできてましたよ・・・ふぅ。

2012年11月12日月曜日

ディベロッパ・配布証明書の作成と登録

新しいMac となり、早速つまづくのは証明書の作成と登録です。

Macbook PRO Retinaを買ったので自宅のiMacと証明書を共有しなくてはなりません。
たしか既存のMac からもってこなくてはいけなかったするはずです。

なので、普通の手順とも異なり、普通1回やって終わりとかなので、思い出すのも大変です。手順を整理したいと思います。

1. キーチェーンアクセスを起動し証明書を取得する<初回のみ>

⑴ 右上の拡大鏡(Spotlight)から ”キーチェーンアクセス” を入力し、起動する。

(2) メニューから「キーチェーンアクセス」−「証明書アシスタン」−「認証局に認証書を要求...」を選択すると、「証明書アシスタント」が表示される。

(3)「証明書情報」に、ディベロッパ登録時の「メールアドレス」と「通称(実は名前)」を入力する。
(まだApple IDがメールアドレスでないときに登録したのにどうなの? たぶんProfileに登録しているメールアドレスなんだろうけど)

(4)要求の処理:で「ディスクに保存」「鍵ペア情報を指定」をチェックする。

(5)鍵ペア情報で「鍵サイズ 2048bit、 アルゴリズムRSA」を選択し、「続ける」を押下

(6)[CertificateSigningReqest.certSigningRequest]ファイルが生成されるのでMacに保存

(7)SafariでiOS Dev Centerにログインし、iOS Provisioning Portal(右枠内)に入る。Developer タブとDistribution タブの両方で、<Your CertificatesのRequest Certificateボタンを押し(6)のファイルをアップロードを実行、Dowonloadボタン(またはclick here to download)が表示されたらダウンロードする( developer_identity.cer, distribution_identity.cer, AppleWWDRCA.cer の3ファイル)。

(6)これら3ファイルをダブルクリックすることで自動でキーチェーンに登録する。


2.証明書の書き出し(バックアップ:初回のみだが、複数Macの運用にも使用)

(1)右上の拡大鏡(Spotlight)から ”キーチェーンアクセス” を入力し、起動する。

(2)「ログイン」「自分の証明書」にある「書き出す証明書(上記3つ)」をリストからすべて選択、右クリックし「(証明書名)を書き出す」を選択、その際フォーマットは「個人情報交換(.p12)」を選択。ファイルの名前とパスワードは任意で書き出す。

3.別マックに証明書を実装
 いよいよです。自宅のiMac、HDDが壊れると連絡があったタイプです。証明書バックアップして早く修理にださないと・・・

(1)別マックに証明書ファイル(*.P12)をコピーし、クリックすれば自動的にキーチェーンに登録されます。

本日の業務終了。ダブルクォータパウンダー+100円コーラで計590円なーり。高っww




2012年11月6日火曜日

iOS 開発再開!!

MacBook Air を失って(?)以来、なかなか開発に手をつけることができませんでしたが、ついに再会。
MacBook PRO 13inch Retinaを購入して動機を保とうという魂胆です。

はたしてうまくいくかどうか。

とはいうものの、USキーボードにしたMacbook PROの操作が板につかなかったり、Wimaxルータの充電用のmicroUSBケーブル忘れたりとか、さっそくつまづいていたりして・・

あとはXCode4になって以来、ARCだとかStoryboardだとか、いろいろな変更があるなか、追いつくのにやっとというところがあります。

もっとも、不要に学習する必要もないわけで、これからすこしづつ、毎日取り組んで追いつきますよ。

次のアプリは・・お楽しみに??

ちなみに巻き紙電卓は、最近のiOSでバイスの売り上げがいいせいか、やや上向き加減です。はやくiOSのハードウェアの進化にもおいつかないとねぇ。ユーザに見放されちゃうよ。

ということでがんばりますので応援よろしくお願いします!!


2012年8月14日火曜日

UIPopoverControllerをiPhoneで使う。

UIPopoverControllerはiPhoneでは使えません。ただしgithubで公開されているライブラリで同様な動きをするものが公開されているそうです。



詳細はこちらまで。
http://d.hatena.ne.jp/shu223/touch/20110316/1300375000

2012年8月13日月曜日

XCode 4.4からできるようになったこと。


@synthesizeを省略できます

privateメソッドの定義を省略できます

  • NSNumber
  • NSArray
  • NSDictionary
についても同様の省略形の書き方が追加されました。
具体的には、それぞれ
  • NSNumber @100 @3.14 @'a' @0xff @(YES)
  • NSArray @[val1, val2, val3]
  • NSDictionary 

以下に具体的コードの説明があります。
http://www.tokoro.me/2012/08/12/objc-new-statements/

2012年8月8日水曜日

XCode4.4アップデート内容

Objective-Cや開発環境の変化になかなかついて行けません。というかついて行くための努力ってのを怠っています。で、ステップバイステップで毎日何かをしないと、と反省。

とりあえず、AppStoreにあるアップデート内容(XCode4.4)から。でもこれまで聞いた内容と変わらなかった。とりあえず英語の勉強w

Xcode provides everything developers need to create great applications for Mac, iPhone, and iPad. Xcode 4 has been streamlined(洗練されてきている) to help you write better apps. It has unified user interface design, coding, testing, and debugging all within a single window. The Xcode IDE analyzes the details of your project to identify mistakes in both syntax and logic, it can even help fix your code for you. 

Xcode runs on OS X Mountain Lion and OS X Lion, and includes the Xcode IDE, Instruments, iOS Simulator, the latest Mac OS X and iOS SDKs, and hundreds of powerful features:

Innovative tools to help you create great apps
• Interface Builder is fully integrated as a design canvas within the Xcode IDE
• The Assistant shows files related to what you're editing, such as the header, superclass, or controller
• The Version editor shows a live source code comparison through Git or Subversion history
• Live Issues display errors as you type, and Fix-it can correct the mistakes for you
• Apple LLVM compiler is embedded within the IDE with support for Objective-C, C, and C++
• The new LLDB debugging engine is faster and more memory-efficient than GDB
• Instruments adds System Trace and new iOS instruments including OpenGL ES

Streamlined interface that is faster and easier to use
• Design your interface side by side with the backing(裏打ちされている) source code
• Create connections from your GUI design directly to the related source code
• Use tabs to organize your workspace, or double-click to open files in a new window
• Schemes let you customize exactly how your app will build, run, profile, and deploy
• Debugging and console views slide in without disturbing your place in the editor

Professional editor keeps you focused on your code
• Click the Jump Bar at the top of the editor to instantly go to another file
• View message bubbles to see errors, warnings, and other issues right beside the code
• Use the ribbon on the left of the editor to fold your code, or highlight scope

Embedded Apple LLVM technology finds and fixes bugs for you
• Analyzer travels countless(数えきれない) code paths looking for logical errors before they become bugs
• Live Issues underlines coding mistakes as you type with no need to build first
• Fix-it can confidently correct mistakes for you with just a keystroke
• Code completion for Objective-C, C, and C++ is incredibly fast and accurate

Instruments for visual performance analysis
• Compare CPU, disk, memory, and OpenGL performance as graphical tracks over time(時間とともに)
• Identify performance bottlenecks then dive deep into the code to uncover(ふたを開ける、見いだす) the cause(原因)
• Monitor your app directly, or sample the entire system, with very little overhead

To test or deploy applications on an iOS device you must be a member of Apple's iOS Developer Program.  To submit your Mac or iOS apps to the App Store you must be a member of the Mac or iOS Developer Program.  Some features may require Internet access.

• SDKs for OS X 10.8 Mountain Lion and iOS 5.1. 
• Enhanced for the MacBook Pro with Retina display. 
• Code completion persists your selections to give more accurate suggestions. 
• Objective-C @synthesize command is generated by default when using properties. 
• Objective-C adds literal syntax for numbers, arrays, dictionaries, and expressions when developing for OS X. 
• Apple LLVM compiler supports additional C++11 features, including lambdas. 
• Assistant editor tracks caller or callee for the current selection. 
• New localization workflow can share a single base .xib file for multiple locales on OS X. 
• Source control can commit individually selected changes. 
• ARC migration tool converts both retain/release and garbage collected code. 
• Fixes an issue where code completion could fail, requiring the user to delete derived data. 
• Additional bug fixes and stability improvements.

2012年8月5日日曜日

iOSアプリ開発をはかどらせるツールのまとめ

・ソーシャルアプリ作成 Parse.com
・リファレンス検索 Dash
・リポジトリ github
・クラッシュレポート Crashlytics
・AppStore分析 AppAnnie(これは使ってる)
・多言語化 Linguan
・アクセス解析 Google Analytics
・メモリリーク検査 Istruments/Leaks

こちらをどうぞ。

http://qiita.com/items/6faa03455f99ce7497a0

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の利用

2012年2月15日水曜日

Objective-C のキューは、NSMutableArrayで作る。


iOS4から?キューがディスコンになったのは、多分NSMutableArrayを使えってことなんだろうなぁ。
NSMutableArray‘s methods are conceptually based on these primitive methods: