How to create an NSDate object from a string such as 22/04/2013

Here’s how we can do this, with the help of our old friend the NSDateFormatter: // here we have a date NSString *dateString = @”11/01/1989″; // convert it into an NSDate object NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@”dd/MM/yyyy”]; NSDate *theDate = [formatter dateFromString:dateString]; // so what is that? NSLog(@”Your Date Object is %@”, theDate); […]

How to receive Code Support from Apple for Xcode Projects

I didn’t realise that Apple offer professional support for people like you and me. An engineer will work directly with your problem on a per-incident basis, for only $50 per session. This is an invaluable resource if you’re stuck with a problem that neither forums nor Google can solve. You need to be an Apple […]

How to create a Fetched Results Controller

The NSFetchedResultsController makes populating UITableViews a breeze. I keep forgetting how to set those up, so here’s a quick list on how to create those: create a Fetch Request create the Fetched Results Controller with the Fetch Reuqest execute the Fetch The Fetch Request itself needs: a Managed Object Model an Entity Name (i.e. what […]

How to use a provided store file with Core Data

Apple’s recommended method for dealing with “bring your own store files” for Core Data is to copy the store file into your app’s Documents directory, where it can be accessed for read and write queries. However, if you don’t need to write to your store file, then you can also add a provided store file […]

How to open the web interface ports for Plesk on CentOS

After installing Parallels Plesk on a fresh server you may need to open ports 8443 and 8447 to access the web interface. These ports are not open by default. If your installation went fine but you can’t access Plesk in your browser via https://yourdomain.com:8443 then it’s likely that those ports aren’t open. Port 8443 is … Read more

How to list installed packages on CentOS

yum can help us here. This should do the trick: #yum list installed If you’re interested in a particular package, you can pipe a search string into grep and only list filtered results: #yum list installed | grep “yum” keyutils-libs.i686 1.4-4.el6 @anaconda-CentOS-201303020136.i386/6.4 yum.noarch 3.2.29-40.el6.centos yum-metadata-parser.i686 yum-plugin-fastestmirror.noarch The search string doesn’t even need to be in … Read more

How to find my own IP address in CentOS

Two commands come to the rescue: ip and ifconfig. Either does the trick: #ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:19:99:0D:D2:58 inet addr:87.106.181.234 Bcast:87.106.181.234 Mask:255.255.255.255 inet6 addr: fe80::219:99ff:fe0d:d258/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14022830 errors:1 dropped:0 overruns:0 frame:1 TX packets:17605482 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6842851425 (6.3 GiB) TX bytes:22015650673 (20.5 … Read more