Category Archives: Uncategorized

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:

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.

not quite…

but almost. it turns out that brazing bronze needs *juuuuuust* a scoshe more heat than an electric stove can supply. even the propane torch helping along couldn’t quite do it. have to invest in the acetylene after all I guess…

 

more news as events warrant.

spam

I don’t think I’m breaking any new ground in my observation that link/comment spam is a waste of time.  some of it is fairly clever in it’s disguising, but for the most part… I mean how many sets of headphones does the world need?