Xcode 4 – very simple way to open a website from App

This is going to be a VERY quit little missive. Basically, it’s about knowledge retention. The more I write about something, the better chance I have remembering some detail months or years hence. Today, I’m recording, for posterity (sounds pretty snooty, I know), the Objective-C command for opening a URL.

I won’t pretend to know all the details of this, and why it requires so many messages to be passed. In this case I’m admitting I was a cut-and-paste code monkey, standing on the shoulders of others. So, enough babbling, here is the meat of it. This ASSUMES you have a way to call this, such as a class method, or something. To clarity, this is writting into your implementation (.m) file.


- (IBAction)visitAuthorWebsite {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://apps.daviddemartini.com/icidr"]];
}

The above does NOT maintain context within your app. This tosses the user out into Safari to view the page. Had I added a URL View page to the application, it would have appeared there. Perhaps in version 2.1, but for now, for today, this works. I’ve tested it, verified it, and trust it.

Here it is again, broken out into chunks


- (IBAction)visitAuthorWebsite {
[
[
UIApplication sharedApplication
]
openURL:[
NSURL URLWithString:@"http://apps.daviddemartini.com/icidr"
]
];
}

I was thrilled when the example turned out to be so simple. I hope someone finds this useful.

XCode 4 – Dismissing a Keyboard after UITextField input

I originally ran into this issue back in November of 2010, while writing the original version of my iCIDR tool (hey network admins, you should buy this awesome tool now, before the price goes up!).

It’s trivial to enable a keyboard and to change the button, BUT to make it go away, and then actually wire that event into your code to do something use is not as simple as I had originally hoped!

Strategy entails using the keyboards ‘Return’ key to signal that one is done. Seems useful, but only if you have a single line text input. In my case, that’s what I’m looking at, single line input, so that’s the solution I’m going to try.

First order of business is to highlight your text area (I’m only going to be addressing the text input object), and shift to the properties tab (icon looks like this: ). Change the dropdown to the ‘Return Button’ text you wish to use. I like to use ‘DONE’, so, that’s what this image shows. Oh.. and yeah, you are also getting a little sneak peak at the newest generation of iCIDR.

The tricky part is understanding that you need to make sure your ViewController’s header file is modified to implement UITextFieldDelegate.

This is how that might look:

@interface iPhoneCalculatorViewController : UIViewController {
UITextField* seeTextField;
}
@end

Now, when the view loads, the Text box in the view needs to be addressed and wired up to the Keyboard action. Even though I defined a nice fancy label name for my object, so far I’ve only found this method to address the object ID by it’s ID. I think this is pretty funky but, cest la vie. Here is where I set the tag, also in the same view organizer dialogs:

Following that I enabled viewDidLoad (boilerplate code normally commented out), created a local variable pointer to the View’s input text box, and then set a delegator to that pointer in the main ViewContoller.

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
UITextField *iPhoneInputText = (UITextField *) [self.view viewWithTag:1001]; // try to locate the object with the tag
iPhoneInputText.delegate = self; // assign a delegation.
[super viewDidLoad];
}

Moving along, I had to implement the The textFieldShouldReturn method in my ViewController class. This had to be defined to execute on the abandonment of the first responder:


// Should trap all Keyboard Return Events
- (BOOL) textFieldShouldReturn:(UITextField*)textField {
[textField resignFirstResponder];
//[self calculateOperation]; // ENTRY POINT
return NO; // default return value is YES, this is changed to NO to.... (sorry, now I've forgotten!)
}

Here is the keyboard that pops up, with the highlighted ‘Done’ button.

iCIDR 2.0 - keyboard in action (still photo)

The method (BOOL) textFieldShouldReturn is now registered to get the text input object the keyboard was typing into.

Now it’s your job (and mine…) do make it do something useful!!


Support the author, buy the App!

iCIDR - David DeMartini

Stanford Entrepreneurial Thought Leaders series – Jessica Mah

Aired 30-November-2011
Interview with inDinero‘s Co-Founder and Architect Jessica Mah. Jessica discusses business accelerators, Angel investors, common start-up mistakes and why she feels it’s not good to “Fake it until you make it.”

inDinero was founded by two people. Jessica said that having a co-founder was really important. Having a trusted person that can confirm or refute ideas is very useful. Thinking about what your company culture should be up front, it’s OK to have a fun working environment (she likened inDinero to more like a club), but it still needs to be run as a business. A party culture is not likely to succeed. One thing they do to maintain a cohesive workforce and to exchange ideas, is to get out of the office once per week and all have dinner together.

Jessica related that they got a great jump start on the company, but applying to and becoming part of Y-Combinator, which provides a small amount funding for start-ups. She had very high praise for Y-Combinator, and said she she sometimes wishes they were still in that environment. At the end of Y-Combinator they had the opportunity to pitch their company to a variety of potential investors, and as a result of that they raised over $1,000,000 in start-up funding.

inDinero decided to go strictly with Angel investors, and not Venture Capitalists. Going with the Angel investors had a number of advantages. Along with having more direct control over the organization, as opposed to going with VC’s, she felt they had a larger group of advisers with which to consult. That said, she also cautioned against raising money too early.

But even with million dollars plus in funding, things were still not easy. This added significant stress and pressure to perform. She wished that they had taken as much funding as they possible could up front. They had under-estimated the costs of mistakes, such as leasing a fancy office, or making bad hiring decisions.

One of the toughest lessons they learned, was that money goes fast. Keeping control of costs, despite what seemed to be ample funding, is critical to remaining both operational and emotionally strong. One costly mistake they made was the leasing of a nice fancy office. It presented a nice face for visiting clients, but internally Jessica said she felt more like a con artist, knowing the reality of their success. They have disposed of the fancy office (that included a hot tub), and are now operating out of an apartment. She felt that it made them feel more scrappy, as opposed to content.

Staffing the company also turned out to be more challenging than she anticipated. The practice of hiring on intelligence alone, turned out to be a mistake. Employees need to be rounded, able to work well with others, and also with customers. They found that the best way to get the A-Players that every start-up needs, is to give the a test drive first. It’s the fastest path to finding the gold. You only want to keep A-Players. Having under performers in a seat is far more costly than having that seat empty (this is painful lesson I’ve learned as well, and one I’m still trying to address). Bottom line, It’s better to leave that seat empty.

Being a technology company that delivers it’s product over the web, product design and testing is a critical part of remaining useful and relevant. Useability testing was the smartest thing they did. Usability testing has to be done IN PERSON. It’s the only way to do this (Steve Krug, a well known author on UI design covers this in his book Rocket Surgey Made Easy ). They met with dozens and dozens customers to find out what what the product really should be. It’s not unexpected that the product will need to adapt to the reality of customer desires. However, that does not mean that the product needs to change to meet every customers every need. For example, some features desired would have turned their product into a full blown accounting system, and they had to point out to those customers that they signed up with inDinero because they wanted something simple, not a big full-blown accounting system, and they were not planning to move in that direction.

Several lessons were learned along the way. Customers do not care about elegant or prefect code. The product evolution was iterative. One simply can’t figure out everything customers wanted up front, and simply pumping the product up with tons of features is not a good road map to success.

Long term product release planning was also a hindrance. They found that planning product released 3-6 months out was far too long. Customers couldn’t really wait that long for the features they needed, so they shifted to a 2-3 week product plan cycle. In contract to that less though was the imperative to NOT release too early! She said that start-ups must resist the urge of investors to release a product too early. Instead they bowed to the pressure and initially released the product too early, squandering a lot of useful PR with and immature product.

One tool they used to gain access to customers that would provide useful feedback on the product was placement of a “Would you recommend” link. That link asked them if they would recommend the product, if they felt the product had promise, or they simply didn’t like the product. Jessica focused on those that thought the product had promise, but would not recommend it. She found they to have the most useful feedback. Those that indicated that they simply didn’t like the product were customers that they really didn’t need their product anyway.

Finally, there were a few other important observations and tips.

  • Don’t get yourself hung up on vanity metrics, like followers, hits, etc. Stick to the metrics that matter like adoption and revenue.
  • College didn’t teach them how to build real world useful products.
  • A business plans seldom survive first contact with customers.
  • Recommenced book: 4 Steps to Epiphany

  • When you start hating your customers, you are OUT OF BUSINESS.

  • Facebook eats Gowalla, taking key contributors, killing the service

    Well, here is it. Facebook is on the roll, making plays in the acquisition game. Note this report from Reuters:

    Facebook grabs Gowalla team, but not technology

    “While Facebook isn’t acquiring the Gowalla service or technology, we’re sure that the inspiration behind Gowalla will make its way into Facebook over time,” the company said.

    The article also noted that the founders, and an undisclosed number of employees will be carried over to Facebook. Now, if it has been all or nearly all, they would have played that angle up. However, I believe they are just taking a few lucky and key souls along for the next ride and setting the rest adrift in the world of unemployment.

    This is not just a guess, this is a common scenario in these sort of games of mergers and acquisitions. I’ve seen this happen with start-ups I’ve helped propel forward. In most of those cases, I was duly compensated, and in a few cases had the chance to enjoy the ride-along, if only for a little while.

    Good luck to those that will undoubtedly get their Gowalla pink-slips, courtesy of Mr. Zuckerburg and Facebook.

    For reasons far beyond this, I’ve already cut my FB usage down to a trickle, mainly using it for marketing my own ideas and soon to be publicly available products.