Objective-C での開発にだいぶ慣れてきたのですが、いまだメモリ管理まわりでハマることが多いのでまとめてみました。 メモリを確保してから解放するまでの流れ メモリを確保してから解放するまでの流れは以下の図のようになります(図はアップルのサイトから引用)。 alloc または init すると参照カウントが1になります alloc または init 系メソッドを呼ぶと参照カウントが1になります。 このように書いたのは、クラスの仕様によって alloc メソッドで retainCount が1になるオブジェクトと init 系のメソッドで retainCount が1になるオブジェクトがあるためです。alloc と init はセットで呼ばれることがほとんどなのでこの違いが問題になることはないと思いますが念のため。 int main() { /* allocで参照カウント1 */ NS
※7/1: キーとなる状態と遷移の説明を追記しました。 iOS4 からアプリケーションのマルチタスク動作が可能になりました。これに伴い、iOS4 ではアプリケーションに新しい状態やイベントが追加されています。ここでは、iPhoneAppProgrammingGuide 4.0 2010-06-04 版 [1] を元にして、新しいアプリケーションの状態遷移をまとめてみます。(まだ、理解しきれていない部分もありますが、自分の理解のまとめという意味でひとまず) 注意:ここで言うアプリケーションの「状態」とは、UIApplicationStateが表す状態や、[1] の P29 Table 2-3にある Application statesとイコールではありません。Launchingや Terminating、Active, Inactive状態のスーパー状態としての Foreground状態など
はじめに Ruby on Railsサーバーアプリと連権するiPhoneアプリを超簡単に書けるObjectiveResourceに付いて書かせて頂きます吉田裕美です、宜しくお願いいたします。 この記事は、iPhoneアプリを開発には詳しくないWebアプリを主に開発しているプログラマーと、Webアプリの開発には詳しくないiPhoneアプリのプログラマー両方の方に読んでいただけるよな構成になっています。 iPhone開発経験者の方は iPhone編(本稿)は「ObjectiveResourceとは」を読んだら「iPhone開発入門は」さっと目を通し、 Ruby on Rails編はじっくりと読んでください。 Ruby on Rails開発経験者の方は iPhone編(本稿)はじっくりと読んでください。 Ruby on Rails編はRuby on Railsとは」と「Ruby on Rails
スクリーンショットとりながら丁寧に説明する気はないのだけど、メモ残しとかないと自分でも忘れそうなので・・・ iPad の登場で、iPhone/iPad 両方に共通のバイナリというものが SDK 3.2 で作成できるようになりました。 もちろん、iPhone は iPhone OS 3.1系、iPad は 3.2 系なので、API の変更を吸収する必要はあるのですが、それを差し引いてもシングルバイナリで提供できるというのはメリットが多いわけで・・・ で、その方法。主に Interface Builder を使ってる人向け。 詳しくは Starting Your Project を読んでください。MPMoviePlayer を使っている自分にとっては「どうすんだよ、これ・・・」って感じではあるのですが・・・ま、それはさておき。 ※次の手順 1-3 については、XCode の 「Upgrade
安田先生に頼まれていたWebViewの使い方と、簡単なHello,worldの書き方を日経ソフトウェアを参考に紹介しました。 iPhone勉強会資料View more documents from pastak.
Near realtime face detection on the iPhone w/ OpenCV port [w/code,video] Hi OpenCV is by far my favorite CV/Image processing library. When I found an OpenCV port to the iPhone, and even someone tried to get it to do face detection, I just had to try it for myself. In this post I’ll try to run through the steps I took in order to get OpenCV running on the iPhone, and then how to get OpenCV’s face d
I was recently the coder on an iPhone puzzle game. This was my first iPhone project, as well as my first project on any Apple platform. For the most part, development was straightforward OpenGL programming in C++. The game's audio, however, turned out to be very difficult to implement. Here is what I learned. There are 3 distinct audio output APIs available, and they are all incompatible. These AP
I have been working with Apple’s Push Notification service recently and decided to make a library to send notifications with Haskell. It is very simple and has a few helpers to make notifications with an alert, sound, etc,. ApplePush Hackage ApplePush Documentation When using the library, you must use an SSL tunnel, because Haskell’s SSL support is incomplete. I use stunnel4, which works great, an
View the source for my example application. Apple seems to have a tight leash on how you can develop for the iPhone. The User Agreement essentially states that you can only program in Objective-C. Now, let's see... Objective-C is a superset of C, correct? So C code is valid, right? If we only had something which could generate C for us... it would take code in the language of our choice and compil
Wednesday, March 25, 2009 at 5:20 PM Guest post by Tom Saxton, Idle Loop Software Design In September, my small software company shipped our first iPhone app, a grocery list program called Grocophile. One of the most common requests from our users was the ability to exchange data over the Internet. Greg Robbins of Google's Mac team suggested that the Google Docs API might be useful, so I jumped in
I’ve been watching, with interest, developers create new applications for the iPhone. Owning one myself – and being knowledgeable in JavaScript – I’ve been wondering what options there were for creating downloadable JavaScript applications or the iPhone. In doing some research I found a number of solutions, some simpler than others, some requiring more knowledge of Objective-C than others. Before
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く