January 2010
11 posts
3 tags
iPad's Traditional Chinese Question
It’s easy, Apple can’t make it ready within 60 days. lukhnos: It’s curious why iPad does not come with Traditional Chinese support in its current version while it does Simplified Chinese. Perhaps it’s not yet fully localized, or perhaps the input methods are not ready yet. Curious, then—since Simplified Chinese is there, and Apple can just use the same code base that is used in...
Jan 29th
11 notes
4 tags
Jan 26th
1 note
6 tags
Retain property and autorelease
Say you have a retain property, what is the most obvious mistake one could ever make? self.myRetainProperty = [[MyClass alloc] init]; // No! You forgot to autorelease it, and self.myRetainProperty retain count now goes to 2. self.myRetainProperty = [[[MyClass alloc] init] autorelease]; // Correct. I just realized I got some of this in viewDidLoad:, and I believe you have it too! Update:...
Jan 25th
4 notes
7 tags
Dr. Touch's AnitCrack →
Fun with LC_ENCRYPTION_INFO in your binary’s info segment. Very sexy! Update: I think it was originally mentioned in Landon Fuller’s iPhone: Preventing Piracy. #import <dlfcn.h> #import <mach-o/dyld.h> #import <TargetConditionals.h> /* The encryption info struct and constants are missing from the iPhoneSimulator SDK, but not from the iPhoneOS or * Mac OS X SDKs....
Jan 24th
2 notes
6 tags
Jan 23rd
5 tags
Change of UISearchDisplayController's...
Do not try: self.searchDisplayController.searchResultsTableView.rowHeight = 50.0; It’s just won’t work, cause searchResultsTableView will destroy/recreate internally. If you set the rowHeight here, it might fall back to default sometime later when user uses search. Instead of changing this read-only property, you should use UISearchDisplayDelegate: -...
Jan 22nd
1 note
4 tags
Does your phone driving drunk? →
Droid DOES!
Jan 10th
4 tags
Jan 9th
48 notes
6 tags
Comma operator for releasing and nil in one line
Use comma to chain commands together in one line: [myString_ release], myString_ = nil; And it’s part of the C language. Update: Wikipedia has a much more complex prototype example: Type2& operator, (const Type1& a, Type2& b); But it explains the same thing.
Jan 6th
3 tags
Jan 5th
2 notes
7 tags
Change UITextField's placeholder color without...
The safe way to customize UITextField’s placeholder is subclassing the UITextField and overriding placeholderRectForBounds:, Apple won’t bother you on this one. However, if you want to take the risk, you can try this way: [self.MyTextField setValue:[UIColor darkGrayColor] forKeyPath:@"_placeholderLabel.textColor"]; Use KVC to access/set UITextField’s protected ivar directly,...
Jan 4th