iPhone Static Framework
Problem with iPhone code sharing
As we all know Apple has not left developers opportunity to create frameworks for iPhone. However, there are a lot of situations when code has to be shared between different projects or even distributed to others developers.
Alternatives
There are a few approaches for the code sharing or distributing. Firstly, code can be shared/distributed as a source code. Although this approach is quite straightforward and XCode provides a good mechanism for including XCode project to another project, developers have to do some extra steps such as setup dependencies and path for headers. On the one hand it seems quite simple for the experienced developers, on the other it might be a problem for the new developers .
Second approach is to distribute code as a static library. This approach is well known and is used widely in Linux/Unix development thus a lot of developers are familiar with it. However, there are some disadvantages of using it in iPhone development which relate to dynamic nature of Objective-C. The problem is that static libraries are normally used for C/C++ code which has neither properties nor categories and so when, for example, Objective-C category is wrapped in static library a developer has explicitly to set additional linker options:
-ObjC
-all_load
If developer forgets to set the options mentioned above he will get runtime error “unrecognized selector sent to instance”
Static Framework
The most suitable alternative, in my opinion, is a ’static framework’. The idea behind is to force compiler to believe that it uses normal iPhone framework whereas shared libraries are substituted by static libraries. Thus if you have the code you want to share as a static library it is quite easy to transform it into a framework. Afterwords such framework can be added to a project without any extra efforts from the developer’s side.
How to create a Static framework
Since there is no option to build frameworks for iPhone in XCode I recommend using a static framework. To build it into XCode MacOS framework template should be used. Static framework has the same structure as a normal framework. Only a few extra steps have to be done:
link together static library for iPhone Simulator and iPhone Device
add file from the previous step to framework bundle
To make it easy we will write a shell script which does all the work. We will use a lipo utility which is distributed with XCode installation. This utility allows to link a few libraries into one file. Afterwords this file will be copied to the framework bundle and appropriate links will be created.
FRAMEWORK=”${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework”
lipo \”${BUILD_DIR}/${CONFIGURATION}-iphoneos/libDev.a” “${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib Sim.a” -create -output “${FRAMEWORK}/Versions/Current/${PRODUCT_NAME}”cd “${FRAMEWORK}” && ln -sf “Versions/Current/${PRODUCT_NAME}” ./
This script should be added into a project as a build phase script through the project menu. As a result we get a static framework containing code which now can be easily shared.
LINKS
May 10th, 2010 - Posted by Paul Jarratt in api, developers, iPhone | | 0 Comments
PERL library updated
Short post for those of us using Perl. Perl library, found at http://developers.cloudmade.com/projects/show/perl-api and http://search.cpan.org/~gdm/Geo-Cloudmade-0.2/ has been updated by its author and maintainer Dmytro Gorbunov. Great job, Dmytro!
The latest version mirrors the geocoding API V2 by exposing two simple methods for forward and reverse geocoding, along with one method to access tiles, and yet another to access routing API. Clear and concise – just the way Perl is. Check out examples at http://search.cpan.org/~gdm/Geo-Cloudmade-0.2/lib/Geo/Cloudmade.pm.
November 24th, 2009 - Posted by in api, developers | | 1 Comments
Tesco’s troubles and reverse geocoding
Talk about coincidence. Just as I was about to share a couple of numbers from our geocoding traffic report, someone sent me a link to an interesting read by Nick Lansley of Tesco. In a nutshell, he, as well as dozens (hundreds?) of other iPhone developers have suddenly found themselves cut off from Google geocoding. Read more here.
Back to our latest traffic report. I thought it was interesting enough to share some of it with everyone. While it is expected that all of our products show usage growth over time, the usage of geocoding has simply skyrocketed lately. According to our traffic report, the number of geocoding requests has increased more than ten-fold over the last four weeks, without any sign that the trend is changing. I am also quite impressed by adoption of version 2 of our geocoding API. Given that most requests come from mobile applications that have necessarily longer update cycles, the new API’s 30% share of traffic in only three weeks is really a large number. The most popular request type? Reverse geocoding.
In the meantime, we’ve been working on better support for EU-style addressing, which will be available real soon. Also in the works, fast and accurate US addressing which will be brought online by the end of next month. More to come…
October 30th, 2009 - Posted by in api, cloudmade, iPhone, products | | 2 Comments
New geocoding engine delivers results up to 24 times faster
While no one was watching, we deployed the latest version of our geocoding engine. The key objective for this release has been performance and stability, and I am sure it is immediately noticeable. Benchmarking based on actual user queries have shown that it is up to 24 times faster than the previous implementation for certain classes of requests. Even for simple, one-word queries, it is up to three times faster.
Along with the new engine, we are introducing new Geocoding API V2. In an effort to simplify usage, we have reduced the number of methods from eleven to only one, without sacrificing a single bit of its flexibility. Take a look here to read about the new (easy) query syntax. The old API? It, too, uses the new engine to deliver faster results, but we do encourage everyone to switch to the new API as soon as you have a chance to.
In the meantime, we are already working on the next release. The main focus will be relevancy and better parsing of freeform queries. Stay tuned!
October 8th, 2009 - Posted by in api, cloudmade, iPhone, tools | | 2 Comments
Your Future is Customized – State of the Map Presentation from CloudMade
In July this year, 250 of the leading lights in community mapping and geo application development gathered in Amsterdam for the annual OpenStreetMap Foundation conference The State of the Map. Video and audio recordings form the three day conference are being processed one by one by a dedicated team of volunteers who recently published the video of Nick Black’s talk: “Your Future is Customized”.
The talk asks why most current users of geodata experience maps through one of two ways: in car sat navs, or online mapping portals and looks towards a future of app stores, specialized map data and geo applications that match the exact needs of consumers.
Enable your applications with CloudMade – Nick Black (CloudMade) from State of the Map 2009 on Vimeo.
Follow along with the slides from the presentation:
August 28th, 2009 - Posted by in api, cloudmade, developers, geodata, openstreetmap, products, tools | | 1 Comments
Fly Through Berlin
CloudMade partners, Cartotype have produced this nice animation that shows a fly-through of Berlin. Cartotype produce a range of libraries that render maps across different mobile platforms:
Cartotype have been experimenting with CloudMade’s Vector Server which can stream map data to any connected device where it can be rendered on the fly. There’s a lot of new features planned for the vector server, including multiple outputs formats (XML, JSON, OSM) and a fully featured API that will let you select which parts of the map data are returned to the client. You can see all of the feature requests here.
If you like what you see from Cartotype, you can hear them talk at the State of the Map conference which is being held from the 10th – 12th July 2009 in Amsterdam. Click here for more details.
June 15th, 2009 - Posted by Nick Black in api, cartography, cloudmade, developers, geodata, news, products | | 0 Comments
How To Get Forward Geocoding in iPhone MapKit
The CoreLocation and MapKit sessions at WWDC yesterday gave an insight to some of the powerful technology that the iPhone OS 3.0 and iPhone 3G S will bring to application developers. The new compass and enhanced accelerometer support that the combination of new hardware and software bring were a big hit with the WWDC crowd. The incomplete feature sets around MapKit were less of a hit.
MapKit seeks to be a very well implemented iPhone mapping library, that lets developers add Google maps to their iPhone applications as well as perform reverse geocoding. Sadly for iPhone developers, the fun stops with reverse geocoding. Forward geocoding (the process of turning an address into a latitude and longitude) is not available in MapKit. The reasons for this lie in complex licensing agreements between Apple, Google and TomTom (who own all of the map data that Google and Apple use). CloudMade will help you avoid the complexity.
iPhone Developers at WWDC were urged to use external geocoding services by the iPhone engineering team. CloudMade’s geocoding service fits the bill perfectly. iPhone developers can integrate CloudMade’s geocoding web-services directly into their MapKit applications, without worrying about breaking and terms of service. The geocoding web service looks like this:
http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/
geocoding/find/moscone center west.html
Lets take a closer look at the URL:
http://geocoding.cloudmade.com/ – the base URL
BC9A493B41014CAABB98F0471D759707/ – your API key, available here
geocoding/find – the “find” method, more docs here
moscone center west – the text string to search for
.html choose from HTML or JSON output.
Click here to see the result.
You can find our more about CloudMade’s geocoding services here.
June 12th, 2009 - Posted by Nick Black in REST, Uncategorized, api, developers, iPhone, products | | 8 Comments
iPhone Developer VIP Party – June 10th 9.30pm San Francisco
Tonight CloudMade is excited to sponsor the iPhone Developer VIP Party at Swig bar in San Francisco. Doors open at 9.30 and we expect a full house!
CloudMade has been active at Apple’s World Wide Developer Conference this week, engaging with iPhone developers who are creating the next great mapping and location-aware applications for the iPhone and iPod Touch. Tonight we’re looking forward to talking with many of you one-on-one to discuss your vision on the future of location-aware apps. We also want to find out what features you’d like to see on the iPhone, web and other mobile platforms. Over a Maptini, of course!
Starting with our rich, crowd-sourced maps, CloudMade gives iPhone developers an easier way to build more immersive mapping applications than Apple’s MapKit. Developers will find our suite of iPhone supported Libraries gives you easy access to CloudMade services while supporting a number of unique features like vector data and MapSafe location management service. CloudMade’s non-restrictive licensing even allows for advanced services such as routing, geocoding or tracking functionality – without having to call a lawyer or break the bank.
So if you’re a developer looking for better ways to incorporate maps and location into your app, sign up for a API key at CloudMade’s Developer Zone and get started today. Adding customized CloudMade maps will delight your users and make your app stand-out from the crowd!
For mapping success on the iPhone and iPod Touch, just add:
- Crowd-Sourced Maps
- CloudMade Geo APIs
- Your Cool Application
June 10th, 2009 - Posted by Cragg Nilson in Uncategorized, api, cloudmade, developers, events, maps, openstreetmap, tools | | 1 Comments
Three New Style Editor Basemaps
Nick blogged previously regarding three of our signature map styles – “Pale Dawn“, “Midnight Commander” and “Fresh” – that we launched along with our Developer Programme last month. Today we’re pleased to announce that all three styles are now available for customization in our Style Editor.
Our Style Editor lets you tweak, change and configure the cartography of our maps to suit your needs. Perhaps you, as I do, love the Pale Dawn style as originally created by Stamen Design, but want to see if it looks better with a bit more emphasis on parks and public transport? So I fired up the Style Editor, and a few clicks later had this attempt – “Fair Sunrise”:

We’re always interested in what creative things you can make with our tools, so if you’ve made a style that you’re proud of please share a link in our comments. I’ll let you decide for yourself whether you think “Fair Sunrise” is an improvement!
March 26th, 2009 - Posted by Andy Allan in api, cloudmade, developers, products, tools | | 2 Comments
Bring CloudMade Maps to Your iPhone Application
If you’re looking for maps to add to your iPhone application you’re in the right place.
CloudMade’s iPhone Maps Library is an open source library that gives application developers everything you need to create great navigation applications on the iPhone. You don’t need to wait any longer to add turn-by-turn navigation for vehicles, pedestrians and cyclists.
The iPhone Maps Library is part of a suite of CloudMade APIs and tools that give developers access to regularly updated crowd-sourced maps. Give your users a unique experience – take control of the look and feel of your application and create richer, more interactive experiences.
The iPhone Maps Library integrates with other CloudMade tools including Style Editor, a web based tool that gives access to a variety of professionally designed map styles, which you can customize to fit your application’s specific purpose.
The are several applications in the App Store that already use CloudMade’s maps, with many more in the pipline
Trails – Relive your greatest biking, hiking and walking
moments and share them with your friends; Trails lets
you view your activities on a choice of different
CloudMade maps.
The main features of CloudMade’s Map Library are:
- Quick development time with easy to follow examples
- Mapping framework & controls
- Custom tile serving
- Geocoding
- Routing service via vehicle, pedestrian and cycle
- Integration with iPhone Location API
WorldView Live – If the view out of your window isn’t
exotic enough WorldView Live is the app for you; This
great application lets you view live webcams from all
around the world.
CloudMade’s iPhone Maps Library provides developers with a real alternative to standard mapping on the iPhone. This, combined with the ability to let consumers bring their custom maps across with them – across desktop, mobile and web – make for a compelling end user experience.
March 19th, 2009 - Posted by Cragg Nilson in api, clients, cloudmade, developers, events, ruby | | 9 Comments



