Design for Facebook authentication in an iOS app that also accesses a secured web service. Cocoa - Constants in Objective C. On SSL Pinning for Cocoa [Touch] — Secure Mac Programming. Moxie Marlinspike, recently-acquired security boffin at Twitter, blogged about SSL pinning. The summary is that relying on the CA trust model to validate SSL certificates introduces some risk into using an app – there are hundreds of trusted roots in an operating system like iOS, and you don’t necessarily want to trust all (or even any) of the keyholders.
Where you’re connecting to a specific server under your control, you don’t need anyone else to tell you the server’s identity: you know what server you need to use, you should just look for its certificate. Then it doesn’t matter if someone compromises any CA; you’re not trusting the CAs any more. He calls this SSL pinning, and it’s something I’ve recommended to Fuzzy Aliens clients over the past year. I thought it’d be good to dig into how you do SSL pinning on Mac OS X and iOS. The first thing you need to do is to tell Foundation not to evaluate the server certificate itself, but to pass the certificate to you for checking. Changing the text color of a grouped UITableView’s section header « Blog. The concept was pretty simple. To change the textColor of the section headerView of a tableView, you just implement the following optional delegate method in your table view’s delegate: - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section In that method, all you have to do is create a UIView with a UILabel and the text you want.
However, recreating the look and feel of the default grouped UITableView took a lot of tweaking. Here’s the full method after getting everything pretty darn close to the default apple approach: ipad development, iphone development, objective c This entry was posted on September 8, 2010, 11:58 am and is filed under Development. Resize a UIImage the right way — Trevor’s Bike Shed. When deadlines loom, even skilled and experienced programmers can get a little sloppy. The pressure to ship may cause them to cut corners and look for a quick and easy solution, even if that solution is sure to cause trouble later on. Eventually, their coding style devolves into copy and paste programming, a lamentable tactic that involves cherry-picking snippets of code from a past project and putting them to use in the current one.
Of course, the proper solution is to factor out the code into some kind of reusable library, but due to time constraints, it’s simply duplicated wherever it’s needed. Any bugs in the original code have now spread to a dozen different places in a dozen different projects. It’s an algorithm for chaos. Yet in the world of iPhone applications, copy and paste programming seems to be disturbingly common. This situation has transformed more than a few iPhone programmers into copy and paste programmers. Background Resizing a photo to a new UIImageThis is crazy. NSPredicate predicateWithBlock & bindings - wannabegeek. Since Mac 10.6 and iOS 4.0 NSPredicate has supported a method predicateWithBlock. I looks to be a pretty commonly used method, but I could find no examples and only limited documentation on the bindings dictionary argument to the block method. + (NSPredicate *)predicateWithBlock:(BOOL (^)(id evaluatedObject, NSDictionary *bindings))block If you wanted to just to a slightly more complex search than predicateWithFormat can provide.
You can just use the block without worrying about the bindings argument. e.g. NSArray *array = ............; BOOL expectedValue = YES; result = [array filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary * bindings) { return (evaluatedObject.enabled == expectedValue); }]; Since this predicate is created and evaluated immediately the block also has access to local variables (e.g. expectedValue). Now if we wanted to create a template predicate we can do this with a block so we can evaluate against an object later. PrEV | UITableViewCell from a NIB file. Feb 12, 2009 by Bill Dudney I have had several questions recently on how to use Interface Builder to create table view cells.
And more specifically how to add stuff like controls to the table view cells and have them invoke methods on a controller object that can mediate the connection to the model. The Settings application's 'Sounds' configuration section has an example of what I'm heading towards. Almost every cell in this table view has a control in it. Here is a screen shot of my exceedingly ugly and non HIG conformant application that I build to illustrate the idea. The Model that underlies this application is just a string holder, very simple. If you'd like to follow along you can get the code here or you can build it yourself starting from the 'Navigation Based Application' template. Let's start with the model, remember that the model is the underlying logic of your application captured in classes. Not a lot here, and the implementation file is equally simple; Apple-tab-span. Showing a "Loading..." message over the iPhone keyboard.
Introduction "Loading... " messages When waiting for data loaded from the internet, many iPhone applications use a mostly black, semi-transparent view to block the display. Most use a basic "spinner" (UIActivityIndicatorView) to reassure the user that the application is still running, frequently accompanied by "Loading... " text. Despite the prevalence of this type of loading message, it is not a standard control and must be constructed manually. Finding the keyboard Apple give no methods to locate the keyboard or even the current first responder in an iPhone application. The sample application The sample LoadingView application in this post can display the following two types of loading window: A full-window loading message and a keyboard-only loading message.
The sample application doesn't actually load anything. Displaying a loading view The behaviors in my loading view include: All that's required to make it look semi-transparent is a custom drawing method. Round Rects are Everywhere! Conclusion. Open Source iPhone App Store Apps | iPhone and iPad SDK Developm. Welcome to the sixth iteration of the open source iPhone and iPad apps list. A For those that have seen similar listings on other sites using the exact wordings, and links below welcome to the source for the original list. Also included are some open source iPad apps, and universal open source iOS apps. It can be tough to learn how to develop, especially when it comes to finding complete examples. That’s why I put this list together. Each of these open source iPhone apps is not just open source, but has been in the app store, and all but one are in there right now.
So if you’re looking for an example of some real apps here they are. Last Update: 4/11/2014 Before going on to the apps, please share these open source iOS apps with your Twitter followers by clicking here. Here is the open source iphone app list in alphabetical order: 1. 2048 - A SpriteKit based version of the game 2048.. 2. 3. 4. 5. 6. audioGraph - An audio processing graph demonstration app. 7. 8. 9. 10. 11. 12. 13. 14. 15. Connect app to Facebook. Parsing URL. The scheme name (or protocol) of a URL is the first part of a URL - e.g. For web pages, the scheme is usually http (or https). The iPhone supports these URL schemes: * Web links that point to are redirected to the Maps app. * Web links that point to are redirected to the YouTube app. * iTunes store links ( are sent to the iTunes (or App store) app. iPhone apps can also specify their own custom URL scheme (for example, To transfer data from lite to paid versions of your app To allow other apps (or even web pages) to call your app (and send data to it) To handle callbacks for custom authentication (such as OAuth) and third party API's Implementing a Custom URL Scheme Defining your app's custom URL scheme is all done in the Info.plist file.
After you've set the URL identifier, select that line and click the "+" sign again, and add a new item for URL Schemes. Handling Custom URL Calls. The Most Useful Objective-C Code I’ve Ever Written « Vincent Gable’s Blog. Actually, it’s the most useful code I’ve extended; credit for the core idea goes to Dave Dribin with his Handy NSString Conversion Macro. LOG_EXPR(x) is a macro that prints out x, no matter what type x is, without having to worry about format-strings (and related crashes from eg. printing a C-string the same way as an NSString). It works on Mac OS X and iOS. Here are some examples, LOG_EXPR(self.window.screen); self.window.screen = <UIScreen: 0x6d20780; bounds = {{0, 0}, {320, 480}}; mode = <UIScreenMode: 0x6d20c50; size = 320.000000 x 480.000000>> LOG_EXPR(self.tabBarController.viewControllers); self.tabBarController.viewControllers = ( “<UINavigationController: 0xcd02e00>”, “<SavingsViewController: 0xcd05c40>”, “<SettingsViewController: 0xcd05e90>” ) Pretty straightforward, really.
LOG_EXPR(self.window.windowLevel); self.window.windowLevel = 0.000000 LOG_EXPR(self.window.frame.size); self.window.frame.size = {320, 480} Give it a try. How It Works The Macro, Line By Line Limitations Arrays __func__ Call apps from url. Many app-related tasks depend on the type of app you are trying to create. This chapter shows you how to implement some of the common behaviors found in iOS apps. Configuring Your App to Support iPhone 5 Apps linked against iOS 6 and later should be prepared to support the larger screen size of iPhone 5 and iPod touch (5th generation) devices. To support the larger screen in your code properly, never make assumptions about the current device’s screen size. Instead, always retrieve the size of a screen, window, or view dynamically and use that size information to configure your interface.
To let the system know that your app supports the iPhone 5 screen size, include a properly named launch image in your app’s bundle. For more information about specifying the launch images for your app, see “App Launch (Default) Images.” Creating a Universal App A universal app is a single app that is optimized for iPhone, iPod touch, and iPad devices.
Updating Your Info.plist Settings.