objective-c

CoreLocation AttributeError

CoreLocation AttributeError Question: I am trying to find my Mac’s current location using the following python script. It is using the python objective-C bridge and it works sometimes. However sometimes I am getting the following AttributeError and I’m unsure what I should do to fix the error. #!/usr/bin/python # encoding: utf-8 import CoreLocation manager = …

Total answers: 2

system wide shortcut for Mac OS X

system wide shortcut for Mac OS X Question: So I was asked to port some internal helper applications to Mac OS X 10.7. Works all quite welll as the platform dependent code is minimal anyhow, but one application needs a system wide shortcut to function (i.e. RegisterHotkey functionality) and I can’t find any documentation on …

Total answers: 4

Objective-C (cocoa) equivalent to python's endswith/beginswith

Objective-C (cocoa) equivalent to python's endswith/beginswith Question: Python has string.startswith() and string.endswith() functions which are pretty useful. What NSString methods can I use to have the same function? Asked By: prosseek || Source Answers: You want the hasPrefix and hasSuffix messages. I tend to also use the compare:options: message pretty regularly to achieve the same …

Total answers: 3

Get the title of the current active Window/Document in Mac OS X

Get the title of the current active Window/Document in Mac OS X Question: Refering to a previously asked question, I would like to know how to get the title of the current active document. I tried the script mention in the answers to the question above. This works, but only gives me the name of …

Total answers: 4