UITableview: How to Disable Selection for Some Rows but Not Others

You just have to put this code into cellForRowAtIndexPath To disable the cell’s selection property: (while tapping the cell) cell.selectionStyle = UITableViewCellSelectionStyleNone; To enable being able to select (tap) the cell: (tapping the cell) // Default style cell.selectionStyle = UITableViewCellSelectionStyleBlue; // Gray style cell.selectionStyle = UITableViewCellSelectionStyleGray; Note that a cell with selectionStyle = UITableViewCellSelectionStyleNone; will … Read more

Color Tint UIButton Image

As of iOS 7, there is a new method on UIImage to specify the rendering mode. Using the rendering mode UIImageRenderingModeAlwaysTemplate will allow the image color to be controlled by the button’s tint color. Objective-C UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *image = [[UIImage imageNamed:@”image_name”] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; [button setImage:image forState:UIControlStateNormal]; button.tintColor = [UIColor redColor]; Swift let … Read more

Programmatically get own phone number in iOS

At the risk of getting negative marks, I want to suggest that the highest ranking solution (currently the first response) violates the latest SDK Agreement as of Nov 5, 2009. Our application was just rejected for using it. Here’s the response from Apple: “For security reasons, iPhone OS restricts an application (including its preferences and … Read more

iPhone App Icons – Exact Radius?

You can make four icons (as of today) for your app and they can all have a different look – not necessarily based on the 512×512 image. corner radius for the 512×512 icon = 80 (iTunesArtwork) corner radius for the 1024×1024 icon = 180 (iTunesArtwork Retina) corner radius for the 57×57 icon = 9 (iPhone/iPod … Read more

iOS UIImagePickerController result image orientation after upload

A UIImage has a property imageOrientation, which instructs the UIImageView and other UIImage consumers to rotate the raw image data. There’s a good chance that this flag is being saved to the exif data in the uploaded jpeg image, but the program you use to view it is not honoring that flag. To rotate the … Read more

What are best practices that you use when writing Objective-C and Cocoa? [closed]

There are a few things I have started to do that I do not think are standard: 1) With the advent of properties, I no longer use “_” to prefix “private” class variables. After all, if a variable can be accessed by other classes shouldn’t there be a property for it? I always disliked the … Read more

Proper way to renew distribution certificate for iOS

Your live apps will not be taken down. Nothing will happen to anything that is live in the app store. Once they formally expire, the only thing that will be impacted is your ability to sign code (and thus make new builds and provide updates). Regarding your distribution certificate, once it expires, it simply disappears … Read more

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