52Remove Observer before dealloc

Remove observer before deallocating, otherwise observer accumulate and eventually crash the application.

[[NSNotificationCenter defaultCenter] removeObserver:self];

47Specifing Values in CALayer

You can not specify a structure field key path using Objective-C 2.0 properties. This will not work:

myLayer.transform.rotation.x=0;

Instead you must use setValue:forKeyPath: or valueForKeyPath: as shown below:

[myLayer setValue:[NSNumber numberWithInt:0] forKeyPath:@"transform.rotation.x"];

brrrrrr.

- (id)valueForKey:(NSString *)key

  • (void)setValue:(id)value forKey:(NSString *)key

... NSKeyValueCoding Protocol Reference

41Returning to View Above

always [self release] when [self.view removeFromSuperview]

[self.view removeFromSuperview]; [self release];

... or duplicates of the view remain.

39IP via 3G

(126).(245).(13).(47) pw126245013047.5.tik.panda-world.ne.jp pw1234.5.tik.panda-world.ne.jp

http://kwappa.txt-nifty.com/blog/2008/07/iphoneipua_c1bd.html

http://pc11.2ch.net/test/read.cgi/php/1207013301/425-428

If reality and my image of it do not concur, then it's a pity for reality.

(standby)

37Perform method in Background

[self performSelectorInBackground:@selector(method) withObject:nil];

& wrap method in autorelease pool.

maybe also of interest: http://code.google.com/p/plactorkit/ Dictated but not read.

35Delay method execution

[self performSelector:@selector(methodName) withObject:nil afterDelay:0.10f];

update: http://codec.trembl.org/58/

33CGPointMake

CGPoint CGPointMake ( CGFloat x, CGFloat y );

x, y has to be floats, passing only integers might not work.

especially good to know, when and if ints get converted into floats.

= CGPointMake(100.0f + someIntVar, 50.0f + anotherIntVar); ≠ CGPointMake(100 + someIntVar, 50 + anotherIntVar);

this .0f seems to have a meaning after all.

28Changing Xcode Project Name

http://mohrt.blogspot.com/2008/12/renaming-xcode-project.html

renamexcodeproject

26Adding Border between UIScrollView pages

Adding Border between UIScrollView page, but keep the content pages fullscreen.

1. setting bounds defines snapping points. (myScrollView.frame) = CGRectMake(0, 0 , 320+(myPixelBorder), 480);

2. keep subview size at fullscreen width (mySubView).size.width = 320;

24setContentOffset does not like pagingEnabled

pagingEnabled should be set to NO, BEFORE attempting to change the offset with setContentOffset:point animated:NO.

if the order is reversed, strange results. would only work when animated:YES