ios

Why does the Xcode Allocations Instrument translate my project’s subclasses as memory allocations instead of object names in iOS Simulator?

Just out of curiosity & the fact that I haven’t found any good info on the subject. There are related queries on how to workaround this behavior (XCODE 6 Allocation Instruments don’t show own class name), but I’m just curious if someone knows enough about the program to help understand why this is happening, if this is not just simply…
Read more

CIPerspectiveCorrection filter applied to image from photo roll on iphone 6 and 6+ are flipped and scale is wrong

I’m using a CIPerspectiveCorrection filter to crop images in an ios 8 app. This has been working perfectly on my iphone 5S and even on iphone 6 and 6+ until I introduced an upload from photo roll feature. I’m passing an image object to my cropViewController thats coming from my imagePicker:DidFinishPickingImage delegate meathod. This displays fine in my cropViewController, but…
Read more

Swift: create programmatically UIViewController from xib

I’m approaching to swift in this days and I’ve a question. What if I have to create programmatically a new UIViewController? Easy with an empty/new view controller: var controller: UIViewController = UIViewController() controller.view.backgroundColor = UIColor.whiteColor() self.presentViewController(controller, animated: true, completion: nil) Now, I have a xib file that I would like to load on the controller: var controller: UIViewController = UIViewController(nibName:…
Read more

How do I change the initial tab bar selection in swift?

In trying to find a solution I came across this answer: [ http://stackoverflow.com/a/10441200/4856759 ] It seems to accomplish what I want it to, but in objective C: UITabBarController *tabBar = (UITabBarController *)self.window.rootViewController; tabBar.selectedIndex = 0; How do I do this in swift? My first attempt returns an error cannot convert the expression’s type ‘$T4??’ to type ‘UITabBarController’ var tabBar: UITabBarController…
Read more

Implement Pull to Refresh feature in Core Plot

Hi I want to implement the pull to refresh feature in CP so that I can reload data by using this gesture. I did some research that the apple built in gesture features rely on tableview or scrollview. Is it possible to make use of the Gesture Recognizers that have been built in the Core Plot library? Or is there…
Read more

checking for nil and getting ‘unexpectedly found nil while unwrapping an Optional value’

I’m checking if an optional value is nil before unwrapping it //check if it’s nil if voteStatus == nil { cell.hideButtons(); } else { cell.setStatus(voteStatus!); //crash here, why? if voteStatus == 1 { cell.showButtons(); } else { cell.hideButtons(); } } However, it crashes at this line: cell.setStatus(voteStatus!); with error: unexpectedly found nil while unwrapping an Optional value Doesn’t make any…
Read more

Occasional Crash Setting UILabel Text – NSString substringWithRange

I have noticed a few crash reports from the App store recently. However, I can’t recreate the error using the simulator or on my iPhone 5. The App crashes when the user tries to display a list of recordings. The line which fails is where the UILabel text “recordingName.text” is set to a substring of the filename string. The filename…
Read more