Hatena::Groupiphone-dev

func09の日記

2008-12-04

release

20:04


NSString *moji1 = @"hoge";
[moji1 release] // => OK

NSString *moji2 = [NSString stringWithFormat:@"%@", @"hoge"];
[moji2 release] // => NG

NSString *moji3 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"hoge.jpg"];
[moji3 release] // => NG

2008-12-03

iPhoneのスリープ防止

18:41

iPhoneスリープさせない

http://d.hatena.ne.jp/iphone_dev/20081030/1225363065

[UIApplication sharedApplication].idleTimerDisabled = YES;

UIAlertView

18:23

UIAlertViewを使うサンプル

UIAlertView *alertView = [[UIAlertView alloc] 
  initWithTitle:@"title"
  message:@"message"
  delegate:self
  cancelButtonTitle:@"Cancel"
  otherButtonTitles:@"OK",nil];
[alertView show];
[alertView release];

最後のnilがよくわかんないけど、無いとハングする。

以下はデリゲートメソッド。オプション

#pragma mark - UIAlertViewDelegate Protocol
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{}
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex{}
- (void)alertViewCancel:(UIAlertView *)alertView{}
- (void)didPresentAlertView:(UIAlertView *)alertView{}
– didPresentAlertView:{}

2008-12-01

iPhoneの端末IDの取得方法

16:48

UIDevice *device = [UIDevice currentDevice];
NSLog(@"%@", [device uniqueIdentifier]);

SukeySukey2011/05/14 18:50That's 2 clever by half and 2x2 clever 4 me. Thnaks!

bjznoawfbjznoawf2011/05/15 12:35AnPvUK <a href="http://tmzoovfzlorn.com/">tmzoovfzlorn</a>

tktjdwxujjtktjdwxujj2011/05/16 22:28ZEFRHO , [url=http://ehjeooqcaizp.com/]ehjeooqcaizp[/url], [link=http://txwqnjvibujz.com/]txwqnjvibujz[/link], http://mbihxllfcquk.com/

jhjezwnypjhjezwnyp2011/05/17 14:03CbaZJ5 <a href="http://iyfdkdntptcs.com/">iyfdkdntptcs</a>

erotokigyuerotokigyu2011/05/29 22:49k5qnBu , [url=http://hjxatnlabeiw.com/]hjxatnlabeiw[/url], [link=http://pkorpjnuddhg.com/]pkorpjnuddhg[/link], http://xktahpiuptnr.com/