Posts tagged iPod touch
[iPhone 開発メモ] アプリから URL を指定して Web ページを Safari で開く
06172日
by matsuura
in iPhone/iPod touch
アプリから URL を指定して Safari で開く方法
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.syuhari.jp/blog"]];
[iPhone 開発メモ] 本体の回転を検知する
16175日
by matsuura
in iPhone/iPod touch
iPhone を横方向に回転させた時に検知する方法のメモです。
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)FromInterfaceOrientation {
if(FromInterfaceOrientation == UIInterfaceOrientationPortrait){
// 横向き
} else {
// 縦向き
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
[iPhone 開発メモ] 警告画面の表示
36177日
by matsuura
in iPhone/iPod touch
iPhone アプリで警告画面を表示させる方法です。
警告画面を表示する
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Alert Test"
message:@"Message!!\nThis is Alert Test."
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"One", @"Two", nil];
[alert show];
[alert release];
[iPhone 開発メモ] 画像をドラッグする
56180日
by matsuura
in iPhone/iPod touch
画面に表示された画像を指でドラッグする方法です。
UIImageView クラスを継承した DragView クラスを作成する。
@interface DragView : UIImageView {
CGPoint startLocation;
}
@end
@implementation DragView
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
startLocation = [[touches anyObject] locationInView:self];
[[self superview] bringSubviewToFront:self];
}
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
CGPoint pt = [[touches anyObject] locationInView:self];
CGRect frame = [self frame];
frame.origin.x += pt.x - startLocation.x;
frame.origin.y += pt.y - startLocation.y;
[self setFrame:frame];
}
@end;
The iPhone Developer’s Cookbook 購入
06181日
以前から読みたかった「The iPhone Developer’s Cookbook」を購入しました。なぜかアマゾンで購入できなくなったり、予約販売になったりと不思議な本ですが、先日違う本を購入しようとしたときに、購入可能だったので急いで購入しました。今見たらまた予約販売になっていた。
(続きを読む…)
[iPhone] XML を NSXMLParser を使用して解析する
16182日
by matsuura
in iPhone/iPod touch
iPhone では NSXMLDocument がシュミレータでは動作するが実機では動作しないそうなので、NSXMLParser を使用して解析してみました。
解析したのは下記のような XML です。
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user name="hoge" age="20" />
<user name="fuga" age="30" />
</users>
iPod touch 2.0 で脱獄なしにスクリーンショットを撮る方法
06183日
by matsuura
in iPhone/iPod touch
iPod touch 2.0 から脱獄しないでもスクリーンショットが撮れるようになりました。撮り方はスリープボタンを押しながらホームボタンを押すだけです。一瞬画面が白くフラッシュして撮られたことが分かります。
(続きを読む…)
Mac のインターネット共有で iPod touch を出先でネット接続
16186日
箱根に行ったときに部屋の LAN に 有線で Mac を接続してインターネット共有を設定して、iPot touch を Mac に Wi-Fi で接続したときの方法をメモしておきます。
(続きを読む…)
