Search Results for: objective+C
Best Resources In iOS Development – January 23, 2012
Welcome back to another edition of the best resources in iOS development listing the last two weeks of resources on this site in order of popularity.
This week’s resources feature a library for making beautiful modal panels within your iOS apps very quickly, a guide on disabling ARC on specific files, a Path 2 inspired UITableView replacement, and more.
Here are the resources:
1. Open Source: Library For Elegantly Styled Modal Panels In iOS Apps - A great library for easily customizable modal panels that look great.
2. Easily Get Non-ARC Enabled Open Source Libraries Working In ARC Enabled Projects - A quick tutorial showing how to disable arc on specific files within Xcode.
3. Open Source: UITableview Replacement With Information Overlays – Inspired By The Path 2 App - A nicely done UITableView replacement that adds information overlays while scrolling.
4. Tool: SOAP Based Web Services Made Easy On The iOS Platform - A web service that automatically takes your wsdl definition for a SOAP web service, and turns it into a working Xcode project.
5. Handy Cheat Sheet For Using Objective-C Blocks (Closures) - A nice cheat sheet to have handy if you are still learning how to use Objective-C blocks.
6. iBooks Author App: Quick Summary Of Everything You Need To Know! - A quick feature summary of Apple’s new iBooks Author app.
7. Open Source: Library For Easy iCloud Image And Document Transfers With A Blocks Based Syntax - A library providing a very simple and clean syntax for easy image and document uploading and downloading from iCloud.
8. Open Source: Library For Creating Framed, Shadowed, Stacked Images Automatically For A Real Photo Look - A library that uses core graphics to make images look like real photos.
9. Tool: Full Javascript Debugger For Phonegap Apps And Web Pages - A very nice tool providing the full javascript debugger within iOS simulator.
10. Open Source Apps List: Hacker News Client, iPhone Theft Tracker, Barcode Scanner And More Added - Feature covering some new additions to the open source iOS apps list.
11. Example Source Code: A Cocos2D Color Picker Extension Designed Specifically For The iPad - A great color picker extension for use in Cocos2D apps built for the iPad and touch interaction.
12. Open Source: An OpenGL ES Powered Game Engine Module For Appcelerator Titanium Mobile - A new module for Appcelerator titanium created specifically for game graphics.
13. Open Source iOS Control: UILabel Replacement With Individually Clickable Words - A handy library providing a UILabel replacement with selectable words.
Thanks for reading, please bookmark and share this post!
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Open Source: An OpenGL ES Powered Game Engine Module For Appcelerator Titanium Mobile
It’s been awhile since I mentioned anything about Appcelerator’s Titanium Mobile when I wrote about some available Titanium Mobile OpenGL ES and augmented reality modules.
That being said I do see quite a bit of searches on this site for Titanium Mobile related content so when I received a submission earlier about an OpenGL ES Powered game engine module I thought it would be worth sharing for any of the Titanium enthusiasts.
The module is QuickTiGame2D (iOS only) uses OpenGL ES and enables animation and spritesheet support – it appears to be made by the same developers who created the previously mentioned Objective-C based emo-framework iOS game engine that uses the Squirrel scripting language.
You can find the code repository for the QuickTiGame2D module here.
Included are some great looking game examples to set you on your way.
Thanks to Yoshifumi for the submission.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Easily Get Non-ARC Enabled Open Source Libraries Working In ARC Enabled Projects
The topic of this post is one that I’m sure many developers will know about especially since it is a footnote in several of the tutorials on the ARC tutorial and guide page on this site.
I’ve received so many inquiries about how to get open source libraries mentioned on this site and it’s surprising how many don’t know how to implement the -fno-objc-arc flag for using non-ARC enabled code within ARC enabled projects.
If you don’t know how to do this working with many of the open source projects on this site can be a living hell – so here’s the easy way to get nearly all of those Non-ARC enabled libraries working within your ARC enabled projects.
So here are two scenario’s you will likely run into when mixing ARC enabled and non ARC enabled code and how to solve them easily in Xcode 4.
Scenario 1 – You have non-ARC project that you want to refactor to enable ARC (using XCode’s refactoring feature), but there is existing code that you do not want to convert.
Here’s how to solve this, when you do the refactoring deselect the files that you don’t want to convert to arc, and Xcode will automatically add the -fno-objc-arc flag to those files.
1. Choose Edit->Refactor->Convert to Objective-C ARC in the Xcode menu.
2. On the Select Targets To Convert screen select your targets, then click the little arrow beside the target name to expand the list of files.
3. Highlight the files that you do not want to convert then right click (or ctrl-click) and select uncheck-all to deselect all the files you want to convert to ARC. Then proceed as usual with the refactoring.
You can see this in the screenshot below where this has already been done with Cocos2D (btw, this is the easy way to get the Cocos2D template projects working with ARC):
Scenario 2 – You already have a project using ARC and want to add in some non-ARC enabled code, or you want to refactor the project yourself and don’t want to use ARC with some of the code.
I’ve seen this come up all over the internet in answers, and people asking where to add the -fno-objc-arc flag so here’s how it’s done.
1. Bring up the build phases tab for the appropriate target.arc1
2. Change the compiler flags for the specific code files that you do not want to enable ARC for to -fno-obj-arc (simply clicking on the compiler flags section beside the file, and enter -fno-objc-arc).
The flag will show up beside the file like in this screenshot if done correctly:
Continue as normal – the compiler now knows not to use ARC with the files that you flagged.
Conclusion
I can’t verify that it works in every case as there are some libraries with things such as embedded projects that can mess things up, but in my opinion it’s good to try the easy way first – and I haven’t seen it not work with any of the newer open source libraries I’ve mentioned on this site in the last few months.
You might want to look at this template that allows you to create universal frameworks easily if you run into issues with the -fno-objc-arc flag and link to those projects as frameworks.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Handy Cheat Sheet For Using Objective-C Blocks (Closures)
Objective-C blocks (closures) are something that I’ve mentioned in the past several times, most recently in this post about this massive open source collection of Objective-C blocks extensions, and another about a great guide on how to easily enable asynchronous UITableViewCell’s with blocks and Grand Central Dispatch.
It has been over a year since blocks were added to the iOS SDK, but still I see many searches on this site looking for beginner tutorials and guides on using blocks. So if you’re still trying to understand blocks you’re not alone, and I’ve found a great reference resource for you.
The resource is a cheat sheet by Yannick Loriot describing how to create, declare, call, copy blocks, and more all on a single printable page with some nice examples.
You can find the cheat sheet along with a nice summary on using blocks on Yannick’s site here.
A very handy reference to have if you are still trying to understand the syntax of Objective-C blocks.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Tool: SOAP Based Web Services Made Easy On The iOS Platform
In the past I’ve written quite about some of the great projects for consuming REST based web services on iOS devices such as MKNetworkKit, AFNetworking, and RestKit.
On the weekend I received a question from a developer trying to work with a SOAP based web service asking about up to date available resources for iOS and Objective-C.
I haven’t written much about SOAP based web services, but if you have no choice other than to work with a SOAP based service directly within your apps here are a few choices.
An Easy Objective-C Project Generation Tool Using WSDL Files
The easiest way to go is to use a tool known as SudzC by Jason Kichline.
What SudzC allows you to do is upload a WSDL file for the SOAP based service, and it will automatically generate a working Xcode example project (complete with comments and document) including other source files for using the web service such as those for LibXML, and Jason’s own code for working with a SOAP based service.
Recently SudzC has been recently updated for the iOS 5 SDK and can now generate projects with support for ARC.
You can create the projects right on the SudzC website here.
SudzC is open source, and you can find the Github repo here.
An Example Project On Consuming Web Services
You can learn quite a bit looking through the generated project from SudzC, but you may also want to take a look at Adrian Kosmaczewski’s demonstration project written in Objective-C on consuming web services from an iOS application here.
A C++ Library
If you decide that you want to go the library route, one library that is recommended to those asking about consuming a SOAP based web service on the iOS paltform is Gsoap. I can’t understand why you’d want to go this route unless you are looking for a solution that would be similar across different platforms.
Hopefully this helps those working with a SOAP based web service.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Tutorials And Examples: Creating PDFs On iOS Using Quartz, UIKit, And libHaru
I’ve talked about using PDF files mentioned some open source libraries for easily turning PDFs into eBook apps, and a short tutorial on using the QLPreviewController for document previewing.
What I haven’t said much about is creating PDFs – this is mainly because Apple has created some pretty extensive documentation on creating PDFs.
The reason why I’m mentioning different approaches here is because none of them are perfect, and you’ll need to test them out and see which one works best in your app and adjust from there.
Creating PDFs With The iOS SDK Using Quartz
If you do decide that you want to create PDFs using the iOS SDK Tope Abayomi (who is from the App design vault which btw is giving ManiacDev.Com readers two free app themes in this giveaway ending in a few days) has created a very straightforward tutorial on how to do so using Quartz.
If you’re struggling through Apple’s documentation on how to do this I highly suggest checking it out.
You can find the tutorial in two parts: Part 1, Part 2
In theory you can do just about anything with PDFs using Quartz (see Apple’s Quartz PDF documentation), but as you can see from the comment thread on Tope’s tutorial using Quartz for pdf generation is not without its issues.
Creating PDFs With The iOS SDK Using UIKit
The UIKit provides some libraries for creating PDFs that are somewhat easier to use. While you don’t get all the low-level functionality available if you want to take your your UI view’s and put them straight into a PDF this is probably the way to go.
You can find an excellent example on taking creating a PDF with UIKit here.
Using libHaru To Generate PDFs
If you’ve researched PDF creation on iOS then you may have noticed the cross platform Libharu library being mentioned. From what I’ve tried this works very well, and makes another great alternative.
You can find a demo project on using Libharu with iOS here.
A library for searching PDFs on iOS Demonstrating Quartz Parsing
Since manipulation/parsing PDFs go hand in hand with creating them here’s a library created specifically for Objective-C and the iOS platform that you may want to check out.
Some time ago I came across a library from Marcus Hedenström that allows you to search through PDFs known as PDFKitten that you can find on Github here that works very well for searching.
You can look through the code and see those Quartz PDF parsing routines in action.
Conclusion
Creating PDFs and getting everything working right can be difficult and they all seem to have their little quirks.
With the different methods method (Quartz, UIKit, libHaru) here you should be able to get on the right track.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Update: More iOS 5 SDK Tutorials Added (Including A Complete Course, Storyboard and ARC updates)
It’s been some time since I posted an update to the iOS 5 tutorial section areas on this site.
This latest update includes a complete course on the basics of iOS development, some very straightforward storyboard tutorials great for beginners, and a good guide on the problems you can run into when migrating your code to ARC when using the migration feature in Xcode.
1. The course is from Apple and Stanford that recently ended in late December so if you checked it out previously all the lectures are now available. Stanford has placed several versions of this course on iTunes. This latest edition utilizes iOS 5 and covers the same basics covered within the previous course, but utilizes the new Xcode Storyboard tool, and covers new iOS 5 features such as iCloud.
You can find the course on iTunes here.
2. The new added Storyboard tutorials include a good set of guides from Matt Campbell. What I like about these tutorials is that they are very easy to follow. If you’re new to Storyboards and having trouble following other tutorials the screenshots in these tutorials can be very helpful.
You can find Matt’s tutorials here.
3. The latest automatic reference counting (ARC) tutorial added was created by Mugunth Kumar. If you’ve tried migrating existing code to use ARC then you’ve likely run into numerous problems. I’ve mentioned tutorials on using the migration tool in the past, but this tutorial goes into more specifics on the different issues that you can run into.
You can find Mugunth’s tutorial here.
You can visit the iOS 5 SDK tutorials page for all tutorials. I added several more, but those three were my favorites.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.New Open Source Visual iOS Testing Framework For Easy Testing Using Coffeescript And Screenshots
Testing iOS apps is a topic that I have mentioned several times in the past. Some of the resources mentioned including a testing framework that uses an natural language syntax, and a great tutorial demonstrating the use of some of the more popular iOS Objective-C testing frameworks.
This new framework aims to take things to another level allowing you to use a natural language, and also uses screenshots from your app to make sure that the interface is working exactly as desired.
The framework is Zucchini uses Ruby, and the tests are written in Coffeescript. ImageMagick supplies the image processing functionality.
You can find the Github repository for the framework here included is a complete example project showing how the framework is used.
A homepage has also been created for the framework and a Google Group has also been created.
Looks like a great framework for your testing needs that already has started to build a community where you can find help if you want to use the framework.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Best Resources In iOS Development – December 26th, 2011
Welcome to another edition of the best resources in iOS development featuring the most popular resources on this website in the last two weeks.
I hope that everybody has had a great holiday season. This list features an update to the popular ShareKit social sharing library, a graphing program for helping you create better designed Objective-C programs, a large collection of Cocos2D sample code and more.
Here are the resources:
1. Open Source ShareKit 2.0 Easy Social Sharing Library For iOS Apps Is Release - A new version popular library for social sharing on the iOS platform has been created combining features of many different forks, and correcting many bugs has been released.
2. Tool: Objective-C Dependency Graphing Script For Easily Improving Program Design - A script allowing you to create dependency graphs viewable in Graphviz and Omnigraffle which is great for identifying those occasions where you might be best to use notification and delegation rather than importing classes directly.
3. Over 90 iOS Source Code Examples (Many Using Cocos2D) - A listing containing many different Cocos2D examples including mainly small code samples and a few open source games.
4. Open Source: Library For Adding Easy Face Recognition To Your iOS App With The Free Face.Com API - A library that makes using the Face.com face recognition API easy allowing you to automatically tag identities for millions of faces, and get other interesting data about faces from within your pictures very quickly.
5. Open Source: Library For Easy Usage Of The FourSquare API In iOS Apps - A library that makes using the FourSquare API very simple with expected functionality such as check-ins, venue searching and adding photos.
6. Open Source: Great Looking Easy To Use Customizable Bar Gauge iOS UI Component - A great looking bar gauge component that you can totally customize the colors of, great for any app in which you’d like to use a bar gauge.
7. Open Source Libraries For Easily Adding Rotary Knob Controls In Your iOS Apps - A set of libraries that allow you to add in some great looking rotary knob controls with both a totally customized, or Garage Band type look.
8. Tutorial: Creating Universal iOS Frameworks With Xcode 4 (Make That Open Source Library Work With ARC!) - An up to date guide on creating Universal iOS Frameworks which is extremely useful if you want to get some open source libraries working with automatic reference counting.
9. Examples: How To Draw On Textures In Cocos2D, Perform Motion Blur, Get/Set Individual Pixels And More - A set of source code examples showing how to perform different special effects in Cocos2D and a special Cocos2D texture class that allows you to get and set individual pixels.
10. Tutorial: Securing iOS App Data – Using The Data Protection API, Keychain And Cryptography - An extensive tutorial covering how to secure data within iPhone and iPad apps.
11. Parse.Com Allows Easy Data Caching, Push Notifications, And More (Completely Free While In Beta) - A great looking online service that allows you very easily save and retrieve data online, and cache that data without having to use a local database such as Core Data or MySQL.
12. Example: Easily Implement Fast Pixel Perfect Collisions In Cocos2D - A technique for performing very fast pixel perfect collision detection demonstrated using Cocos2D.
Thanks for reading, please bookmark and share this post!
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.Tool: Objective-C Dependency Graphing Script For Easily Improving Program Design
If you are looking to create better designed programs, I came across a very interesting script that creates a graph of the dependencies within your Objective-C code.
The graph can then be viewed in the open source graph visualization tool Graphviz or in Omnigraffle.
This is great as you can easily see those places where you may be better off using notification and delegation rather than importing a class directly.
On the Github page here you can download the script and you can also find a great example demonstrating a real example of how the tool was used in taking the tightly coupled code from one project, and turning it into a more efficient design.
For viewing the graphs you can download Graphviz here.
A great tool for visualizing ways to improve your code design.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.







