Author Archives: psgouros

movie review

well, comment…

I highly recommend Thor: the Dark World. I will never hear “ta-da!” the same ever again.  Very funny, contrasting the very dramatic. I haven’t laughed that hard at the right parts of a movie in so long…  Marvel has definitely held on to their high level of attention to detail and should be rewarded for that.

go see!

to complete the earlier thought…

if you use auto layout, the default view in a single view controller has a view.layer.sublayers array that is prepopulated with a couple of calayers that you mustn’t remove.  if you do you get  a hard crash as the system attempts to send layout messages to the layout constraints that were stored on them…

 

who knew?

Frustration…

can be defined as spending a great deal of time trying to use something properly, (as defined and recommended by the official documentation,) only to discover that the formerly preferred method of doing something is now recommended against and actively discouraged.

this particular example has to do with Core Animation layer hierarchies. which are documented (poorly) as a proper way to go about doing a certain task. however in the more recent update to the developer documentation is the following little tidbit:

developing

currently trying to write an iOS app to do (at least) simple pencil test animations. more details to come as they arrive, we’ll have to see if I ever make something that will pass review..
if anyone has a spare iOS7 capable iPad to spare, I could use one for testing and development… 😉

Navigation controller note

programmatically executing segues in iOS is an interesting problem.  this started because I wanted to execute a segue during a change in orientation. to perform the original segue, I added the following method to the view controller that is on the screen:

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
            duration:(NSTimeInterval)duration
{
    if (toInterfaceOrientation==UIInterfaceOrientationLandscapeLeft) {
        [self performSegueWithIdentifier:@"rotateme" sender:self];
    }
}

no big problem. the difficulty comes in trying to get back to the original screen. you could set up another named segue and do the following:

[self performSegueWithIdentifier:@"namedSegue" sender:self];

which seems easy, but navigation controllers are a stack. if you segue back, you add to the stack, what you need to do is go back or ‘unwind’ one step, or pop the view off the stack.:

[self.navigationController popViewControllerAnimated:YES];

if for some reason you have actually moved more than one screen and want to skip right back to the original (or root) view, you can just use the following:

[self.navigationController popToRootViewControllerAnimated:TRUE];

iPhone Camera access

interesting.

over the course of the iPhone history, there have been various ways to access the camera feature programmatically.  in this area, it’s interesting to track the advances of the public api that apple presents as they get better at it.

in the early days they presented a fairly simple version of the camera app that you could customize, but getting at the innards of the camera signal was tricky if not possible at all.

with iOS 4 AVFoundation was ported to iOS from the mac, where it appears to have formed the basis for all of Apple’s forays into media editing. (garage band, logic, iMovie, final cut pro, etc.)  Like a lot of software engineering, figuring out how to use it requires getting to understand the underlying rationales that led to particular design decisions.  I find the biggest pity in documentation is not explaining how you got there. as a result the reasons for particular aspects of a design can be completely opaque until you understand the motive.  I realize that the last sentence is nearly (if not completely) tautological…

the original UIImagePickerController concept was looking at the camera as a camera.  AVFoundation just looks at it as a sensor with a visual output.   I find thinking of it that way makes it much easier to grasp the rest of the AVFoundation.

more soon.

slow news week

terrible week in the shop. have removed the centerboard trunk preparatory to finishing the interior and was hit by a wave of ennui…  have returned to software engineering to break things up a bit. Got the newer version of Xcode and sorted out the provisioning of my iPhone at last. (definitely much easier in Xcode 5. one step process now.)

I have a couple of iPhone, iPad projects I’m going to be working out over the next few weeks. partly for fun, and partly to beef up my portfolio as I look for a new job. (have to pay for the boat somehow, and auto-mechanics just isn’t my thing… 😉  Who knows, one of them might even sell… 🙂