XcodeでiPhoneアプリの開発中に急にこんなメッセージが出てアプリが起動できない状態になった。
|
|
Couldn't register xxx.xxxxxx.xxxxxx with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found). |
iPhoneを再起動したら直った。
いつの間にかiPhoneの状態に問題が出てたのかな。
NavigationBarの背景色を好きなものに変える
UINavigationControllerのNavigationBarは背景色を自由にかえることができる。
アプリに合った色にすると見栄えも良くなるだろうか。
取りあえず仮で色を変えておく。
NavigationControllerを作っている所で変えておこう。このアプリではAppDelegateのところ。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[super application:application didFinishLaunchingWithOptions:launchOptions];
AlbumListViewController *controller = [[[AlbumListViewController alloc]init]autorelease];
UINavigationController *navigationController = [[[UINavigationController alloc]initWithRootViewController:controller]autorelease];
navigationController.navigationBar.barStyle = UIBarStyleBlack;
// NavigationBarの色を変える
// 今は適当に#CF5B6Fにしておく
navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.761 green:0.333 blue:0.408 alpha:1.0];
navigationController.toolbar.barStyle = UIBarStyleBlack;
self.window.rootViewController = navigationController;
return YES;
} |
続きを読む
Audio帳(仮)を作るために、iPodのオーディオブックへのアクセスを試してみる。
とりあえず、TableViewにオーディオブックの一覧を表示をやってみる。
まず前提として
- 「MediaPlayer.framework」ライブラリをリンクしていること
TableViewControllerを継承したControllerを作る。アルバムのコレクションを維持するNSArrayを持っておく。
|
|
#import <UIKit/UIKit.h>
@interface AlbumViewController : UITableViewController {
@private
NSArray *_albums;
}
@property(nonatomic, retain) NSArray *albums;
@end |
続きを読む
UIViewに直接図形を描画するにはコンテキストを使う。
CGContextをゲットして、それに対して図形を描いていく。
今回はUIViewのdrawRectメソッドをオーバーライドして描画してみる。
続きを読む
UIToolbarのアイテムを状況によって切り替えたい時がある。
そんな時はUIToolbarのsetItemをまた呼び出せばいい。
以下がサンプルコード。
続きを読む