Storing and Saving Data in iOS

So, this will be a fairly short post, but I frequently get asked about storing data in iOS.

Essentially, when it comes to storing data  in iOS you have several options:

  1. NSUserDefaults. If the amount of information you want to save isn’t terribly large, and consists of NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary, you can easily store it in NSUserDefaults. NSUserDefaults can be read/written to in much the same way you would work with a NSDictionary. For example:                                                
    NSString *test = [NSString alloc]init];
    [test stringByAppendingString:@"test!"];
    //creates string object
    NSUserDefaults *myDefaults = [NSUserDefaults standardUserDefaults];
    [myDefaults setObject:test forKey:@"string"];
    [myDefaults synchronize];
    //and this data can be accessed by:
    NSString *newTest = [NSString alloc]initWithString:[myDefaults objectForKey:@"string"]];                               
  2. If you REALLY insist on writing to a local text file of some sort, do not put it in your application bundle. The bundle is read only, and you will spend an absurd amount of time debugging this.
  3. You could use sqlite. Code can get a bit tedious and ugly, but it still works fine.
  4. Core Data.

That is all!

Most people have no idea how much time it takes to build a great app.

The Main Street Analyst

“How long does it take to build a mobile app?” While the question isn’t as timeless as “How many licks does it take to get to the center of a Tootsie Pop?” (spoiler alert: 3481), it is one that’s very dear to our community of mobile app developers. And now we’ve got an answer. 18 weeks.

In collaboration with research firm AYTM, we surveyed 100 mobile designers to discover how long they expected it would take to build core front- and backend components of an Android or iOS app.  We averaged the responses and then teamed with the designers at to visualize the time required to develop each component of an MVP-quality native app.

For fun, we put app development time in context. Who knew you could drill three 3000-foot oil wells in the time it takes to launch the first version of your “drill for oil”…

View original post 75 more words

Some thoughts on “Entrepreneurship”

I love entrepreneurship, but the term is losing its meaning and is becoming a word to defend a group of lazy, arrogant people who are too “intelligent” to work and instead go to meetups and talk about each other. This must stop.

The reason I fell in love in with entrepreneurship was the core idea of following something that personally excites you and transforming it into something that can help other people. You work incredibly hard building something because you really enjoy making actual things.

Unfortunately, it is extremely easy to use adjectives and meet with other people who like these same ideals, but do absolutely nothing towards actually making things.

To build great products you need a few things:
1.) A drive to learn, and be willing to give up everything else to spend hours learning marketing, finance, programming, or design.

2.)Be able to see through bloat. You will have many, many people approach you with their ideas, opinions, etc. It is critical you do not waste your time with people who are ignorant, and just like talking about big ideas and do nothing. Find people that are willing to work their ass off, and really understand the industry. For example, one thing that NEEDS to end is this new trend of completely inexperienced business students or non-programmers starting startups that help people learn to code or learn to run a startup. This creates bloat, and is a complete waste of time. If the person running this startup for startups has never actually run a company or written a line of code themselves, what makes them qualified to be a teacher? They are not qualified. Now, if they hire people to teach at this new code or startup school that have experience, this is very valuable and a great move.

3.) Learn from mentors. I have learned pretty much everything I know from experienced developers, business leaders, etc. School is incredibly valuable, but getting solid mentors gives you real world experience. For me, I was lucky enough to get a job at Detroit Labs right out of high school for the summer. I cannot even begin to explain how much I learned just by sitting in a room with the four cofounders and seeing how they ran the company. Additionally, being a Kleiner Perkins fellow this summer was incredible. Being able to talk informally with some of the top VC’s was so valuable.

4.) Be willing to work. Really freaking hard. Don’t trick yourself into thinking sending emails is hard work. Actually work. One very valuable thing going to a very competitive school has instilled in me is learning to work hard, and more intelligently . School makes you to be evaluated by someone other than yourself. This can expose critical flaws. School is not the only way to get this type of feedback, but it is a very great means to do so.

Some Things I’ve learned as a Freelance iOS developer

1.) Be picky with your clients. Clients typically fall into a few categories: easily impressed, too picky, or ignorant of the technology. The best clients to work with are those who have some sort of technology background, and have a FIRM vision in mind. In this way, you can build to the specs they want, and they can give you helpful, and valuable feedback. Clients who are too easily impressed will often give you ambiguous feedback that will never help you best finish the app or project. Clients who are too picky often cause a huge amount of unneeded stress and (in my experience) lead to rushed, un-polished work. Clients who are ignorant of the technology involved completely are VERY difficult to work with. For example, they may expect an Android version of an iOS app you built in a matter of days and for no extra cost since you are a “mobile” developer.

2.) Reuse code. Each project, there should be generic portions of the code that you could reuse between projects. For example, if you wrote a web services class for one project, you could probably use large portions of this web services class in a different project.

3.) Always ask for at least half the cost of the project up front. This gives you some confidence that the client will pay you for your time and work, and that they are serious about getting their project done.

4.) Keep communication consistent, but don’t allow clients to be obsessive. In my experience, daily contact is overkill. Freelancing is not necessarily a full time, everyday job. The client you are working for needs to realize this. They need to give you space to work. However, as a developer you are responsible for keeping the client up to date on what work you have done, and what amount of work is remaining. In previous projects, I have been poor at anticipating how busy I would be in the upcoming weeks and months, and have missed deadlines. So, I strongly suggest that you always expect to have half the time you think you will have in the next week, month, etc and communicate this clearly.

5.) Anticipate the worst. Always expect that the project will go awry. Spell out clearly in a contract initially what you are and  what you are not responsible for. Make sure clients know small things like a potential for a 2 week approval process into the app store.

How to Write your own Minesweeper AI

Lucky's Notes

A while ago, I wrote a minesweeper AI. I intended to publish a writeup, but due to university and life and exams, I never got around to writing it. But having just finished my Fall term, I have some time to write a decent overview of what I did.

Short 30 second video of the AI in action here:

How to Play Minesweeper

If you’re an experienced minesweeper player, you can probably skip this section. Otherwise, I’ll just give a quick overview of some basic strategies that we can use to solve an easy minesweeper game.

We start with a 10×10 Beginner’s grid, and click on a square in the middle:

We can quickly identify some of the mines. When the number 1 has exactly one empty square around it, then we know there’s a mine there.

Let’s go ahead and mark the mines:

Now the next strategy: if a…

View original post 1,572 more words

2012: Looking Back

2012 is almost over. It was an awesome year. Thanks to everyone that made it that way!

1.) The year began by entering a very intense second semester of my freshman year at the University of Michigan. I learned a ton about how to handle a tough schedule and balance my time wisely.

2.) After applying to many various internships, I found out that I had an offer from Path in San Francisco, a company that I had dreamed of working at.

3.) Besides just talking the normal workload, my friend Chris Wendel and I taught an iOS development class under the guidance of Prof. Ringenberg at U of M. We had the opportunity to build and give lectures. We made new friends, learned a ton, and gave a few students new skills to get internships.

4.) I made some great new friends through school. I can’t even name all of the great people I met.

5.) I worked the few month or two of the summer at Detroit Labs, learning again from Henry Balanon, Dan Ward, Nathan Hughes, and Paul Glomski.

6.) I made the trip out to California. I began working at Path, exploring the city, and learning true SF/silicon valley startup culture. It was amazing. I lived with Chris Wendel in the heart of downtown. Living on my own that far away from Michigan was a true adventure, and I am so glad I decided to make the jump this year. Least enjoyable part of this summer: sleeping on an air mattress for 2+ months.

7.) Since I was finally out in California, I was able to spend more time with Stacey Ferreira, cofounder of MySocialCloud. Besides explore the city, and the California coast, I was able to spend a lot of time with her and her brother. Midnight walks around San Francisco were awesome.

8.) I was able to speak at the Teens in Tech Conference in August! Thanks to Daniel Brusilovsky for that amazing opportunity!

9.) I came right back to Ann Arbor for school in September.

10.) I just finished a semester filled with much caffeine, great friends, and much math and code.

11.) I was able to head back out to the Bay for interviews in Palo Alto and the city.

12.) I was fortunate enough to receive offers from Path, Flipboard, Twitter, Detroit Labs, and Apple. I accepted an Apple internship for the summer.


Looking forward to next year, I have a few goals for myself. I want to become a better software engineer. One of the main reasons I chose to go to Apple was simply that I wanted a place where I could learn the most. By expanding my knowledge from simply iOS to Mac development, I will learn a ton more about Object Oriented Design, deeper components of the Objective-C language, and the Cocoa Framework. Regardless of where I choose to go in the future, I feel that Apple will give me a solid background.

Next, I want to learn to even better manage my time, and be more productive. Throughout the course of the past few months I have tried to work in freelance projects. Although the projects do get accomplished, I want to improve the way I schedule my time and mangage school, projects, and everything else going on in my life.

Finally,  I will be turning 20, and I know (mostly) what I want to do with my life. I want to continue to maintain and seek out friendships and relationships that help me accomplish my goals and push me beyond them. I want to make sure I take the time to do what it takes to keep these connections in my life strong.