Tag: iphone

Core Data and Core Location

I have a Core Data database with latitude and longitude properties. Is there a way to use Core Location’s getDistanceFrom: method to find the five nearest locations to a CLLocation obtained from the GPS? Do I have to load all the objects using Core Data and parse through them, using getDistanceFrom: on each one or […]

Using MD5 hash on a string in cocoa?

Possible Duplicate: MD5 algorithm in Objective C I need to hash a string using the MD5 technique in cocoa. Any frameworks that are used must be able to be accessed on the iphone. please provide code if possible.

UIBezierPath Subtract Path

By using [UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:], I am able to create a rounded view, such as this: How could I subtract another path from this one (or some other way), to create a path like this: Is there any way I can do something like this? Pseudocode: UIBezierPath *bigMaskPath = [UIBezierPath bezierPathWithRoundedRect:bigView.bounds byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight) cornerRadii:CGSizeMake(18, 18)]; UIBezierPath *smallMaskPath […]

iPhone: Setting Navigation Bar Title

Hey all. I’m still pretty new to iPhone development, and I’m having a bit of trouble figuring out how to change the title of my Navigation Bar. On another question on this site somebody recommended using : viewController.title = @”title text”; but that isn’t working for me…Do I need to add a UINavigationController to accomplish […]

How to decode the Google Directions API polylines field into lat long points in objective-C for iPhone?

I want to draw routes on a map corresponding to directions JSON which I am getting through the Google Directions API: http://code.google.com/apis/maps/documentation/directions/ I have figured out how to extract the latitude and longitude from the steps field, however this doesn’t follow curvy roads very well. I think what I need is to decode the polyline […]

Getting the visible rect of an UIScrollView's content

How can I go about finding out the rect (CGRect) of the content of a displayed view that is actually visible on screen. myScrollView.bounds The code above works when there’s no zooming, but as soon as you allow zooming, it breaks at zoom scales other than 1. To clarify, I want a CGRect that contains […]

Adding Images to UIActionSheet buttons as in UIDocumentInteractionController

Is it possible to add an image to the buttons of the UIActionSheet as seen in UIDocumentInteractionController? If so, please let me know how it is done.

How can I delay a method call for 1 second?

Is there an easy way delay a method call for 1 second? I have a UIImageView that reacts on a touch event. When the touch is detected, some animations happen in the app. After one second, I want to call another method. In this case, I can’t use the animationDidStop selector.

What's the difference between using CGFloat and float?

I tend to use CGFloat all over the place, but I wonder if I get a senseless “performance hit” with this. CGFloat seems to be something “heavier” than float, right? At which points should I use CGFloat, and what makes really the difference?

iPhone SDK Internet connection detection

I’m working on an iPhone application that makes a few calls to web services. I posted this application on the Apple store but it got rejected (and rightly so) since there was no error message displayed to the user if no Internet connection is available. Since obviously the application would not work without it. So […]