I just realized I forgot to post this. It’s not pretty, in that it doesn’t look nice. It was done through OfficePoolManager. I couldn’t find an online tool that allowed you to pick your teams like they have for March Madness and the NHL playoffs.
Author Archives: Norm
UITextView Padding
If you align a UITextView with another element, particularly a UILabel, using Auto Layout you will notice the text in the UITextView is slightly indented. The UITextView is actually implemented inside an NSTextContainer which has some padding around it. To remove this (left/right) padding, set the following property of the UITextView to zero:
textView.textContainer.lineFragmentPadding = 0
NHL Playoff Bracket 2016
Embedded Content Contains Swift Code
Ran into this error today:
dyld: Library not loaded: @rpath/libswiftCore.dylib
It was solved by changing the Build Option:
Embedded Content Contains Swift Code to Yes
The project in question was Objective-C based but had an embedded project (Charts) written in Swift.
March Madness Bracket 2016
Malware on the (Chinese) App Store
Here is a comment I wrote regarding the recent discover of apps containing malware on the Chinese App Store.
1. This is the first such event in over 7 years (and Billions of downloads) of the App Store’s existence, unlike the almost daily occurrence on other platforms.
2. You correctly didn’t echo the false and sensationalized comments of an “attack” on the App Store, as there was no attack.
3. This was limited to Chinese developers circumventing several Apple safeguards. Not that Apple shouldn’t be able to (ultimately) catch this, and they did, but developers should know better than to turn off Gatekeeper, download Xcode from unauthorized servers, and then not check it’s authenticity. Any of these measures would have prevented such an occurrence.
4. Not making excuses but given the security measures within the iOS environment, these apps did virtually no damage. Here’s a quote: Palo Alto Networks Director of Threat Intelligence Ryan Olson claims the impact was likely negligible, with no reports data theft, or “other harm.”
Solving iTunes 3014 Error
For whatever reason, probably because I do iPhone development and am always installing “stuff” on my computer and iOS devices, I’ve run into the dreaded iTunes 3014 error consistently when trying to restore my iPhone/iPad to put a new OS on it. I swear I tried this before and it didn’t work but I just followed the steps below and everything is updating nicely. iOS 9 GM!
- Open Terminal and cd to the /etc folder.
- Using your editor of choice, mine is nano, open the hosts file (
sudo nano hosts
). - Enter your password.
- Add the following line to the bottom of the file:
17.151.36.30 gs.apple.com
- Write out/save the hosts file and exit (ctrl-O then ctrl-X for nano).
- Finally, flush the DNS cache with this command:
dscacheutil -flushcache
- All done!
Encoding a URL in iOS 9
The typical way to encode URLs (e.g. turn spaces into %20) was to use NSString’s
stringByAddingPercentEscapesUsingEncoding:
NSUTF8StringEncoding
As you may have noticed, that method has been deprecated in iOS 9. You now need to use
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet
which takes an NSCharacterSet as it’s argument. What NSCharacterSet am I supposed to use you may ask. I recently ran into this and found the following worked for me:
[NSCharacterSet URLFragmentAllowedCharacterSet]
The relevant Apple documentation can be found here.
Ctrl-drag to Create Outlets in Custom Views
If anyone can tell me why Xcode (I’m using Xcode 7 beta 5) works this way, I’d greatly appreciate. I have created custom table view cells in the past and I’ve always control-dragged from my storyboard into the custom class to create the outlets. So, when I went to create outlets for a custom (ui)view I’m working on, I was stumped when I couldn’t ctrl-drag into the .h or .m file to create them (outlets or actions).
[Yes, I have all the relevant custom classes specified in the Identity inspector.]
The workaround is to type in the outlet/action code by hand. Once you have entered in your custom class file, you can connect the outlets/actions by dragging from the little dot (do these things have a special name?) Xcode puts in the line number gutter to the relevant UI element. What a pain in the ass.
</endOfXcodeRantForToday>
WordPress Menu Button on Mobile
A quick note regarding WordPress and its Menu button on mobile devices (mobile Safari for sure, others possibly). I’ve been trying to update this site a little and added a Books page to highlight the book I’m currently reading, along with books I’ve read over the last year. I decided to track the books using Pinterest and figured out how to post a Pin and a Board on a page. I decided I should check my handy work on my iPhone and quickly realized the “Menu” button didn’t work. Hmm…
As it turns out, WordPress updated the CSS tag used for the Menu button in their Twenty Twelve theme’s header.php file. So, if you have a child theme like I do and didn’t know about this update, your Menu button is no longer working.
Fortunately, it’s a very quick fix. Open the header.php in your child theme folder and replace the following line of code:
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
with:
<button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
The navigation.js file was (also) updated to look for this new tag, which is why <h3> doesn’t work anymore. That’s it, all should be working again.