Xcode freezes on startup while loading project

Check out this: (quoted from here) Restore sanity by not restoring Thanks to Lion’s Restore feature, all the windows you left open in a given application remain open when you relaunch it. That’s awesomely helpful in a Web browser or a text editor. In certain apps, however—particularly those where you rarely need to revisit the … Read more

Core Data’s NSPrivateQueueConcurrencyType and sharing objects between threads

When you use NSPrivateQueueConcurrencyType you need to do anything that touches that context or any object belonging to that context inside the -performBlock: method. Your code above is illegal since you’re passing those objects back to the main queue. The new API helps you in solving this, though: You create one context that’s associated with … Read more

How to properly format currency on ios

You probably want something like this (assuming currency is a float): NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle: NSNumberFormatterCurrencyStyle]; NSString *numberAsString = [numberFormatter stringFromNumber:[NSNumber numberWithFloat:currency]]; From your requirements to treat 52 as .52 you may need to divide by 100.0. The nice thing about this approach is that it will respect the current locale. … Read more

how to increase font size in UIWebView

I have 2 buttons – A- and A+ @interface NSUInteger textFontSize; – (IBAction)changeTextFontSize:(id)sender { switch ([sender tag]) { case 1: // A- textFontSize = (textFontSize > 50) ? textFontSize -5 : textFontSize; break; case 2: // A+ textFontSize = (textFontSize < 160) ? textFontSize +5 : textFontSize; break; } NSString *jsString = [[NSString alloc] initWithFormat:@”document.getElementsByTagName(‘body’)[0].style.webkitTextSizeAdjust=”%d%%””, … Read more