2009年9月3日 星期四

ipod touch 破解方法

1. download redsn0w-mac_0.8
2. run redsnow
3. choose iPod2,1_3.0_7A341_Restore.ipsw
4. plugin ipod , close ipod
5. let iphone enter DFU mode ( 按住home & 電源 10秒 ,接著按home for some time)
6. if the screen show "waiting for reboot", unplug ipod & plug ipod again

2009年8月27日 星期四

UIViewController

originally in view of A controller,
then show view of B controller:
[self presentModalViewController:testViewController animated:YES];
[testViewController release];

jump back to view of A controller
[self dismissModelViewControllerAnimated:YES];

UIButton

ex:
UIButton *backButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
backButton.frame = CGRectMake(380, 260, 80, 30);
[backButton setTitle:@"Back" forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(backButtonClicked:)
forControlEvents:UIControlEventTouchUpInside];

2009年8月26日 星期三

core animation

three basic steps for core animation:
1. beginAnimations
2. setAnimationDuration
3. commitAnimations

shorter word to access app delegate

#define AppDelegate (MyAppDelegate *)[[UIApplication sharedApplication] delegate]


then use AppDelegate in the code


do something in the future

1. execute function in the future

- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;

ex: [self performSelector:@selector(sing:) withObject:nil afterDelay:1.4];


2. use timer

(NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;

ex: [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(test:) userInfo:nil repeats:YES];
note:
to delete timer, use invalidate method
ex:
-(void)test:(NSTimer*)timer
{
[timer invalidate];
}

2009年8月25日 星期二

iphone view size

UIInterfaceOrientationLandscapeLeft:

w:480 h:320