How to add command line arguments in Xcode 5
Same as in Xcode 4 – find the following commands from the Main Menu: Product Scheme – Edit Scheme find Run in the left hand column click the Arguments tab
Same as in Xcode 4 – find the following commands from the Main Menu: Product Scheme – Edit Scheme find Run in the left hand column click the Arguments tab
There are two ways to determine this: at runtime (i.e. in your running code), and at compile time (i.e. before the code is compiled). Let’s take a look at both options. Runtime Check // testing for 64bit at runtime if (sizeof(void*) == 4) { self.textLabel.text = @”You’re running in 32 bit”; } else if (sizeof(void*) […]
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); […]
Our NSFetchedResultsController can take care of this too:
– (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if ([[self.fetchedResultsController sections] count] > 0) {
id <NSFetchedRes…
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 […]
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 […]
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 […]
You can store a UIImage (or an NSImage on Mac) as raw data. This can be useful if you’d like to save this in Core Data. Here’s how you convert a UIImage into NSData: NSData *imageData = UIImagePNGRepresentation(yourImage); To convert NSData back to a UIImage, you can do this: UIImage *image = [[UIImage alloc]initWithData:yourData]; The […]