“Preparing for Disaster” plus 1 more - Speckyboy Design Magazine Feed |
| Posted: 06 Apr 2012 12:21 AM PDT Imagine waking up one morning, booting up your system and realizing that your hard drive is dead. Or maybe you returned from vacation to see that your office has been flooded. These scenarios would be difficult for anyone. But, for a freelance designer, it could put you out of business. That’s why you need to be prepared for the worst. Having an emergency plan in place is vital for any business. When your business lives on a single computer, your livelihood is at stake. Here are some tips to help you avoid a potential disaster: Back-Up Your Files On-Site and OffThis may seem obvious, but it amazes me how many people still don’t back up their work on a regular basis. With the plethora of back up utilities that are around (I prefer the free tool SyncBackSE), there’s no excuse not to keep your archive current. Windows 7 users even have a utility built in to the OS. Use it to schedule a back up to an external hard drive or USB flash drive each day after you’re done with work.
You should also consider backing up files online as well. That way, you have a second layer of protection if there is a hardware failure or natural disaster. I’ve been a happy user of Mozy for several years, but services like Carbonite and Dropbox are also quite affordable and popular. You can then download any lost files to your system. They even allow you to access your files from a mobile device. What to Back-Up
Of course you’ll want to back up the core files of your websites. But don’t forget about these important files: List of FTP Sites Graphics Photoshop Filters, Brushes, Actions, Custom Shapes Fonts Contracts and Proposals Email Financial/Billing Data Apps & Utilities In ConclusionIt’s easy to say "I’ll get to this another day". Take some advice from someone who has lost pretty much all of the items above at one time or another. Spend an hour or two now to set up a back up schedule. Make sure all of your important files are included. If and when a hardware failure or other disaster strikes, you’ll be glad that you were prepared for the situation. Have any other ideas on preparing for a disaster? Please feel free to share them below! You may also like…Good Old Static HTML Sites Aren’t Dead Yet. Should They Be? → Browse all of our Freelance Articles → |
| Working with Property Lists in Xcode 4.2 Posted: 05 Apr 2012 08:57 AM PDT Property lists are designed specifically for Objective-C apps to store and retain data. These are straight XML files formatted for easy access to bundles and application resources. There isn’t anything overly confusing about Property Lists, but they are unconventional compared to web applications. In this guide I’d like to go over property lists in a bit of detail in relation to Xcode. Both Mac OS X and iOS app developers will find these property lists very handy in aspects of programming. They are also perfect for storing types of object data, such as personal user characteristics(birthdays, friends, e-mail address, etc.). Brief IntroductionProperty lists are also known as plists because of their unique file extension. If you create a new Xcode project and open the “Supporting Files” group you should find a .plist info file with the same name as your project. This stores general app information such as the icon and bundle identifier. Let’s first create a new property list that we can play around with. Right click on the Supporting Files group and select New File… This brings up a dialog box with dozens of options. Regardless of iOS or Mac OS X select the “Resource” section and choose Property List from the available options. Give it a name and Xcode will automatically create this new file and save it into your application folder. Now we have a great place to start! Adding Some DataYou’ll recognize this is a totally blank file that has been created. So let’s get started adding a few rows into our document. If you double-click on the .plist file in your Project Navigator(left-hand column files viewer) this will open it into a new window. I find this is a bit easier to work with since the Xcode app can take up a lot of screen real estate. Now simply right-click or control+click anywhere in the blank document and select Add Row. This creates our first XML entry with the key “New item”. Each item in our document is based upon a key => value pairing. This first row we’ve just created is known as our root item. But you should notice that each row is also setup with a specific data type. There are two core types – containers and static row data. Containers are split between Dictionaries and Arrays and will always contain child rows(the plist document root holds either dictionaries or arrays). Static data is exactly what it sounds like: a row with a set value of information. Typically you would create a set of arrays or dictionaries to hold these different static bits of data. Below are the 5 different types you can choose from:
Dictionaries vs. ArraysThis interesting idea has popped up on more than one occasion. By default Xcode 4 will create your property lists running with new dictionary items. The difference between dicts and arrays is that each dictionary row is given a unique key name. Arrays just get the objects numerically so you can loop through them in code. It’s annoying when you have to change between these two types of containers since Xcode doesn’t offer an easy solution. But now let’s change our “New item” into an array so our document doesn’t rely on Keys. Editing the Source CodeClose the new opened window and move back into the main Xcode interface. Right-click or control+click on our plist and select Open As -> Source Code. This allows us to directly edit the XML content which is currently the only way to change from the default dictionary listing. Look at the structure we have setup currently and you’ll see a tag wrapped <plist version="1.0"> <array> <key>New item</key> <integer>0</integer> </array> </plist> If we switch back to Property List view you’ll see our row is now indexed as “Item 0″. Now if we go to add in new rows they will automatically fill in the key name incrementing by +1 each time. This is my preferred method of setting up a Property List document since dictionary keys can get very confusing very quickly. Building a Small DemoNow to put this all together I want to build a simple demo we can use for future reference. I’ve created a document named SpeckyPosts.plist which will hold an array of 5 different dictionaries. Inside each dict I’ve added 3 static rows of data – a blog post title, URL, and number of comments. This is confusing to explain in words but it makes a lot of sense once you look at the code. Basically our root document contains an array with five items, and these items are typecast as dictionaries. Inside each dictionary we have 3 key => value pairs which are postTitle, URL, and comments. You can also copy/paste any of the array items to duplicate content and add more posts into the list. This setup is very easy to format and loop through in your code. If you’d like to take a peek at my example document you can download it here or go through the source code as direct XML. <plist version="1.0"> <array> <dict> <key>postTitle</key> <string>On Tastes, Trends and Personal Styles</string> <key>URL</key> <string>http://speckyboy.com/2012/03/18/on-tastes-trends-and-personal-styles/</string> <key>comments</key> <integer>0</integer> </dict> <dict> <key>postTitle</key> <string>Say Hi To Anchor – A Super-Tiny CMS</string> <key>URL</key> <string>http://speckyboy.com/2012/03/09/say-hi-to-anchor-a-super-tiny-cms/</string> <key>comments</key> <integer>14</integer> </dict> <dict> <key>postTitle</key> <string>A Showcase of Enchanting Vintage Advertisements</string> <key>URL</key> <string>http://speckyboy.com/2012/03/04/a-showcase-of-enchanting-vintage-advertisements/</string> <key>comments</key> <integer>6</integer> </dict> <dict> <key>postTitle</key> <string>The Challenge of Responsive Images</string> <key>URL</key> <string>http://speckyboy.com/2012/03/05/the-challenge-of-responsive-images/</string> <key>comments</key> <integer>5</integer> </dict> <dict> <key>postTitle</key> <string>How to Build a Sliding One Page Portfolio with jQuery</string> <key>URL</key> <string>http://speckyboy.com/2011/10/12/how-to-build-a-sliding-one-page-portfolio-with-jquery/</string> <key>comments</key> <integer>27</integer> </dict> </array> </plist> Useful ResourcesIf you’d like to explore plists further on your own then check out some of the links below. There are tons of tutorials & websites you can browse, and even web forums where developers are happy to answer some of your more detailed questions.
ConclusionI hope this introduction to plists has peaked your interest in Xcode and app development altogether. Apple’s NeXTSTEP library is full of unique code examples just like this. It takes a bit of practice getting used to these methodologies at first. But following standards will streamline your development process and make debugging a whole lot easier. You might also like…Tips for Wireframing a Usable Mobile App Interface → |
| You are subscribed to email updates from Speckyboy Design Magazine To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |
Keine Kommentare:
Kommentar veröffentlichen