How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

I do this to get the code to compile in both 3.1.3 and 3.2: BOOL iPad = NO; #ifdef UI_USER_INTERFACE_IDIOM iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad); #endif if (iPad) { // iPad specific code here } else { // iPhone/iPod specific code here } I also wrote a quick blog post about it here: http://www.programbles.com/2010/04/03/compiling-conditional-code-in-universal-iphone-ipad-applications/

isEqual doesn’t always work for NSIndexPath? What can I use in its place?

As of iOS 5 you can just use isEqual: (see comments) Try [indexPath1 compare: indexPath2] == NSOrderedSame. Maybe you found a bug in NSIndexPath. If you try to create a new NSIndexPath with a path that already exists you should get that one instead. So isEqual: probably just compares the pointers and not the actual … Read more

Receive message “A signed resource has been added, modified, or deleted” when trying to debug an App on iPhone

I found a workaround for the bug. If you delete the .app file in build/Debug-iphoneos/ before building for the device, the app gets installed without errors. And there is a simple way to do that before every build. Make sure you have selected “Device” in the dropdown overview menu. In XCode go to Project > … Read more

UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?

I played with the previously offered solution but still had issues. Here’s what I came up with instead: – (void)keyboardWillShow:(NSNotification *)aNotification { [self moveTextViewForKeyboard:aNotification up:YES]; } – (void)keyboardWillHide:(NSNotification *)aNotification { [self moveTextViewForKeyboard:aNotification up:NO]; } – (void) moveTextViewForKeyboard:(NSNotification*)aNotification up: (BOOL) up{ NSDictionary* userInfo = [aNotification userInfo]; // Get animation info from userInfo NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)