Geek / Apple Stuff

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 2 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 »

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 »

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 »

SPAM!

Inbox — geeklane (285 messages, 278 unread).jpg

Didn’t check my email over the weekend. I really need to get a spam solution working. *sigh*

Posted in Geek / Apple Stuff No Comments »

Mails new features

Was thinking tonight about the new features bought to mail with the release of Leopard. In particular stationary, to do’s and notes. I realised I dont use any of them… and im not sure why.

I guess I’ve just found no real use for them and honestly I can’t say I know anyone who does actually use those features in Mail.

Maybe I need some kind of “Being uber with mail” guide or somthing?

Posted in Geek / Apple Stuff No Comments »

Topological Sort

I’ve been working on a new mac app and recently stumbled across a problem. I had a set of ‘actions’ which each had dependency values. i.e. One ‘action’ had to perform before another ‘action’ could. I needed some way of sorting these ‘actions’ in order to list them in the correct processing order, kinda of like a flowchart.

With the help of Google I found out that this type of problem is actually a graph theory problem which could be solved using a Topological Sort.

It took me a while to get my head around it, but with the help of the algorithm on the wikipedia page I was able to get an Objective-C version written and working in a few hours.

Programming can be frustrating at times, but it’s so rewarding if you stick it out and manage to work out a solution.

Posted in Geek / Apple Stuff No Comments »

DropBox

I’m really digging DropBox at the moment. It works extremely well for syncing random stuff between multiple computers.

The only thing I want to know is why can’t MobileMe be like this?

Posted in Geek / Apple Stuff No Comments »

WordPress for iPhone

Testing wordpress app for iPhone.

Posted in Geek / Apple Stuff No Comments »

Getting things done.. with Things

Things.jpg
I’m the type of person who needs to write things down in order to remember them. I’ve always been a list writer just to keep things organised so I know what I have to do. I’ve tried a number of ways, from paper based lists to text files on the computer but in some ways I got even more unorganised.

The past few months I’ve been using Things, a task management application currently in development by CulturedCode. I’m finding it really good and it serves as a reminder list and also a task management app all in one. I’ve found it really simple to use and keep using, which was always part of the battle with other task management applications I’ve tried.

I’m pretty sure I’ll buy a license for it when it finally goes 1.0, until then I am hanging out for .mac syncing support so I can have my task list on my imac and powerbook with little fuss.

Posted in Geek / Apple Stuff No Comments »

Cleaning keyboard

Cleaned my iMac keyboard on the weekend following the directions at

http://theminiblog.co.uk/archives/2006/11/16/how-to-cleaning-the-apple-keyboard/

It worked really well and was actually really simple. Whole process took maybe 30mins.

Now my clear iMac keyboard is all clean and new again!

Posted in Geek / Apple Stuff No Comments »

WiiFit

WiiFit was released and being a Wii owner I had to get one.

I was a bit skeptical at first (sorry Nintendo), but after using it for the past 3 days I’ve realised how awesome it is. The WiiFit board is really good and is very responsive and the activities in the game are really well thought out and implemented perfectly.

Over the past 3 days I’ve done about 1.5 hours total of the various activities and according to my log I’ve lost 0.5kgs. I’m not sure how accurate that is or whether I was just wearing lighter clothes or didn’t have a stomach full of food. Either way, I’ll take it.

I seem to be a whizz on the hula hoop but I find some of the yoga poses a bit tricky. The other various activities are all fun. I don’t think I’ve done one yet that I haven’t liked.

Only thing I wish it had was a automatic exercise plan generator. So you could basically queue up activities and then do one after the other instead of having to stop after each one and manually pick the next. Would be even better if the ‘trainer’ allocated you a plan of activities to do based on what you had previously done. I think that would make it a bit more random and perhaps push you to do certain activities that you had otherwise been skipping.

Another awesome product form Nintendo though. There’s no doubt about it they definitely know their stuff when it comes to this type of thing. The board works superbly.

Posted in Geek / Apple Stuff 2 Comments »

MSN Messenger 7 for Mac

So there is a new version of MSN messenger out for mac.

http://www.microsoft.com/mac/products/messenger/default.mspx

After previous mention of the mac version being bought up to speed with the windows version I was a little bit excited. I go to the website to check it out and find they have implemented voice and video chat! …. for the corporate contacts only… :-| w..t..f

Where is the voice and video support for regular users wanting to voice and video chat with their friends / family using messenger on windows?

I’m sure the mac people who work on messenger at microsoft have no idea.

Posted in Geek / Apple Stuff 1 Comment »

Mario Kart – Wii

Picked up Mario Kart for the Wii and have been playing it a fair bit.

So far impressions are good. It came bundled with a steering wheel attachment that the Wiimote plugs into, which at first seems fun but I found it soon became very limiting especially when driving in the manual mode.

I imagine it would be a lot of fun using it with a group of people who all have the steering wheel, but for trying to break records and unlock maps you really can’t go past using the Wiimote + Nunchuck.

As far as the game goes, it’s a heck of a lot of fun. A lot of the tracks are re-hased from previous titles on GameCube, N64, DS, etc but that doesn’t really take away from the entertainment value. The addition of bikes is good and adds something new to the Wii version.

There are numerous un-lockable tracks, cars, bikes and characters which gives the game a lot of replay value, but it’s also really fun just racing against over people both locally and online.

Posted in Geek / Apple Stuff No Comments »