Custom NSTableViewCell labels not appearing

I’m working on an iPhone app at the moment that is being upgraded from a previous version. I decided early on to just build on the existing code rather than trying to reinvent the wheel.

I’ve spent a bit of time fixing warnings that have cropped up from changes in the iOS SDK (the original app was developed for iOS 2) but one problem in particular had me stumped for a while.

When subclassing NSTableViewCell, the old init method was:
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier

but somewhere along the line the init method definition changed to:
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

I’m yet to find out when this changed occurred, but it left me with the problem of no longer having access to the “frame” parameter. This meant the code in the init method that used to size the views of the custom cell no longer had a point of reference.

It took me a while to figure out that due to this change there was also another new method introduced that now had to be overridden to size the custom cell views:
-(void)layoutSubviews

In this method is where we are now meant to set the size of the custom cell views.

So I commented out the sizing code that used to be in the init method and moved it to the new layoutSubviews method as follows:
-(void)layoutSubviews
{
[super layoutSubviews];
CGRect label, steps;
CGRect bounds = [[self contentView] bounds];
label.origin.x = 20.0;
label.origin.y = 3.0;
label.size.height = bounds.size.height – (label.origin.y*2);
label.size.width = 160.0;
[dateLabel setFrame:label];

steps.origin.x = 170.0;
steps.origin.y = 5.0;
steps.size.height = bounds.size.height – (steps.origin.y*2);
steps.size.width = 120.0;
[stepsLabel setFrame:steps];
}

This fixed my issue. Running the app now showed the custom cell labels as expected.

Tags: , ,
Posted in Geek / Apple Stuff, iPhone Dev Musings No Comments

UPDATE: Office 2011 Mac – Crashing when copying and pasting

An update to a previous entry
http://www.geeklane.com/2011/07/06/office-2011-mac-–-crashing-when-copying-and-pasting/

I asked the user today if their version of Word was still crashing and they said it wasn’t. Seems that one check box is the problem.

Weird.

Tags: , , ,
Posted in Geek / Apple Stuff No Comments

Word 2011 – Share as Email Attatchment

I recently had a staff member who was having trouble emailing word documents from within Word. To be honest I never actually realised you could do this. I’d never even thought about trying it.

Anyway, Word 2011 has a feature under the “File -> Share” menu that allows you to email the current document as an attachment.

The staff member was trying to use it with Outlook 2011, but the email kept being created in Mac Mail. I went into Mac Mail preferences and made sure Outlook 2011 was the default email client. I thought this was a systemwide setting and that other applications would use the setting when trying to send email.

Turns out that Word 2011 doesn’t use this setting as even with it set to Outlook, it still kept trying to use Mac Mail.

It was then that I discovered that Outlook 2011 has a setting under preferences -> general, that sets Outlook as the default email client.

We clicked this button and tried again and it worked.

So, why doesn’t Word 2011 use the default as set by Mac Mail? Why do I have to set it in Outlook for it to take notice? Seems a little strange to me.

Tags: , , ,
Posted in Geek / Apple Stuff No Comments

Deploying SCCM OSD image to mac bootcamp partition

I’ve spent a good part of the last week trying to get the unis windows 7 MOE to install on a bootcamp partition. Little did I know when I started that it was a complicated process with obstacles all along the way.

To cut a long story short I could not find a way to get the iMac to boot and pull the SCCM image via the network. I even tried booting from a set of SCCM OSD dvds that the sys admin guys burnt. That too didn’t work and kept bugging out when the SCCM installer would try to set the windows partition to be active.

So…. In the end the solution that worked is as follows:
* Run bootcamp assistant to setup the partition
* Insert a standard windows installation DVD and reboot
* Hold down the “Option” key to get a boot menu
* Select the dvd and then press the “Space bar” until the windows menu appears (See previous blog on why pressing space is needed)
* Install windows, use generic info because this install will be getting overwritten with the SCCM image soon.
* Once installed, insert the SCCM OSD disk and run the autorun.
* SCCM installer will kick off and start staging the image for deployment.
* System will reboot and installation will kick off

Doing it this way seems to get around the “Setting the partition active” problem. I guess if windows is already installed then the SCCM OSD installer just skips trying to set the partition as active.

So I managed to get the unis windows 7 SCCM image deployed to a bootcamp partition of an iMac. Monday will be time to kick DeployStudio into gear and create the dual boot master images. Then try to deploy it out to some other test systems.

Everything going ok I’m hoping to be deploying dual boot images to macs by the end of next week.

After that, it’s on to setting up Munki and getting it working.

Tags: , , , ,
Posted in Geek / Apple Stuff 2 Comments

Office 2011 Mac – Crashing when copying and pasting

I have a user at work who has been having constant and regular issues with Word 2011. I couldn’t really narrow it down but it will just crash and he will lose his work.

The common action he did when the crash happened was to cut/copy + paste.

Once again, trawling google and forums seems to have provided a solution (and yet again the actual microsoft support suggestions are useless).

In this case I got him to:
* Click the “Word” menu and choose “Preferences”
* In the window that opens, click “Edit” under the “Authoring and Proofing Tools” section
* The “Edit” window loads. About half way down is an option called “Use smart cut and paste”
* Untick this option so it’s NOT selected.
* Click “OK”
* Restart Word (cause microsoft stuff seems to like that)
* See how it goes.

I haven’t heard back from the user in 4 days, so for me that’s another issue solved.

Tags: , ,
Posted in Geek / Apple Stuff, General 1 Comment

Book Update

I recently finished book 1 of the “A Game of Thrones” story. The book was awesome. The second half of the book seems to fly past and I’m keen to get stuck into the next book.

I have taken a slight detour though from the second book and instead I’m reading “The man who mistook his wife for a hat” by Oliver Sacks. It’s an amazing book with unbelievable stories. Really makes me think about what the human brain and body is capable of. I’m halfway through it already and it’s a pretty easy read.

I’ve also placed another book order with Amazon UK. I’ve got quite a long reading list now but I think that’s good.

One interesting side effect from regularly reading is that I seem to be having (and remembering) dreams when I sleet. Really vivid dreams. It’s good.

Tags: ,
Posted in Books, Hobbies No Comments

Bootcamp – Flashing cursor when booting

I’m currently building a dual boot MOE image for our mac labs and came across a weird problem when trying to install windows 7 under bootcamp.

The bootcamp assistant would run fine, partition the drive then reboot. I had a windows 7 cd in the drive but the iMac would just reboot and display a black screen with a flashing white cursor in the top left corner of the display.

I trawled support forums for a few days looking for ideas but non of the many suggested worked until I tried the following:

  • Run the bootcamp assistant as normal, partition the drive etc
  • Start the iMac
  • Hold down the “Option” key to get the boot menu
  • Choose the windows installation DVD
  • As soon as you choose it, start tapping the space bar
  • A screen should appear with a windows style boot menu where you can select the windows installation and away it goes.

From there the windows installation kicked off and worked as expected.

Tags: , , , ,
Posted in Geek / Apple Stuff 1 Comment

Reading books

Recently ordered and received 16 books from Amazon in the UK. I’ve been enjoying reading books on my iPad but I kind of missed the feeling of a paper book and strangely enough I missed the smell as well.

I couldn’t believe how much cheaper it is to buy books from overseas. The order I did worked out to be around $130 AUD total (that includes shipping). That works out to be easily half the price of what I would have paid if I bought them from Australia. What’s up with that?

As an example I bought all the current books of the “A Game of Thrones” series. Four books in total. The cost of 3 books from the UK worked out cheaper than a single book if I was to purchase it in Australia.

I guess I just don’t understand why, with the current high Australian dollar, we are still paying a premium for most items.

Needless to say, its not surprising that Australian book retail stores are going out of business.

Tags: ,
Posted in Hobbies No Comments

Office 2011 Mac – Crashing when inserting symbols

Had a job today where Word 2011 for mac would freeze / crash every time the user chose to insert a symbol.

As usual, the Microsoft help was useless with the only real suggestions being to repair fonts / clear the users profile (On a side note, this seems to the the generic solution for EVERY Office 2011 problem, even though most of the time it does nothing).

Anyway, I spent a good 2 hours on this until I stumbled across a forum post where a user had solved a similar issue by doing the following:

1) Move the contents of the users ~/Movies folder to the desktop

2) Start Word.

3) Test by trying to insert a symbol.

(This worked!)

4) Move each file that was in the ~/Movies folder back into the ~/Movies folder one at a time, each time starting Word and testing again.

You should eventually find at least 1 movie that is causing the issue.

Now, in my case, I just copied each file back and repeated the steps until I had all the files back. Somehow, the mere act of moving them out then moving them in again fixed the issue for me.

I have no idea why moving them in then out again would fix the issue.

On another side note, Why does it need to scan the ~/Movies folder when inserting a symbol? Sure the panel it uses is the generic “insert” panel which has a media tab, but why does it need to prescan the folder when the user doesn’t even click the media tab? Seems like a lot of extra wasted processing.

I need to check to see if the same is true for the OS X iLife media browser. I don’t recall having such issues with Apple software, so maybe it doesn’t.

I put this down to another silly issue with Office Mac.

Posted in Geek / Apple Stuff 7 Comments

Reply button not working in Outlook 2011 Mac

Had a job today where a user reported that they could not reply to emails.

Checked it out and none of the reply features in Outlook 2011 for mac would work. Reply, Reply All and Forward all didn’t work.

Other toolbar items worked fine.

Console had numerous errors which were indecipherable to me.

Turns out that something weird (great explanation I know) can happen with Outlook 2011 and Safari. Outlook 2011 uses Safari for its reply / forward functions and if that gets corrupted the features stop working.

I was sceptical, but downloaded a new version of Safari and installed it. It worked.

I’ve got to read more about it to see exactly what the link is between Safari and Outlook 2011. Is Outlook 2011 corrupting part of the framework used by Safari and the only way to fix it is to reinstall? Who knows.

Posted in Geek / Apple Stuff 2 Comments

iPad. Thoughts.

I’ve had the iPad for a week now and I really can’t fault it. Battery life is great, it’s snappy, apps just work and the screen is amazing. Even typing on the keyboard isn’t as troublesome as I thought it might be.
Reading email and surfing the web is amazing on the device. It’s perfect for quickly checking email or sitting for long sessions of email sorting. I actually sorted out my gmail account on it pretty fast. The web is snappy and vie had no problems at all with the fact that it doesn’t do flash. I guess none of the sites I visit frequently use flash :P
The only thing I could fault about it is that the books and apple apps aren’t available in Australia yet, so I gotta wait for those.

Posted in Geek / Apple Stuff No Comments

Festival of the Wind 2010

IMG_6436.jpg

IMG_6438.jpg

IMG_6439.jpg

Tags:
Posted in Hobbies No Comments

Green Tree Frog

IMG_6418.jpg

IMG_6422.jpg

IMG_6428.jpg

Tags:
Posted in General No Comments

Lolah

IMG_6401.jpg

IMG_6402.jpg

IMG_6410.jpg

Tags: ,
Posted in House No Comments

America

IMG_5690.jpg

IMG_5602.jpg

IMG_5805.jpg

IMG_5810.jpg

IMG_5936.jpg

IMG_6306.jpg

Tags: ,
Posted in General, Hobbies, Travel No Comments

Renos.. well kinda

Well it wouldn’t be a blog without some kind of “renovation post”, so here goes.

I’m sick to death of the damn palm trees out the back. They would have to be one of the most useless trees around, providing no shade and continually dropping palm fronds on the ground.

Got them booked in to be chopped down in the next few weeks which will be great. Also getting the mango and macadamia nut trees cut back. Seem’s like a full time job keeping the gardens in order. Doesn’t help that it’s so hot in Rocky that the last thing I want to be doing is gardening. Maybe during winter.

I’m also tired of the wireless internet in the house, so I’ve got a fella coming around to give me a quote on running ethernet. With all the network devices running in here, it seems like a logical thing to do.

Will hopefully let me centralise my storage so I don’t have to have a bunch of external hard drives sitting around plugged into everything. Just have a network device plugged in with all the computers / ps3 / beyonwiz accessing the central store. Good times.

Tags: ,
Posted in House No Comments

Frameworks

I’ve become involved in a project at work that requires a website to be built, so I decided to bite the bullet and finally leverage the power of a php framework.

I’m not sure why, but for some reason I had never really embraced development frameworks. I had read about different ones but never really taken the time to download and try to use one.

Google says there are a bunch of different ones, but in the end I decided to have a bash with CodeIgniter. Truth be told, I picked it by going on first impressions of the website.

So far the whole experience has been great. I think the whole MVC design pattern I picked up from OS X development really helped and in a way help solidify the MVC stuff I already knew.

It’s been ridiculously fast to get a basic, decent website up and running and I’m currently working on the whole user authentication side of things.

I spent a few days reading about different authentication libraries and in the end I’ve decided to go with Tank Auth. It seems pretty lightweight and simple, so will be a good start I think. Ideally I’d like to include LDAP support in the web app, but that will come later.

I’m feeling positive about this project. Got someone pushing me all the way so chances are it won’t end up as vapourware like many of the other projects I seem to start and never get finished… sigh… but that’s a whole other blog post.

Tags: ,
Posted in Geek / Apple Stuff No Comments

Random Newcastle Photos

newcastle1.jpg

newcastle2.jpg

newcastle3.jpg

newcastle4.jpg

Tags: , ,
Posted in Hobbies, Travel No Comments

Photos

misc01.jpg

misc02.jpg

misc03.jpg

Posted in Hobbies No Comments

Mandarins

The tree out the back has been producing fruit for a few months now but for some reason the fruit kept falling off the tree when it was still green.

This afternoon I went out and took another look at it and it seems the fruit is now ripening on the tree. I managed to get 17 mandarins off it which actually taste really good.

mandarin.jpg

I’m not sure why they were falling off the tree before while still green. Possibly season / temperature related?

Posted in House No Comments