• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

http://www.mobileorchard.com/category/screencasts

MobileOrchardさんが行っている有料のクラスでのスクリーンキャストを1週間だけ無料で公開するそうです。その後は有料。 RSSでチェック!又は@MobileOrchardをfollowですね。

ちなみに第1回目は「Screencast: iPhone Provisioning: Running Development Code On Your Phone」開発したコードをiPhone上で動かすという内容です。URLは下記:

http://www.mobileorchard.com/iphone-development-provisioning/

posted by Png satoko on Wed 26 Aug 2009 at 19:07

via

http://forums.macrumors.com/showthread.php?t=570789

メモメモ。アプリの雰囲気に合うようなstatusBarを設定できるとおしゃれですよね...

Info.plist

Info.plist内でこういう風に設定すればOK:

   1  <key>UIStatusBarStyle</key>
   2  <string>UIStatusBarStyleBlackOpaque</string>

posted by Png satoko on Wed 26 Aug 2009 at 18:56

iPhoneに限った話ではないのですが。メモ:

via
http://discussions.apple.com/thread.jspa?messageID=8157595

CGRect → NSValue

CGRect rect = CGRectMake(x,y,w,h);
NSValue *rectValue = [NSValue valueWithCGRect:rect];

NSValue → CGRect

CGRect rect = [someNSValue CGRectValue];

posted by Png satoko on Wed 12 Aug 2009 at 22:18

調べてわかったのですが、複数パラメータを持つメソッドのSELは作成できるのですが(下記)、UIButtonなどのtarget-action設定時にパラメータを渡す事はできないようです。

-(void)methodWithNoArguments;
SEL noArgumentSelector = @selector(methodWithNoArguments);

-(void)methodWithOneArgument:(id)argument;
SEL oneArgumentSelector = @selector(methodWithOneArgument:); // notice the colon here

-(void)methodWIthTwoArguments:(id)argumentOne and:(id)argumentTwo;
SEL twoArgumentSelector = @selector(methodWithTwoArguments:and:); // notice the argument names are omitted

ちなみに、自分でSELのメソッドを呼び出すときには、パラメータを渡す事は可能:

-performSelector:
-performSelector:withObject:
-performSelector:withObject:withObject:

senderでごにょごにょ

できないと言っても、if(sender == _myButton) {} とか sender.tag をうまく使って、誰が呼出し元かや、intを渡す事は可能なようです。

Refs

posted by Png satoko on Wed 12 Aug 2009 at 20:51

Can't exec "xcodebuild": No such file or directory at /opt/local/bin/scan-build line 830.

いつの間にかscan-buildでエラーが出るようになってしまったみたいで、ちょっと困りました。解決したので、自分用にメモ。

"xcodebuild"はXcodeのコマンドラインツール

scan-buildは悪くないらしい...というので考えたら、少し前に古いverのXcodeを削除してしまったので、最新のxcodebuildが$PATHに通っていないのが原因ぽい。

「xcodebuild」は、Xcodeで作成されたプロジェクトをコンパイルするコマンドラインツールだ
http://slashdot.jp/~hylom/journal/459704

で .zshrcに新しいxcodebuildへのPathを追加

   1  export PATH=/Developer3.1b2/usr/bin:$PATH

するとscan-buildが無事できるようになりました!
で、いつものようにscan-build xcodebuildをやってみたのだけれど、またエラー:

   1  scan-build xcodebuild  
   2  === BUILDING NATIVE TARGET ShoppingList OF PROJECT ShoppingList WITH THE DEFAULT CONFIGURATION (Release) ===
   3  
   4  Checking Dependencies...
   5  2009-08-05 06:00:35.063 xcodebuild[5232:10b] _XCDistributedBuildHostInfoTask encountered an error: Error Domain=NSPOSIXErrorDomain Code=2 UserInfo=0x36ebf70 "Operation could not be completed. No such file or directory"
   6  error: There is no SDK with the name or path 'iphoneos2.2'
   7  ** BUILD FAILED **

引数なしでscan-buildすると、プロジェクトで設定されているiPhone OS2.2を選択してbuildしようとしてエラーになっているみたいです。

scan-buildの-sdkオプション

scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulor2.2.1
http://studiot.jp/blog/?p=64

上を参考に-sdkオプションを適用してやると:

   1  scan-build xcodebuild -sdk iphoneos2.2.1

大量のエラーぽいものを出しながらビルド成功+バグなし。
怪しいので3.0にしてみたらエラーも出なくて、ちゃんとバグを発見してくれました:

   1  scan-build xcodebuild -sdk iphoneos3.0 

posted by Png satoko on Tue 4 Aug 2009 at 21:50