2009年9月9日 星期三

Quartz introduction

drawRect:
drawRect method of UIVew is called when a view needs to redraw itself
we usually add drawing code in this function

2009年9月5日 星期六

install ipa

from cydia,
install app: AppSync
restart ipod

thread & lock

- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait;


create new thread to do something

- (void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg;


sleep

[NSThread sleepForTimeInterval:0.5]


lock:

ex:

NSLock *testLock = [[NSLock alloc] init];

[testLock lock];

[testLock unlock];

[testLock release];

UILabel

adjust line number:
can adjust from interface builder

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];