Getting Started With iOS Development

I have been asked quite a bit recently at user group meetings how to get started developing for the iPhone. I keep giving the same answers so I will post my advice here for posterity.

If you have some knowledge of programming, particularly in an object oriented language I suggest these two books

iOS Programming: The Big Nerd Ranch Guide

Beginning iOS 5 Developement

Screen_shot_2012-04-01_at_1
Both of these books assume you have some understanding of programming but do cover the basics of Objective-C. These are the types of books that once you get half way through you are already confident enough to start on your own projects.

If you do not have any programming experience or simplly want more information on the Objective-C language that is the basis for native iOS apps there are two more books that are popular. I have not read either of these books but they are spoken of highly within the community.

Programming in Objective-C

Screen_shot_2012-04-01_at_2

Objective-C Programming: The Big Nerd Ranch Guide

Screen_shot_2012-04-01_at_2
In addiiton to these books, iTunesU offers some excellent resources. I highly reccommend any of the Stanford iOS programming courses. These are the acutal class lectures from the Stanford University courses. Follow along at your own pace but I suggest doing the assignements to be sure you grasp the concepts. All of the instructors are very good but if you are only going to watch one i suggest the latest from Paul Hegarty

Screen_shot_2012-04-01_at_2
Apples documentation is also excellent. You can browse it online or it is installed as part of your Xcode application that you can download from the app store Many of Apples development documents are also available via the iBooks app on your iPhone or iPad. Fire up the iBooks app. Navigate to the store and search for Apple Developer Publications. These are all free downloads.

The best way to really learn any programming language or framework is to actually use it. So install Xcode and get coding. There is no harm in trying things to see what works and what does not. If you get stuck the developer community surrounding iOS is very knowledgable and friendly. Visit StackOverflow if you're stuck or find a local NSCoder or Cocoaheads chapter and show up at a meeting.

Our local Albany Area Cocoaheads chapter is always glad to have new people and happy to answer any questions. I'm certain the groups closest to you are just as helpful.

How I Spent My Weekend

This past weekend I attended the first Tech Valley Startup Weekend in Troy, NY.

40 or more people presented pitches for their ideas on Friday night. The attendees voted for about ideas 20 to continue to be developed.

I joined a team to create a service called Landlordia

Landlordia is a service to help improve the relationship between landlords and tenants. It is a web and mobile based service allowing payment and receipt of rents, notifications via voice, text and email of bills due and payments both due and missed. It allows the tenant to snap a picture on their phone and notify the landlord of something that needs to be repaired. And much much more. The link is just the landing page but there is a working site and web service along with a mobile app. Its real.

Out team of 9 spent 54 hours building this concept. We had designers, marketing, developers and even a lawyer on the team. 

We worked very hard. Everyone did their job and did it fantastically. We had a great team.

On Sunday night we finished in third place winning $6,000 in cash and services to further the business. 

I was impressed by the work of all the teams. I met some great people I hope to continue to work with and call friends.

This was a great experience and I encourage anyone interested in becoming an entrepeneur or taking part in the process of developing an idea into a business to attend a Startup Weekend.

CE Tracker 1.2 Available Now

Apple has graciously reviewed and approved the newest release of CE Tracker. 

Version 1.2 features the ability to export your course records and track costs associated with each course.

These were the two most requested features. Keep the requests coming for more updates.

If you are using CE Tracker and like it please consider reviewing it in the App Store. If you don't like it or are having issues with it please let me know.

I know many people are using it and getting in touch but a few positive reviews in the store would boost sales and help keep the updates coming.  No one likes apps that remind you to review them so I didn't do that. Please consider supporting CE Tracker with a two minute review on the App Store. Thanks.

Removing HTML elements from a UIWebView

I was working on a simple app to use UIWebVIews to display pages from a web site. Its a tab bar app and each tab loads a different page from the site.

The site is here: Tech Valley Mobile Developers Network

If you open that link in mobile safari you will see the extra elements added to aid browsing on the smaller screen.

The site is configured with a wordpress plug-in to better handle the mobile browser. The plug-in adds a menu, searching and the ability to toggle the mobile format on and off.

The home page looks like this:

Ios_simulator_screen_shot_feb_8_2012_7

I did not want these elements (the black bits at the top of the web view)  in the app as they would circumvent the tab bar button system.

It turns out, as with most things cocoa, once you figure it out its very simple.

 

The trick is to inject some html into the page after you load it. In this case I injected some javascript to hide content by id <div id=...> tag

 

Here is the code (apologies for the formatting)

- (void)hideUnwantedHTML{

    [self.webView stringByEvaluatingJavaScriptFromString:@"var script = document.createElement('script');"  

        "script.type = 'text/javascript';"  

        "script.text = \"function hideID(idName) { "  

        "var id = document.getElementById(idName);"  

        "id.style.display = 'none';"

     "}\";" 

 

     "document.getElementsByTagName('head')[0].appendChild(script);"];  

 

    [self.webView stringByEvaluatingJavaScriptFromString:@"hideID('headerbar');"];  

    [self.webView stringByEvaluatingJavaScriptFromString:@"hideID('wptouch-search');"];  

    [self.webView stringByEvaluatingJavaScriptFromString:@"hideID('wptouch-menu');"];  

    [self.webView stringByEvaluatingJavaScriptFromString:@"hideID('drop-fade');"];

    [self.webView stringByEvaluatingJavaScriptFromString:@"hideID('footer');"];    

}

 

What this method does is inject a script to find the element by name (idName) then hide any elements with that name. Call the script once for each id you want to hide.

Call this in your UIWebViewDelegate under the webViewDidFinishLoad: method and the nasty html you don't want will disappear.

 

- (void)webViewDidFinishLoad:(UIWebView *)webView {

    NSLog(@"Finished loading");

    UIApplication *application = [UIApplication sharedApplication];

    application.networkActivityIndicatorVisible = NO;

    [activityIndicator stopAnimating];

    activityIndicator.hidden = YES;

    [self hideUnwantedHTML];

}

 

 

Don't forget to add <UIWebViewDelegate> to your view controller in order to get the delegate calls.

Here is the same UIWebView after the addition of the injected javascript. Nice and clean.

Ios_simulator_screen_shot_feb_8_2012_7

Sure, web apps like this don't make the best apps but when a quick and dirty solution is needed this might just do the trick.

 

 

 

Exporting is coming to CE Tracker

A few people have requested the ability to export their course data out of CE Tracker.

Ios_simulator_screen_shot_feb_3_2012_4

Version 1.2 will have this feature. 

This next version will also allow you to track expenses associated with courses so you can see how much compliance is costing you.

We have been planning these features for a while but it definitely motivates me when people submit requests. Keep the suggestions coming.

The Facebook Disaster

Excuse me venting here...

 

I am working on an app for a client. One of the features is sharing to twitter, facebook, etc.

In order to do so you need some API keys from the various sites to use in your app. I added half a dozen services with no problem. Then came facebook.

I have avoided creating a facebook page but it was needed in order to register an app as a developer. So I tried to sign up. I gave what I felt was the minimal information needed to start an account.

They decided that I was just going to spam them so they asked for a phone number to verify I was a real person. OK. Fair enough. I give them my google voice number to send me a text. I don't get the text. Repeat a few times. No text. Try again.  'You are requesting too many codes in a short period of time' Again, fair enough a bot network might do that.

Realzing this isn't going to work with text messaging and google voice, I give them a real live phone number and select the option to receive a voice call..... 'Our systems are busy. Try again later' Progress? Perhaps....

Repeat the process 3-4 times. Systems still busy. Really? You can't get a machine to dial my number and give me a code?? After 3-4 times it says I am spamming the system and locks me out again. Sometimes I can try again in a few hours sometimes 10-12 hours later it still says too many tries.

This has been going on for 3 days. Glad I didn't want the facebook page anyway.

Ended up using the client account to get the API key. Everything worked fine. For now.

CE Tracker 1.1 Update Coming

Thanks to a user report I have fixed a bug that prevented the info button from displaying beyond the second goal in the goals view.

I am currently awaiting feedback on another possible bug (could be a misundertanding rather than a bug) but once this is clarified and fixed, if necessary, I will upload a new build to the app store.

Unfortunately, the App Store is shut down for updates until after the holidays so any update will take a few more days to appear.

If you have run across this issue please bear with me, the fix is on the way.