I purchased a new Retina Macbook Pro as soon as they were available after drooling over them at the Apple World-Wide Developer Conference 2012. I loved the machine but I kept finding myself hitting problems with Wi-Fi connections.
I never seemed to be able to connect to Wi-Fi hotspots as well as my friends or co-workers with slightly older Macbook Pros and, when I was connected, my machine would either keep dropping off the network every few minutes or the speed would drop to an absolute crawl (less than 1Mbps!).
I hunted all over the web trying to find a solution but all I could find were people complaining about the same issue. Finally I found a comment by someone who suggested that deleting their /Library/Preferences/SystemConfiguration folder solved the problem. I was a little nervous so instead of deleting it I renamed it. Sure enough it solved the problem.
Here are the steps:
Quit out of all applications and save any work
Rename your /Library/Preferences/SystemConfiguration folder to /Library/Preferences/SystemConfiguration.backup
Shutdown the machine completely
While off, hold Shift-Control-Option-Power for 8 seconds, then release
If this worked correctly, then nothing should happen (you’ve just cleared the SMC)
Start the MBP back up and log back on
Now when you re-join your Wi-Fi you should see things flying along a lost faster than before.
NOTE: You will lose all your network connection settings, so make sure you back up rather than delete the SystemConfiguration folder
While working on a recent iOS application I found my UITableView showing section headings for sections that did not have any rows in them, i.e. the row-count is zero for that section. I read a lot of different opinions on how to hide the section headings for sections with a zero row-count but in the end it turned out to be quite simple.
It turned out to be as simple as returning nil from the titleForHeaderInSection method and of course, 0 in numberOfRowsInSection
So implement the UITableViewDataSource protocol as usual:
TableViewController.m
123456789101112131415161718192021
-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{// Return the number of sections.return_sections.count;}-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section{// Return the number of rows in the section.return_rowsInSection[section].count;}-(NSString*)tableView:(UITableView*)tableViewtitleForHeaderInSection:(NSInteger)section{return_rowsInSection[section].count?_sections[section]:nil;}-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{// configure your cell}
I don’t know about you, but I am addicted to the ‘new and shiny’. That means I am always on the latest and sometimes not-so-greatest version of every application and tool I use. In the case of Xcode, running beta versions used to be a tricky process thanks to the way Xcode used to be packaged. Now however, thanks to the new app bundle distribution mechanism, having side-by-side installations of Xcode is a piece of cake.
As anyone shipping applications to the iOS App Store knows, you may be able to develop on the latest beta (or even Developer Preview) version of Xcode, but in order to submit to the App Store, you need to use a final released version of Xcode. Fortunately there is a command line tool xcode-select that makes switching easy to do, even switching command-line build script paths.
First open Terminal. Then to see which path all the Xcode tools are currently run xcode-select -print-path:
As you can see, all the developer tools are currently set to use the shipping version of Xcode.
To change to the beta installation of Xcode (in this case 4.5DP4) use xcode-select -switch as super user with the path to the other Xcode installation.
To verify this let’s take a look at the path of one of the commonly used Xcode utilities opendiff. If you try to see where opendiff resides, however, you will get an interesting answer:
12
$ which opendiff
/usr/bin/opendiff
You may have expected something a little different there. If you dig a little deeper you see something even stranger:
The opendiff command is actually linked to and therefore calling xcrun instead. it turns out xcrun is another tool that Xcode uses to manage path issues in quite an elegant way.
Try running xcrun -find opendiff and you will get the answer you were probably expecting when you ran which:
Adding a -v gives you the full explanation of what is happening here:
123456789
$ xcrun -v -find opendiff
xcrun: note: opening log file '/var/folders/xg/_f7d3jt955q3vhxyj5xd4zth0000gn/T/xcrun_db.log' with mode 'a'xcrun: note: SDKROOT=''xcrun: note: TOOLCHAINS=''xcrun: note: DEVELOPER_DIR='/Applications/Xcode45-DP4.app/Contents/Developer'xcrun: note: xcrun via opendiff (xcrun)xcrun: note: database key is: opendiff|||/Applications/Xcode45-DP4.app/Contents/Developer|
xcrun: note: lookup resolved in '/var/folders/xg/_f7d3jt955q3vhxyj5xd4zth0000gn/T/xcrun_db' : '/Applications/Xcode45-DP4.app/Contents/Developer/usr/bin/opendiff'/Applications/Xcode45-DP4.app/Contents/Developer/usr/bin/opendiff
As you can see, the Xcode developers have put a lot of work behind the scenes to make transitioning between builds of Xcode, and associated developer tools, as easy as possible.
I hope this has been a useful and maybe a little interesting look at managing side-by-side installations of Xcode on OS X.
Installing and configuring the JIRA plugin for Webstorm is not hard to do and gives great integration into the IDE.
After installing you will end up with an integrated dashboard like this:
To install go to preferences and go down to plugins:
Click on Browse repositories
Then type JIRA in the search box.
Then double click on the Atlassian result.
Now OK all the dialogs.
In the status bar you should see the plug-in installing.
When it has finished you need to restart.
Now you will see an Atlassian button on the tool bar. After a while (on first load it takes time) you will see the list of bugs assigned to you.
There seems to be a bug in jQuery Mobile 1.0 (final) that causes a white full screen flash every time the page transitions to a new page.
It doesn’t manifest if I run the page in mobile Safari but if I run the page as a full-screen app (i.e. creating a shortcut to the web app using “Add to Home Screen” from Safari) and setting the meta tag to
which gets rid of all the browser chrome, then the flashing bug occurs.
Seems there is no fix in the queue yet but a work around has been found. Simply comment out the call to pageTitle.Focus() on line 2326:
123456789101112
//direct focus to the page title, or otherwise first focusable elementfunctionreFocus(page){varpageTitle=page.find(".ui-title:eq(0)");if(pageTitle.length){// MSC comment out next line due to flashing bug on iOS 5 // pageTitle.focus();}else{page.focus();}}
I switched from Windows to a Mac a year and a half ago, but every now and them I want to do something that just seemed so much easier in Windows. In this case, mount a Windows file share so I can access it from the command line (or script it). Turns out it is pretty easy too if you know the special sauce.