I can't say whether Apple designed it this way, but it's been working for me to call registerUnitWithName with the conversion factor and then [theRuler setMeasurementUnits:measurementName] immediately after changing the measurement units.

This works even if you have multiple views using the same registered measurement unit, but with different conversion factors. The setMeasurementUnits method must be copying the conversion factor in effect at the time of the call.

(I hope someone will correct me if I'm doing anything that's not blessed by the Cocoa framework.)

Dave

On Dec 13, 2008, at 8:11 AM, Carlos Eduardo Mello wrote:


On Dec 13, 2008, at 3:17AM, Dave Fernandes wrote:

Not sure if I'm missing your point, but you can always call registerUnitWithName again with the new conversion factor after changing the view scale.

<newbie-sindrome>

With the same unit name? That's weird. Given the method name, and the fact that it's a class method, I had the impression this was a more or less global/permanent setting for the ruler, and that somehow I would need to unregister the unit before defining another one with the same name.

</newbie-sindrome>

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to