view in plain text or web browser  
Tech Tails | Apple news straight from the Tech Room | SmallDog.com | 800-511-MACS
 
#897: iOS Single Controller Segues, No Trouble Found, How RAIDS Are Beneficial, and How They Suffer

 
     
 

Winter’s greetings and Happy New Year!

Hope everyone in the Northeast has been able to keep warm! It’s been a crazy couple of weeks for us with all the snow that has accumulated as well as how cold it has been. It would be nice to have a Mac Pro next to me with that Thermal Core to keep cozy and blaze away on some Adobe Master Suite…

I watched a teardown of the Mac Pro recently on ifixit.com and it was amazing how this machine is built. To think that the creative minds of Apple were working on this great design here in the US and then even manufactured it in the states is great stuff. It should be a message to companies all over as well as Apple itself that we can make it work here.

Enough with my Mac Pro day dreaming. We have an awesome newsletter for you today to help you warm up and possibly get out of that tech rut. Great reads on both iOS and RAIDS, as well as a more personal article from Kyle. Hopefully you learn something new — though don’t hold back if you have other tricks or tips for us!

Have a great week and let’s have a great 2014!

Barry
barry@smalldog.com

 
   
     
  iOS Single Controller Segues  
   
 

Note: This is Scott’s first article for Tech Tails. Scott works in our Waitsfield, VT location in the IT department as a developer. He’s one smart cookie, so be on the lookout for future articles from him!

I was recently developing a simple iOS application based on a single view controller managing two scenes in a storyboard. The main goal was to have a form in two parts — one on the first scene, and the next on the second scene. After collecting the form data from the first scene’s form, I needed to collect the rest from the second scene and then submit the whole package up to a server.

The problem was in getting the partial data from that first scene to be available in the second scene. Looking at some tutorials, it seemed like the correct way to do this is to attach onto the prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender method and basically grab the data from the departing scene and push it along to the second scene. Unfortunately, every single tutorial I read had the setup of two separate view controllers. So in leaving the first scene, you were also leaving one view controller. It made sense in some of the tutorials to have two view controllers, but there were others where it didn’t make any sense at all. My project certainly didn’t need a second view controller. It was just one form split into two scenes to make for a better user experience.

At first, I thought I could simply create a member variable for my single view controller and just set it to the departing form’s data. This frustratingly does not work. The reason is because in transitioning to the new scene via the segue, a totally new view controller instance is created. In my case, this was a bit confusing because it was still the same view controller that was being created. The original instance, where the prepareForSegue method is running, is lost. So anything you store in it will be lost as well.

The solution is the same as if you had a different view controller managing that second scene. Within the prepareForSegue method, you can grab a handle to this new view controller instance by calling [segue destinationViewController]. It’s this view controller object that will be used with the second scene, so you need to set any member variables on it. When the second scene loads, the controller running it will have all the data you set before running the segue.

This process still feels a bit counterintuitive, since it seems like there should only ever be one instance of the view controller running the entire show unless a scene with a new view controller is loaded. I’m convinced that using a single view controller in my project is the right thing to do, and passing the data through the segue should be fine. And to all those tutorials out there: Don’t use extra view controllers unless you really need to and there’s a good functional reason for doing so.

 
   
     
  No Trouble Found  
   
 

Lately there has been a trend going on with computers being checked in. Many of them have the same symptoms, and are unable to turn on when you press the power button. This can be caused by a number of things: power surge, spilled liquid, physical damage, not working top case, dying battery, or something unknown. The ‘unknown’ has been happening lately, as in the computers that come in don’t work…until they get checked in.

South Burlington has been slammed with repairs in the last several weeks, and several of these ‘no power’ machines have had their batteries drain completely, which, in essence, performs an SMC reset. A SMC, or “System Management Controller”, reset will send a reset signal to the controller that manages the power flow through the machine. When the machines were plugged in on the technician’s desk, they automatically powered on, which is normal when all power to a laptop was severed and restored. All diagnostic tests were run on these machines, and they would always pass with flying colors!

The reason why this happens is hard to pinpoint — unfortunately, when the SMC reset occurs, there is nothing wrong for the test to find. This isn’t always the answer that the worried customer is looking for, because without any other information and all our tests passing, there is no way to replicate (let alone diagnose) any problem that the computer had to begin with.

Per our agreement with Apple, in order to be able to replace any part or fix a computer, the problem must be replicated. We are unable to replace any parts that are not showing any issues. We do have a lot of tests that we run on all diagnostics, but intermittent problems and power issues solved by an SMC reset typically don’t register.

To perform an SMC reset on a machine on your own, press and hold the [Shift] + [option] + [control] and the power button. The machine will turn off if on, and or the magsafe light may come on if it was off. Attempt to boot the machine after performing the reset.

 
   
     
  How RAIDS Are Beneficial, and How They Suffer  
   
 

As media takes ever-growing amounts of space, storage has become something that is sought after more and more — and people are buying RAID drives to get what they need. RAID stands for Redundant Array of Independent Disks. “Redundant” is key here, as the original purpose of RAIDs was to have multiple drives storing the same information at one time (referred to as RAID 1), so that if one fails the others will retain the same data.

However, the RAID needs to be configured for redundancy. Many people use RAID systems for speed of drive access, and keep a separate backup. This would be RAID 0, in which the data is striped across all drives, decreasing access and write time if the unit can write a single file to two drives. However, in a RAID 1, there is no backup. There must be a separate backup kept elsewhere.

Thus, if one has bought a RAID unit and just started using it without setup, it may not be configured for what he or she is looking to use it for. It’s important to be very selective, as if you’re looking for redundancy, RAID 0 would result in no redundant copies. Worse still, if one drive in a RAID 0 fails, the rest of the raid is generally lost, as it strongly relies on the missing pieces copied to that failed drive.

RAID 5 or 6 is a great compromise between 0 and 1, where all but one drive in the RAID is striped with “parity”, that being there are redundant copies of files copied across the drives, and the speed advantage of striping data across multiple drives is more or less retained. If one (or two in RAID 6) drive fails, the data is still intact across the remaining drives.

If you’re looking at RAID enclosures for your storage needs, pay close attention to what type of configurations it supports, and ensure it’s configured properly before copying any data to it, as it needs to be erased and rebuilt each time the configuration is changed. If you do opt for a striped (RAID 0) setup, ensure you have a secondary RAID as a backup.

 
   
     
  SPECIAL | Save $30 + Free Shipping on LaCie Rugged USB SSD Drive  
   
 

TT | Save $30 + Free Shipping on LaCie Rugged USB 120GB SSD Drive

169.99

Deadlines rule our world. When digital storage is critical for your project, it had better be as fast and reliable as you are. From the desktop to the badlands, it has to connect to any computer, deliver more than enough speed for the most demanding applications, and protect data against any threat.

Save $30 and get free shipping for the next week on the 120GB LaCie solid state drive and start backing up that valuable data!

View

 
     
  SPECIAL | Save $25 + Free Shipping on G-Tech G-Drive Mobile FireWire Drive  
   
 

TT | Save $25 + Free Shipping on G-Tech G-Drive Mobile FireWire Drive

154.99

Easy to set up and Time Machine-ready, so backing up all of those important documents, music, digital video and photos, is easy! Also the G-DRIVE mobile is bus-powered, and that means when you’re on your way out, you don’t need to add an external AC power supply to your laptop case.

Save $25 and get free shipping on this drive for the next week.

View