WWDC 2015 Rumours

Lots of rumours about what’s going to be announced at WWDC this June with Mac Rumours having a pretty complete roundup (http://www.macrumors.com/roundup/wwdc/). Yet again the prospect of an SDK for the Apple TV is mentioned. Pretty sure if we had a pound for every time this was touted as a rumour, we’d be able to afford a Mac Pro. And a keyboard.

So, probably a lock is iOS 9 and a new version of OS X although having a versions of iOS and OS X that focus a little more on stability and performance would be a welcome change.

We’d like to see some more stability on Swift after a few nasty bugs reared up to bite us since last year on a couple of projects (one that necessitated a rewrite of a few classes in Obj-C) and an improvement in some areas in Xcode around refactoring and generally being more useful (like AppCode is).

Posted in Uncategorized

So, yeah blogging.

Yeah, we’re not great at blogging are we? Too busy making great stuff in the mobile, e/m-commerce and wearables spaces.

Like:

Heart rate on iOS, Pebble and Chromecast

Heart rate on iOS, Pebble and Chromecast

Posted in Uncategorized

Google I/O Announcements

It’s the Google I/O developer conference in San Francisco this week and we’re keeping up to date with the latest announcements!

  • 900million Android activations with 48 billion apps downloaded
  • new App Translation services offers pro localisation services from the Developer Console
  • beta testing and staged rollouts using Google Plus groups
  • Android Studio announced: an IDE for Android development built in IntelliJ
  • Cross platform Google Play services: multiplayer, cloud saving and achievements
  • Google Cloud Messaging supports upstream messaging, persistent connections and synchronisation of message states
  • Samsung S4 with stock Android coming 26th June
  • new Google Music subscription service
  • Google Play for Education: apps for young children
  • 41 new Google Plus features
  • new version of Google Maps
Tagged with:
Posted in Android, Google

UITableViewCell and InterfaceBuilder

Originally posted in 2009 – the world has moved on since this was posted, you should be using storyboards!

The UITableViewCell is great for laying out information to be displayed in a UITableView (obviously), but there doesn’t seem to be a simple way of getting the NIB you have created within the Interface Builder and your UITableViewCell. Thankfully, it’s quite simple.

Create your UITableViewCell

@interface MyTableViewCell : UITableViewCell {
    IBOutlet UILabel *exampleLabel;
}

And add a layoutSubviews method within the implementation section; ie -

- (void)layoutSubviews {
    exampleLabel.text = @"This is my example!";

    /*
        You may also have a little more control over your font here also
    */
    exampleLabel.font = [UIFont boldSystemFontOfSize:12.0];
}

Now, create a new empty XIB file and call it whatever you want – I will use MyTableViewCell to match the Obj-C class. Open this XIB up using Interface Builder and look at the two items in the doc window: File’s Owner and First Responder. In the inspector, change the File’s Owner class to be UIViewController if this isn’t already set. From the library, drag a Table View Cell into the doc window after the First Responder. Change the class of this new Table View Cell to be MyTableViewCell. Now associate the main view with the Table View Cell by clicking on File Owner and then on the Connections Inspector on the entry for ‘view’, drag a line from the empty circle at the end of this line onto the ‘My Table View Cell’ entry in the doc window.

OK, now let’s set up the label. Double click on the ‘My Table View Cell’ entry in the doc window. Drag a label from the library into the view of ‘My Table View Cell’ that should have been opened. Within the outlets group in the connections inspector for the table view cell, drag a line from the circle at the end of the ‘exampleLabel’ line onto the label we just added to the table cell. Save the view.

That’s all great, but we haven’t yet told our code how to load up the XIB for this table cell view yet. We need to have a view controller conforming to the UITableViewDelegate and UITableViewDataSource protocols (which we won’t go into here). Within the ‘- (UITableViewCell *)tableView:(UITableView *)TableView cellForRowAtIndexPath:(NSIndexPath *)indexPath’ method, we need to create our UITableViewCell implementation.

- (UITableViewCell *)tableView:(UITableView *)tableView 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	static NSString *MyIdentifier = @"MyTableViewCell";

	MyTableViewCell *cell = 
            (MyTableViewCell *)[inTableView dequeueReusableCellWithIdentifier:MyIdentifier];

	if (cell == nil) {
		UIViewController *c = [[UIViewController alloc] 
                        initWithNibName:@"MyTableViewCell" bundle:nil];

		cell = (MyTableViewCell *)c.view;
		[c autorelease]; // updated from release

                // code here to set whatever values in MyTableViewCell
	}

	return cell;
}

Obviously this is a pretty basic example, but the code follows the same principle for all other elements you may wish to add to your UITableViewCell.

Tagged with: , , ,
Posted in iOS