Tag: ios7

UIScrollView doesn't scroll after upgrading to iOS7 / xcode 5

I have an app which in xcode 4.5 and ios 6.1 worked perfectly fine when scrolling. However, after downloading xcode 5 and iOS 7 my scroll views does not work anymore.??? Here is my .h file: #import <UIKit/UIKit.h> @interface GrillretterViewController : UIViewController @property (strong, nonatomic) IBOutlet UIScrollView *grillretterScroller; @property (assign) CGPoint rememberContentOffset; @end And here […]

iOS7 – receipts not validating at sandbox – error 21002 (java.lang.IllegalArgumentException)

I’m converting an app from iOS6 to iOS7. Before I used the deprecated transactionReceipt method so now I’m trying the recommended methods to retrieve the receipt, and then encode in base 64: NSData *working = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]]; // Tried 64 or 76 chars/line and LF or CR line endings NSString *receipt = [working […]

iOS7 excessive navigationbar button padding

I’m experiencing excessive UIBarButtonItem padding/spacing when using the LeftBarItems and RightBarItems (see image below). The icons used on the UIBarButtonItems do not contain extra padding. So I would like to know what’s causing this?

iOS 7 – Keyboard animation

I’m trying to understand the new keyboard animation in iOS 7.0 on the iPhone 5 Simulator. I want to resize my UITableView when the keyboard appears, but I can’t get the right animation details. I’m using the information from the NSNotification object, when the keyboard appears or disappears. Here is my log: Move keyboard from […]

sizeWithFont method is deprecated. boundingRectWithSize returns an unexpected value

In iOS7, sizeWithFont is deprecated, so I am using boundingRectWithSize(which returns a CGRect value). My code: UIFont *fontText = [UIFont fontWithName:[AppHandlers zHandler].fontName size:16]; // you can use your font. CGSize maximumLabelSize = CGSizeMake(310, 9999); CGRect textRect = [myString boundingRectWithSize:maximumLabelSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:fontText} context:nil]; expectedLabelSize = CGSizeMake(textRect.size.width, textRect.size.height); In textRect, I’m getting a size greater than my […]

MKPolygon area calculation

I’m trying to make an area calculation category for MKPolygon. I found some JS code https://github.com/mapbox/geojson-area/blob/master/index.js#L1 with a link to the algorithm: http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409. It says: Here is my code, which gave a wrong result (thousands times more than actual): #define kEarthRadius 6378137 @implementation MKPolygon (AreaCalculation) – (double) area { double area = 0; NSArray *coords […]

iOS 7 bug or my bug in UIAlertView

I have got the following stack trace while my app crashes on tapping “OK” on a UIAlertView. Is it my fault or a iOS7 bug? I don’t know how to fix this. OS Version: iOS 7.0 (11A465) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 Triggered by Thread: 0 Thread 0 […]

Unable to add UITextField to UIAlertView on iOS7…works in iOS 6

The code below works on iOS6 (and before) but the UITextField does not display in iOS7…any ideas on how to get a UITextField to display in an UIAlterView in iOS7? UIAlertView* dialog = [[UIAlertView alloc] init]; [dialog setDelegate:self]; [dialog setTitle:@”Enter ESC Score”]; [dialog setMessage:@” “]; [dialog addButtonWithTitle:@”Cancel”]; [dialog addButtonWithTitle:@”OK”]; dialog.tag = 5; nameField = [[UITextField […]

Restore pre-iOS7 UINavigationController pushViewController animation

So. Just started transitioning my IOS code to IOS7, and ran into a bit of problem. I’ve got a UINavigationController, which has child ViewControllers and I’m using pushViewController to display the next views. To create a parallax animation with a set of images, if customized the UINavigationController to animate a set of UIImageViews and my […]

UITabBar not showing selected item images in ios 7

The icons show fine in ios 6 but not in ios 7. I’m setting the selected state in the viewController viewDidLoad method. When the user selects a tab bar item the image disappears. Here is my code: UITabBar *tabBar = self.tabBarController.tabBar; if ([UITabBar instancesRespondToSelector:@selector(setSelectedImageTintColor:)]) { [self.tabBarController.tabBar setSelectedImageTintColor:[UIColor whiteColor]]; } UITabBarItem *item0 = [tabBar.items objectAtIndex:0]; UITabBarItem […]