How to support both iPad and iPhone retina graphics in universal apps

I just created a test app and tested. So for devices without retina: ImageName.png – For iPhone/iPod ImageName~ipad.png — For iPad For devices with retina display: ImageName@2x.png – For iPhone/iPod ImageName@2x~ipad.png — For iPad And you can still use @2x if your iPhone high resolution image and iPad high resolution image have the same size. … Read more

Unable to simultaneously satisfy constraints – No constraints in place

Let’s look at these one by one. “<NSAutoresizingMaskLayoutConstraint:0x84543d0 h=–& v=–& V:[UIView:0xa330270(768)]>” This is saying view 0xa330270 (A) must be 768 points high. “<NSLayoutConstraint:0xa338350 V:[UIView:0xa331260]-(-1)-| (Names: ‘|’:UIView:0xa330270 )>” This is saying view 0xa331260 (B)’s bottom edge must be a gap of -1 from the bottom of A, which is it’s superview. “<NSLayoutConstraint:0xa338390 V:|-(841)-[UIView:0xa331260] (Names: ‘|’:UIView:0xa330270 )>” … Read more

get current date from [NSDate date] but set the time to 10:00 am

As with all date manipulation you have to use NSDateComponents and NSCalendar NSDate *now = [NSDate date]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSCalendarIdentifierGregorian]; NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:now]; [components setHour:10]; NSDate *today10am = [calendar dateFromComponents:components]; in iOS8 Apple introduced a convenience method that saves a few lines of code: NSDate *d = [calendar … Read more

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