サービス終了のお知らせ NAVERまとめは2020年9月30日をもちましてサービス終了いたしました。 約11年間、NAVERまとめをご利用・ご愛顧いただき誠にありがとうございました。
iPhoneアプリの良いアイデアが出たので、これから作り始めようというところである。 さて、iPhoneアプリ開発童貞ってわけではないが、今までただ闇雲に作っていた感があるので、 実際にXcodeを起動してコードを書き始める前の設計をどうしていこうかと考えている。 ソフトウェアの作成はじめてではもちろん無いのでだいたい勝手は分かるものの、 iPhone特有の設計思考が必要な気がして、文献を漁っている。 ところが、世に出回っているiPhoneアプリ本にはUIKitをいじくるだけの解説ばかりではないか! で、つまるところ設計について有益だと思えたのは以下3つの文献だった。 「iOSアプリケーションプログラミングガイド」Appleのサイトからダウンロードできる 「iPhoneアプリ設計の極意 - 思わずタップしたくなるアプリのデザイン」のfladdictさんの章 「iOS開発におけるパターンによ
Appleから提供されているiOSのプログラミングガイド。日本語に翻訳されたiOSのドキュメントがあります。iOSデバイス向けのアプリを開発するにあたっては、必読の内容となっています。 これらは全てPDFで提供されています。 ですのでiPhoneでPDFを開き、iBooksで保存することが出来ます。 このように、持ち運んで空き時間に勉強できるんです。 PDFのリンクは下記にまとめていますので、iPhoneでご覧ください! iOSのドキュメント一覧(2011.8.20現時点) Audio & Video AV Foundationプログラミングガイド iOSカメラプログラミングトピックス Audio Session プログラミングガイド Core Audio の概要 iPodライブラリアクセス プログラミングガイド Tools & Languages Objective-C
Apple Vision Proを体験する機会があったので、感想をまとめました。 主に普段使っているMeta Quest 3との比較になります。なお、裸眼での試用だったため、解像感については評価できていません。 装着感 手に持った時の重さは明らかにVision Proの方がMeta Quest 3より重いですが、装着感は同様に感じました。試したのは後頭部だけで支えるタイプのバンドで、ダイアルを回して締め付ける操作が面白かったです。 パススルー Meta Quest 3では歪んで見える至近距離のiPhoneが、Vision Proでは歪まずに正しい形で見えました。ただし、Meta Quest 3も最近のアップデート(v64, v65)でパススルー性能が向上しているため、1m以上離れた物の見え方については同等に感じました。 視線トラッキング 視線のキャリブレーションを行った後は、視線でのアイコ
iPhone開発で、メモリ管理の基礎を社員に伝えることが増えてきたので、エントリとして書こう。 Objective-C基礎 メモリ管理の前にObjCの基礎として、メソッド呼び出しの話。 クラスのインスタンスaがmethodAをコールするときは、 [a methodA] と書く。このとき、aがnilだったときは、エラーではなく、コールされない。methodAに戻り値があるときは、それは、0やnilやNOが返る。ObjCでは、 void dealloc { if(a!=nil){ [a release]; } [super dealloc]; } は、気持ち悪いので、nilチェックはやめましょう。 なお、ObjCでは、動的にメソッドを差し替えることができ、コールの度にメソッドが存在しているかも確認しています。そのため、LL言語(ライトウェイト言語、スクリプト)のように柔軟な記述が可能です。そし
Upon first glance, the UIButton class doesn’t seem to provide what you might expect in terms of customization. This often causes developers to resort to creating buttons in an image editor and then specifying that in the Background field in Interface Builder. This is a fine solution and will likely give you what you need, but with Core Animation layers there is a simpler way to achieve the look yo
Welcome to the source code repository for the 3.0 edition of the iPhone Developer's Cookbook. Sample code is never a fixed target. It continues to evolve as Apple updates its SDK and the CocoaTouch libraries. Get involved. You can pitch in by suggesting bug fixes and corrections as well as by expanding the code that's on offer. Github allows you to fork repositories and grow them with your own twe
昨日のモバイル・カフェでGameKit(の一部)を説明したので、その資料とサンプルコードを公開しておきますね。横着するためにErica Sadun女史の書籍「iPhone Developer’s Cookbook, 3.0 Edition」のサンプルコードからGameKitHelperを利用しています。 簡単GameKit-P2P (PDF) サンプルコードSmash-X このサンプルは「iPhone SDKの教科書」に掲載したSmashを拡張して、2台のiPhoneのスクリーンを横断するようにUFOが飛び回るというものです。オリジナル版と同じく、指でタップしてUFOを叩き潰すこと(Smash)もできます。通信以外のキモはboundsプロパティの使い方かな。 Ustreamでは1時間13分あたりから。この時はBluetooth接続に手間取ったのですが、すぐに接続できる時もありますね。ちょっ
iPachiで起きていた不具合なのですが、 特定の画面を表示中にメモリ不足に陥り didReceiveMemoryWarningを受け取ると アプリがクラッシュするという問題をついに 解消しました。 didReceiveMemoryWarning後にクラッシュするので メモリ管理でどこかがおかしくなっているのだろうとは 予想がつくのですが、いかんせん貧弱なエラーメッセージの ため、まったく発生元がつかめませんでした。 EXC_BAD_ACCESSとか言われてもさっぱりわからんです。 が、すばらしい記事をみつけました。 NSDebugEnabled これでクラッシュをおこしているオブジェクトの生成場所を 特定できるので、格段にデバッグ効率があがります。 というわけで、エミュレータでのメモリ不足時のシミュレートと デバッグのための設定をまとめます。 エミュレータでのメモリ
前回はRSSフィードをダウンロードするところまで説明した。今回は、ダウンロードしたXMLデータをパースすることについて、説明しよう。 iPhoneのXMLライブラリ iPhoneは、標準で2種類のXMLをパースするためのライブラリを備える。libxml2とNSXMLParserだ。 libxml2はGnomeプロジェクトで開発された、XMLのパーサライブラリだ。もともとは、GnomeというLinuxディストリビューションの1つに対して開発されたものだが、MITライセンスのもとでソースコードが公開されているため、多くのプラットフォームに移植されている。もちろんMac OS Xにも移植され、それがiPhoneでも使えるようになっている。 libxml2の特徴は、高機能である事だ。まず基本的なXMLパーサ機能として、SAXおよびDOMパーサを提供する。さらに、XMLに関する多くの標準に対応してい
デフォルトの NSXMLPerser がシーケンスアクセスしかできなくてとても扱いづらい。 かといって、根っこの libxml2 は高性能で早くて DOM 使えるのにドキュメントが腐ってて扱いにくい。 で、探して見っけたのがこれ http://code.google.com/p/gdata-objectivec-client/ 使い方は、以下の通り。 Frameworks を右クリック、追加、既存のフレームワーク /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/usr/lib/libxml2.2.dylib をさくっと選択。 ターゲットのバイナリをライブラリにリンクに、libxml2.dylib をドロップ。 ターゲットを開いて、ビルドタブを開き、「リンク」「他のリンカフラグ」に「-lxml2」
With this I’m assuming you have a bit of familiarity with the iPhone SDK – you can download it for free from Apple’s site, and follow along here. We’re going to build an RSS feed reader for a simple feed (from The Apple Blog, no less). Let’s get started Open Xcode and choose the “File” menu, in which you’ll click the “New Project…” item. Click “Application” under “iPhone OS” in the list at left. O
alloc Foundation, NSObject, 10.0 メモリを確保してインスタンスを作ります 解説 メモリを確保してインスタンスを作ります。 サブクラスはオーバーライドしてはいけません。代わりにそのクラス専用の初期化メソッドとしてinit...メソッドを使用します。 不要になれば、releaseかautoreleaseでメソッドを解放する必要があります。 新たに作成されたインスタンスのisaインスタンス変数は初期化されます。 他の全てのインスタンス変数のためのメモリは、0までセットされます。 新しいインスタンスは、デフォルトのゾーンからアロケートされます。 特定のゾーンを使用する場合はallocWithZone:を使用してください。 初期化プロセスを完了させるためには以下のような形式でinit...メソッドを使用します。 TheClass *newObject = [[TheC
daichi1128’s DCAtomPub at master – GitHub はてなブックマークの登録をiPhoneアプリから行うにははてなのAtomPub APIを叩く必要がありますが、WSSE認証やらsha1やらbase64エンコードやらISO8061やらXMLポストやらでハマリ倒してしまったので、二度とつまずかないためにもライブラリ化してみた。 ライブラリというほど大げさなものでもないのですが、ソースコード公開デビューということで大目にみてやってください。 Objective-CでAtomPubを簡単に操作するライブラリDCAtomPubをgithubに公開しました。 ライセンスは修正BSDライセンスです。 AtomPubに関する情報はこちらから。 日本語訳はこれ。ソフトウェア分野の研究開発 / RFC 5023 Atom Publishing Protocol 日
CocoaではNSXMLDocumentを使うと簡単にXMLデータを処理することができるが、iPhoneにはなぜか搭載されていないためNSXMLParserを使い自分でXML解析を行う必要がある。NSXMLParserはイベントドリブンのパーサーなのでそのままでは多少使い勝手が悪い。 NSXMLParserの挙動の確認 NSXMLParserの挙動を確認するために、下記の用なクラスを用意した。 MyXMLDocument.h // // MyXMLDocument.h // xml_parser // #import <Foundation/Foundation.h> @interface MyXMLDocument : NSObject { NSXMLParser *parser; } - (id) initWithXMLString:(NSString*)string; @end My
iPhone Core Audio Programming 1回目。 Getting Started With Audio Unitが2006/12、Introduction to Audio UnitiPhone Core Audio Programming 1回目。 Getting Started With Audio Unitが2006/12、Introduction to Audio Unit Developmentが2007/11と、情報が古くなってきました。加えて、iPhoneの登場でCore Audioが次の次元へ進みました。Core AudioとiPhoneが出会い、「いつでもどこでもCore Audio」な時代の到来です。そんなiPhone Core Audioの全容がやっとつかめてきたので、続編iPhone Core Audio Programmingをはじめます。 i
WebKitを使う方法もあるようですが NSMutableURLRequestを使って(おそらく)最もシンプルにやると NSString* content = @"test=hoge&test2=moge"; NSURL* url = [NSURL URLWithString:@"http://www.hogemoge.com/index.php"]; NSMutableURLRequest* urlRequest = [[NSMutableURLRequest alloc]initWithURL:url]; [urlRequest setHTTPMethod:@"POST"]; [urlRequest setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]]; NSURLResponse* response; NSErr
iPhoneでXMLを扱う際には、使いたいCocoaのXML関連クラスがiPhone上で使えるかどうかにまずは注意しましょう。 例えば、NSXMLDocumentやNSXMLElementといった、NSXMLNodeのサブクラスは、iPhone Simulator上では使えますが、iPhoneの実機では使えません。 シミュレータで開発を続けていて、いざ実機で動かそうとしてコンパイルが通らない!という段階になってから気づく...といった事態に陥らないためにも、注意が必要です。 逆にiPhone上で使えるのは、NSXMLParserクラス。 NSXMLParserのサンプルとしては、SeismicXMLというのがありますが、ちょっと複雑すぎます。その辺、うまくまとめたのが、このチュートリアルです。 http://blog.atrexis.com/index.cfm/2008/7/28/iPho
最近Twitter熱が僕の回りでも加速してきたけど、アプリ標準機能として搭載すべく、iPhoneアプリ内でtwitterポストするためのサンプルコードを書いてみた。 Twitter API Wiki / Twitter REST API Method: statuses update 詳細は公式Wikiに譲るとして、最低限のAPI仕様は http://twitter.com/statuses/update.xmlへ ベーシック認証つきで POSTメソッドを使い statusパラメータ=「つぶやき」のリクエストを投げる 上記4点が満たされていればOK。 そんな条件を満たしたポストコードが以下。 ?View Code OBJECTIVE-C- (void)update:(NSString *)tweet { static NSString *udpateUrl = @"http://
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く