SMJobBless error: kSMErrorDomainFramework error 5 - The tool at the specified path is not valid

2012-03-03 Thread Prime Coderama
I writing a PreferencePane project and created a helper tool to perform actions that required an elevated privilege. When I run my Preference Pane, I am getting this error: > System Preferences[22312:903] Bless Error: Error > Domain=kSMErrorDomainFramework Code=5 UserInfo=0x2005790e0 "The operat

NSPreferencePane isSelected error

2012-03-03 Thread Trygve Inda
In my PrefPane I receive a distributed notification from another app and call: [myPane isSelected]; It should return true and it does, unless I have this in my delegate: -(void)didSelect { // it doesn't matter what goes here - even nothing at all results in isSelected returning NO; }

SMJobBless Copy Files subpath for PrefPane projects?

2012-03-03 Thread Prime Coderama
Does anyone know the correct Subpath to use for the Build Phases of the Target application of a PrefPane project? e.g. in an Applications project, the subpath is "Contents/Library/LaunchServices" ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

UISearchBar with keyboardType not working with Thai

2012-03-03 Thread Gerriet M. Denkmann
I have a UISearchBar where in most (not all) cases I want to input numbers. So I have: - (void)viewDidLoad { [super viewDidLoad]; // ... self.mySearchBar.keyboardType = UIKeyboardTypeNumbersAndPunctuation; } This works with English, German, Chinese keyboards: when I cli

Debugging: Take control of another process (gdb-i386-apple-darwin)

2012-03-03 Thread Jeffrey Walton
Hi All, I'm getting the message "gdb-i386-apple-darwin needs to take control of another process for debugging to continue.". Previously, I was getting it for Developer Tools and performed the fix at [1] (sudo dscl . append /Groups/_developer GroupMembership ). Any ideas what group is used for gd

Re: Lion - opening files as a viewer

2012-03-03 Thread Seth Willits
On Mar 3, 2012, at 8:23 PM, Graham Cox wrote: > … Unfortunately on Lion, the autosave feature overwrites the original file, > destroying it, and replacing it with our native format, but with the wrong > extension (it has the original extension). > > Shouldn't setting the role to 'viewer' preven

Running SMJobBless causes kSMErrorDomainFramework error

2012-03-03 Thread Prime Coderama
I am trying to install a helper tool via SMJobBless and it is returning this error: System Preferences[22312:903] Bless Error: Error Domain=kSMErrorDomainFramework Code=5 UserInfo=0x2005790e0 "The operation couldn’t be completed. (kSMErrorDomainFramework error 5 - The tool at the specified path

Lion - opening files as a viewer

2012-03-03 Thread Graham Cox
Our app can open its own native file format, and also another standard file format. The second format is listed in the file types of the app, and the role is set to 'viewer' rather than 'editor'. When this file is opened, a normal document is made but the contents of the file are converted to ou

Re: NSURL and NSRegularExpression

2012-03-03 Thread R
All good, valid and useful points. However, I would at least like to maintain the same functionality of the Twitter App for iPhone. The app does does a pretty good job of detecting and reviewing the URL to determine if it can be assumed to be 20 characters. On Mar 3, 7:16 pm, Conrad Shultz wrot

Re: NSURL and NSRegularExpression

2012-03-03 Thread Conrad Shultz
On 3/3/12 5:48 PM, Jens Alfke wrote: > Look up the hostname. No ping required. As I mentioned in the reply I just posted, even looking up the hostname is potentially problematic. One obvious case that I overlooked in my response: mandatory hostname lookup will cripple your functionality if you do

Re: NSURL and NSRegularExpression

2012-03-03 Thread Per Bull Holmen
Den 02:55 4. mars 2012 skrev Jens Alfke følgende: > > I’d much rather people used a system library, or at least searched around to > find a really good and well-tested regexp that other apps have used. It’s > annoying when an app can’t highlight a URL properly, especially on iOS where > it’s reall

Re: NSURL and NSRegularExpression

2012-03-03 Thread Conrad Shultz
On 3/3/12 5:06 PM, R wrote: > Thanks Conrad, much cleaner indeed. But, this does not solve my > invalid internet URL issues still accepts pretty much any URL. I don't understand what you mean by "invalid." I would expect that NSDataDetector has been pretty thoroughly tested and will not matc

Re: NSURL and NSRegularExpression

2012-03-03 Thread Jens Alfke
On Mar 3, 2012, at 5:42 PM, Per Bull Holmen wrote: > How about just work with your regular expressions > and try to narrow down the patterns it will accept? I’d much rather people used a system library, or at least searched around to find a really good and well-tested regexp that other apps hav

Re: NSURL and NSRegularExpression

2012-03-03 Thread Jens Alfke
On Mar 3, 2012, at 4:15 PM, R wrote: > I'm using NSRegularExpression to build an array of all NSRanges in the > text field that start with "http". I then use NSScanner to scan until > it finds whitespace or end of line characters for each > range.location. I then place this new subString into a

Re: NSURL and NSRegularExpression

2012-03-03 Thread Per Bull Holmen
Den 02:06 4. mars 2012 skrev R følgende: > Thanks Conrad, much cleaner indeed.  But, this does not solve my > invalid internet URL issues still accepts pretty much any URL. Just a little suggestion: How about not trying to be perfect? My mail client (Google mail) also accepts your Bad URL exa

Re: NSURL and NSRegularExpression

2012-03-03 Thread R
Thanks Conrad, much cleaner indeed. But, this does not solve my invalid internet URL issues still accepts pretty much any URL. I'm wondering how Twitter IOS, and TWTweetComposeViewController handles URL counting. On Mar 3, 5:30 pm, Conrad Shultz wrote: > Don't do all this. Use NSDataDetecto

Re: NSURL and NSRegularExpression

2012-03-03 Thread Conrad Shultz
Don't do all this. Use NSDataDetector instead. (Sent from my iPhone.) -- Conrad Shultz On Mar 3, 2012, at 16:15, R wrote: > I'm building a twitter app for the iphone and want to detect valid > internet url's and set their character count to <= 20. > > I'm using NSRegularExpression to build an

NSURL and NSRegularExpression

2012-03-03 Thread R
I'm building a twitter app for the iphone and want to detect valid internet url's and set their character count to <= 20. I'm using NSRegularExpression to build an array of all NSRanges in the text field that start with "http". I then use NSScanner to scan until it finds whitespace or end of line

Re: Image Colours

2012-03-03 Thread Amy Heavey
Thanks everyone for your help, it has certainly given me ideas. The images I'll be using are mainly generated web ready images, which I think will make it easier than photos. I also don't need exact matches, so reducing the colour resolution would probably be a good idea, or perhaps if I use hs

Re: Unclear on -initWithBytesNoCopy:

2012-03-03 Thread Eli Bach2
On Mar 3, 2012, at 12:15 PM, Jens Alfke wrote: > I filed a bug report* saying that this substring optimization shouldn’t be > used if the source string uses an external buffer, just as it shouldn’t if > the source string is mutable. They fixed it, but some people there argue that > their origi

Re: Question on handling very large images

2012-03-03 Thread Marco Tabini
> The problem is that if you do this in a naive way, with a single huge pixmap, > you will have poor locality of reference. Once you get to 1024 RGBA pixels > across, every scan-line will occupy its own memory page. So any operation > that crosses lots of scan lines but only uses a small fractio

Re: Image Colours

2012-03-03 Thread Jens Alfke
On Mar 3, 2012, at 5:17 AM, Amy Heavey wrote: > I thought I would do this by analysing each image as it is saved and > calculate the most common pixel colours, probably by analysing each pixel in > the image? and saving the most common colours, perhaps 10 colours. Then I can > see what other i

Re: Unclear on -initWithBytesNoCopy:

2012-03-03 Thread Jens Alfke
On Mar 3, 2012, at 11:28 AM, Dave Keck wrote: > The buffer needs to remain intact until the NSString/NSData object is > deallocated. True; but a strict interpretation of this is that the buffer can _never_ be destroyed, because you can never predict with 100% accuracy when an object is going

Re: Unclear on -initWithBytesNoCopy:

2012-03-03 Thread Dave Keck
Hit send too soon... > The documentation of -[NSData initWithBytesNoCopy:length:freeWhenDone:] and > of -[NSString initWithBytesNoCopy:length:encoding:freeWhenDone:] is unclear > about the case where freeWhenDone is NO. The data/string object then does not > take ownership of the memory buffer,

Re: Unclear on -initWithBytesNoCopy:

2012-03-03 Thread Dave Keck
> The documentation of -[NSData initWithBytesNoCopy:length:freeWhenDone:] and > of -[NSString initWithBytesNoCopy:length:encoding:freeWhenDone:] is unclear > about the case where freeWhenDone is NO. The data/string object then does not > take ownership of the memory buffer, so the question is: H

Unclear on -initWithBytesNoCopy:

2012-03-03 Thread Jens Alfke
The documentation of -[NSData initWithBytesNoCopy:length:freeWhenDone:] and of -[NSString initWithBytesNoCopy:length:encoding:freeWhenDone:] is unclear about the case where freeWhenDone is NO. The data/string object then does not take ownership of the memory buffer, so the question is: How long

Re: How are views supposed to reload after being nillified by memory warnings?

2012-03-03 Thread Matt Neuburg
On Fri, 02 Mar 2012 10:17:43 -0800, David Duncan said: >On Mar 2, 2012, at 1:28 AM, G S wrote: > >In the vast majority of cases where I've seen this behavior, it is because in >your delegate handler for the UIImagePickerController, you assign the returned >image directly to a UIImageView that yo

Re: Image Colours

2012-03-03 Thread Tim Ramsey
If you are prepared to do some complex mathematical programming Fukinaga's Mean-Shift algorithm provides an interesting approach. It analyses pixels in an image and drives similar values to be the same. The result is an image with colors flattened to produce blobs of identical color regions. It

Re: Image Colours

2012-03-03 Thread Alvaro Costa Neto
Hi Amy, how are you? Sounds quite right to me. There is one catch, though: the definition of "dominant color". If you just count the number of pixels with certain colors and grab the top 10, it may not result in what you want. To our eyes, the most dominant color is, usually, the one that has t

Re: textfield problem

2012-03-03 Thread Michael Paluszek
I had a problem where another element covered the text entry field. That part of the other element was transparent so it was hard to see that it was blocking the text entry. Sincerely, Mike On Mar 3, 2012, at 7:28 AM, gmail wrote: > When I got a similar problem, I had by mistake covered the t

Image Colours

2012-03-03 Thread Amy Heavey
Hi, I've got an app that is a custom app for me and my home business, it's not something commercial. It's a core data app and some of the entities have images associated with them. The images themselves are stored separately, and the coredata datastore stores the reference to them. What

Re: textfield problem

2012-03-03 Thread gmail
When I got a similar problem, I had by mistake covered the text field with the other view. It was just my case, though. norio On 2012/03/03, at 5:35, "H. Miersch" wrote: > hello. > i have a problem with a text field that won't accept any input. the textfield > is one of three on a panel tha

Re: Can't get same window to show twice

2012-03-03 Thread Ken Thomases
On Mar 2, 2012, at 4:34 AM, -Sergei G- wrote: > 1st time I click on menu item I see the window. I then use close button. > Click on the same menu item and get nothing. Action handler executes, but I > see no window. > > In app delegate: > > @property (strong, nonatomic) NSWindowController *myW

Re: textfield problem

2012-03-03 Thread Ken Thomases
On Mar 3, 2012, at 3:17 AM, H. Miersch wrote: >> Does the panel have a title bar or resize indicator -- not when it's running >> as a sheet, but in its style mask? See the documentation for -[NSWindow >> canBecomeKeyWindow]. > > as i said in my previous email, i re-did it using a window. and t

Can't get same window to show twice

2012-03-03 Thread -Sergei G-
1st time I click on menu item I see the window. I then use close button. Click on the same menu item and get nothing. Action handler executes, but I see no window. In app delegate: @property (strong, nonatomic) NSWindowController *myWindowController; - (IBAction)openSingleWindow:(id)sender {

Re: textfield problem

2012-03-03 Thread H. Miersch
> Is anything written to console when the panel is loaded or when you attempt > to start editing in the text field? no console output. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: textfield problem

2012-03-03 Thread H. Miersch
> Is the text field configured with Refuses First Responder? no. > Does the panel have a title bar or resize indicator -- not when it's running > as a sheet, but in its style mask? See the documentation for -[NSWindow > canBecomeKeyWindow]. as i said in my previous email, i re-did it using a

Re: textfield problem

2012-03-03 Thread H. Miersch
> Did you use a NSPanel for the sheet? Use a NSWindow instead, since NSPanels > can have special first-responder behavior. yes, i did. and today i deleted the panel and recreated it with a window instead of a panel. unfortunately, that didn't solve the problem :-( ___

Re: textfield problem

2012-03-03 Thread H. Miersch
> Do you have a value binding for the field? no, i don't really know how to use bindings. > If so, is "Conditionally sets editable" checked? i went in there and "Conditionally sets editable" was checked but greyed out. so i turned on the value binding and unchecked "Conditionally sets editable"

Re: textfield problem

2012-03-03 Thread Ken Thomases
On Mar 2, 2012, at 2:35 PM, H. Miersch wrote: > i have a problem with a text field that won't accept any input. the textfield > is one of three on a panel that appears only when the input is needed. I > activate the panel with this line:[app beginSheet:Sheet > modalForWindow:mainWindow moda

Re: iOS UI control type terminology/name question

2012-03-03 Thread Conrad Shultz
On 3/2/12 1:50 PM, Alex Zavatone wrote: > Hi all. I'm currently reviewing some code I'm going to revamp and > I'm afraid that my brain emptied out when I needed it most. > > I'm trying to remember the name of a type of control that is like a > UITabBar, but allows the user to drag scroll the butt