View Controllers

It turns out views are pretty decent to understand. The turning point for me was when I realized that the view object is itself the drawing, rather than containing the drawing. The UIView object has a function that you can override called -loadView that actually automatically generates the view – all you need to do is modify -loadView! Interesting concept for me. So yesterday I finished the application that displays a different polygon and the polygon name when you increase or decrease the number of sides. It’s awesome, I’m going to make millions, just wait.

Now it’s on to View Controllers, which I don’t get. Theoretically I’ve gathered that they’re a way to manage different views and manage the navigation and such, but I don’t really know how they work. I’m on lecture 6 of the Stanford lectures now which talks about it, so I should have a grasp on it by tomorrow.

By the way, I have been mostly keeping up my daily jog since my last post about fitness – I’ve just stopped logging it. It’s kind of become a habit though, so just about every weekday since then, and about half the weekends, I’ve jogged 4 miles a day. I’ve also been lifting weights twice to three times a week – I’m at 165 bench, 3 sets of 8. Decently strict diet, sometimes I cheat during the weekends when I’m in some sort of altered state of consciousness. Lost 8 pounds in 1.5 months and I’m going to keep it up until I’m Brad Pitt in Fight Club. (Then I’ll eat pizza every day of course.)

Learning iPhone development

I’ve been learning iPhone development for the past week or two. I started off on a lynda.com video series but then moved to this extremely helpful Stanford course.

I do not have a background in programming. I am highly proficient in HTML and CSS with about two years of intensive usage, I have working knowledge of PHP, and I have a very basic knowledge of javascript and jquery (read: I can take other people’s code snippets and adapt it for my purposes). That’s it – just easy web stuff. No real object-oriented programming experience except for what I have picked up here and there from customizing a php shopping cart and listening to my father, who is apparently an excellent programmer.

It’s been a little over a week since I started, and I just finished lecture 4 of the Stanford series. I’ve finished all the assignments up to date with no major issues. One of the most at once infuriating and rewarding things about learning a new skill is working through the niglets and sticking points that inevitably arise from lack of experience. In programming this manifests as seemingly insurmountable frustrations that really get under your skin – everything looks completely right, but the damn program still throws some sort of cryptic error! Or even worse, it doesn’t throw any error and your program just doesn’t work correctly.

For example, this single problem got me for about two hours. In Objective C, you can access setters and getters in two ways. First, you can actually invoke the functions conventionally:

myName = [myObject name]; //getter
[myObject setName:@"Fred"]; //setter

OR you can use dot notation as shorthand, which looks much prettier.

myName = myObject.name; //getter
myObject.name = @"Fred"; //setter

So what Objective C apparently does, is take your setter and getter definitions and translate them into a dot notation format that you can use if you wish. The problem arises, though, when I didn’t realize that the setter definition had to start with “set” and then a capital letter – I had been defining them as just “name” instead of “setName”! Because I had used @synthesize and I was trying to override the default setter rather than create it, the damn thing didn’t throw an error but instead completely fucked my code up. Pretty crazy – and I haven’t even gotten into memory management issues yet.

Anyways, what I’ve learned so far is the basics of Objective C, working with Xcode and Interface Builder, and the basics of MVC. I also grasp object oriented programming concepts, and some other stuff used a lot in Objective C like delegation. It’s relatively simple stuff so far – I haven’t really had any major trouble with grasping any of the material.

I finished doing part of an iPhone app that manipulates polygons. For example, I set a minimum and maximum number of sides, and have two buttons that increase and decrease the number of polygon sides whenever I touch them. It works exactly as it should so far and I’m extremely pleased with myself.

The next Stanford lecture is Lecture 5, which has to do with custom views and drawing – should be very interesting! I’m about to watch it. This is pretty awesome – I’m actually looking forward to watching new lectures and doing new assignments. We’ll see how it goes!

Hell, if a 9-year-old can do it, there’s no reason why I can’t.

Still going

I’ll just list new days in this post as they happen. If I happen to NOT complete a day, I’ll post a new post.

Sept 15: Four more miles + stuck to meal plan. Exercise is getting lots easier.

Sept 16 completed as well with two miles. Went about 500 calories over though.

Sept 17 completed with four miles. The 2250 calorie limit is harder to keep up.

Sept 18 completed with four miles at lunchtime and a lifting session at night. Ate about 2800-3000 calories.

Sept 19 completed with 3.5 miles. Did not stick to meal plan unfortunately. I’m slipping here – the diet may even be more important than the cardio.

Sept 20 completed with 3-4 miles (wasn’t on a treadmill). Did not stick to meal plan. I’m going to have to consciously stick with it next weekend because weekends aren’t nearly as structured as weekdays.

Sept 21 completed with about 3 miles walked/jogged on the treadmill. Ate about 2500 calories, which is 200 over. Walked more than jogged today because I had an intense 45-min workout session right before and I was exhausted. At this point I’m thinking I really need to stick with my calorie limit more.

Sept 22 completed with 4 miles jogged and smack on calorie limit.

Sept 23 completed with 300 extra calories, 50 minutes on the elliptical, and one 40-min lifting session. Elliptical’s perceived exertion is tons less than running. 50 minutes on the elliptical at ~150 heart rate (75% age predicted maximum), while it couldn’t be considered easy, wasn’t really that strenuous either. I wonder if the measurements was wrong or if it really is much more effective than jogging.

+4

Yep, completed my workout today and stuck to the plan. Amazingly enough, 6 meals a day with reduced calories actually makes me feel like I’m eating more. I haven’t hit 2000 calories today yet and I actually felt full the entire day.

It must be because I am superman.

Self-Sufficiency

Okay, another 4 miles went by today. It felt pretty good I guess. Also keeping up on the pushups and situps too, and counting calories. Whatever, this will continue until Austin for Halloween.

I have also decided to move out of my parents’ house into an apartment of my own. First, I know that I have to move out before I turn 21 (because I can’t store alcohol in my room) so it might as well be as soon as possible, but there’s a couple other reasons as well.

The people who succeed the most at life are the ones who have supreme confidence in themselves and their abilities. This is undeniable. The question is how they’ve developed this profound belief that they can handle anything that life throws at them. Well, the world’s most successful people, the ones who have made the world THEIR bitch, have all had a period of time when they had to depend on no one but themselves. From Abe Lincoln, to Bill Gates, to 50 Cent, any highly successful person has been repeatedly thrust into the flames of adversity and forced to dig deep within himself in order to not only get out of it but thrive while doing so.

Moving out makes it possible for even a glimmer of self-sufficiency to be realized. Undoubtedly it will change certain things I take for granted. For example, I’m going to have to keep a tighter grip on money, that’s for sure. It’s all for the better though – especially during a time in which most of my peers are already in college and relying on themselves.

So I start apartment hunting today. Today I’ll finish making a list of the apartments I’m going to try to visit and get to all of them this week. I will plan on having a few good places in mind by next weekend. Ciao.