Re: Representation of strings with special chars

2011-08-25 Thread Andreas Grosam
On Aug 26, 2011, at 2:02 AM, Glenn L. Austin wrote: > > On Aug 25, 2011, at 2:03 PM, Alexander Reichstadt wrote: > >> Hi, >> >> Thank you for your many responses. >> >>> const char *cstr = [s UTF8String]; >>> mysql_stmt_prepare(myStatement, cstr, strlen(cstr)); >> >> >> This fixed the bug

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Mark Munz
The description of what you're trying to do is a bit vague, but couldn't you just create an NSToolbarItem with a custom view? You might need to do a few tweaks if it needs to resize with the window, but that sure seems easier than trying to circumvent the framework as you are describing. You'd be a

Re: "iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Jens Alfke
On Aug 25, 2011, at 10:37 PM, David Dengg wrote: > I checked the file by hand and found one corrupt song. The "Name" and > "Location" were just garbage strings. I deleted the entry and its fine now. Oh, interesting — sounds like iTunes isn’t properly escaping some of the characters in the nam

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Jens Alfke
On Aug 25, 2011, at 9:18 PM, Joar Wingfors wrote: > Prior to Mac OS X 10.6 you can use "aliases", which have been around since > before Mac OS X: > > > The Alias Manager is a

Re: "iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread David Dengg
Thanks I tried that but NSPropertyListSerialization just says the same thing: its a malformed plist. I checked the file by hand and found one corrupt song. The "Name" and "Location" were just garbage strings. I deleted the entry and its fine now. I send the customer the file without the malforme

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
Is there any other way to do this aside from what I'm doing right now? As far as I know, I have two choices: a) Use this method and risk something breaking b) Write an NSToolbar clone I know the risks, but if I could get this to pass through Mac App Store submission then I'd rather deal with po

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Quincey Morris
Ah, well, yes, if IB doesn't expose the class you need, that makes subclassing impractical. But in that case, replacing the NSToolbarView method seems even more undesirable. On Aug 25, 2011, at 20:55 , Indragie Karunaratne wrote: > I'm not sure how I would get NSToolbar to use my subclass of N

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Ron Fleckner
On 26/08/2011, at 2:18 PM, Joar Wingfors wrote: > > On 25 aug 2011, at 21:15, Ron Fleckner wrote: > >> Oh I see now that file reference URLs and bookmarks are 10.6 only. I'm >> making a tool for musicians, most of whom aren't too well off and so I >> target 10.5. Might just have to stick wi

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Joar Wingfors
On 25 aug 2011, at 21:15, Ron Fleckner wrote: > Oh I see now that file reference URLs and bookmarks are 10.6 only. I'm > making a tool for musicians, most of whom aren't too well off and so I target > 10.5. Might just have to stick with paths. Thanks anyway. Prior to Mac OS X 10.6 you can

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Ron Fleckner
Oh I see now that file reference URLs and bookmarks are 10.6 only. I'm making a tool for musicians, most of whom aren't too well off and so I target 10.5. Might just have to stick with paths. Thanks anyway. Ron On 26/08/2011, at 1:46 PM, Josh Abernathy wrote: > Check out file reference URLs

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Ron Fleckner
Looks like just the thing, thanks v much Josh, Ron On 26/08/2011, at 1:46 PM, Josh Abernathy wrote: > Check out file reference URLs and bookmarks: > http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/AccessingFilesandDirectories/AccessingF

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
I'm not sure how I would get NSToolbar to use my subclass of NSToolbarView. I can't set the class of the toolbar *view* itself in IB (nor programatically, as far as I know), because NSToolbarView is a private class that NSToolbar uses to implement the UI. I can of course change the class of the

Re: Persistant reference to file that is not a path?

2011-08-25 Thread Josh Abernathy
Check out file reference URLs and bookmarks: http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/AccessingFilesandDirectories/AccessingFilesandDirectories.html#//apple_ref/doc/uid/TP40010672-CH3-SW5 On Aug 25, 2011, at 11:37 PM, Ron Fleckner

Persistant reference to file that is not a path?

2011-08-25 Thread Ron Fleckner
Hello all, not even sure where to start looking for this, but is there a way to have a reference to a file so that one can open it even after it has moved? That is, without having to save the path as the key to the file. I'd like to be able to allow the user to move files if s/he wants and sti

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Quincey Morris
On Aug 25, 2011, at 19:48 , Indragie Karunaratne wrote: > Based on Corbin's tip, I overrode -hitTest: on NSToolbarView to call NSView's > implementation instead and suddenly everything works. I expected something to > break in NSToolbarView from doing this, but I've tested pretty thoroughly and

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
Based on Corbin's tip, I overrode -hitTest: on NSToolbarView to call NSView's implementation instead and suddenly everything works. I expected something to break in NSToolbarView from doing this, but I've tested pretty thoroughly and there seem to be no issues. I don't know exactly how dangerous

Re: validateMenuItem Not Called for Undo: Menu Item?

2011-08-25 Thread Vik Rubenfeld
Thank you very much, Quincey. That fixed it. On Aug 25, 2011, at 7:00 PM, Quincey Morris wrote: > Configuring the Undo menu item with action 'undo:' tells the frameworks that > this is *the* undo menu item, so it becomes one element of a standard undo UI > mechanism implemented in NSWindow. Un

Re: validateMenuItem Not Called for Undo: Menu Item?

2011-08-25 Thread Quincey Morris
On Aug 25, 2011, at 18:17 , Vik Rubenfeld wrote: > Going through these requirements, it appears my app is fulfulling all of > them. My undo menu item has its Sent Action set to undo: in First Responder. > First Responder at the time of the anomaly is an NSDocument called > myQuestionnaireEdito

validateMenuItem Not Called for Undo: Menu Item?

2011-08-25 Thread Vik Rubenfeld
My validateMenuItem method is never being called for my undo: and redo: menu items, leaving them permanently disabled. From Apple's doc, "Enabling Menu Items": http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MenuList/Articles/EnablingMenuItems.html#//apple_ref/doc/uid/200

Re: Autoscrolling when dragging?

2011-08-25 Thread Graham Cox
On 26/08/2011, at 10:48 AM, Rick Mann wrote: > Hmm. I think I disagree on this point. Two timers makes it very clear what's > going on in the code, and I don't have to worry about the math. Moreover, I > don't enable a rapid timer until it's actually needed. 0.1 second (or so) is definitely n

Re: Autoscrolling when dragging?

2011-08-25 Thread Rick Mann
On Aug 25, 2011, at 17:42 , Graham Cox wrote: > This is no more complicated than having two timers, and will likely be easier > to manage - I've found that adding too many timers to a run loop can end up > hitting performance, but even if it doesn't, it just seems wrong when one > will do. Hm

Re: Autoscrolling when dragging?

2011-08-25 Thread Graham Cox
On 19/08/2011, at 8:49 AM, Rick Mann wrote: > If the user enters the auto-sroll area, start a timer > If they leave the area, invalidate the timer > If the timer fires, then start another, repeating timer that just adjusts the > contentOffset of the scroll view in the appropriate direction > If

Re: Autoscrolling when dragging?

2011-08-25 Thread Matt Neuburg
On Thu, 18 Aug 2011 15:49:29 -0700, Rick Mann said: >Hi, > >I'm implementing drag & drop functionality on one of my views, and I'd like to >autoscroll the containing view when the user lingers near an edge. My book, for which the code examples are downloadable from github, demonstrates one appr

"iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread George Toledo
> > > >> Maybe the file is corrupt. In most cases it can be solved by deleting > the XML file and then making a slight change in iTunes (e.g. rename a song). > The file is then written again soon and should be fine. > > > > Yeah, it’s a strange problem because this file gets rewritten from > scratc

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
This would make more sense if I explained what the view itself was. Long story short, it's a pretty huge (and important) custom control that runs all the way across the toolbar. There are other ways to access the commands (via the application menus + shortcuts) but I would also like to have a co

Re: Representation of strings with special chars

2011-08-25 Thread Glenn L. Austin
On Aug 25, 2011, at 2:03 PM, Alexander Reichstadt wrote: > Hi, > > Thank you for your many responses. > >> const char *cstr = [s UTF8String]; >> mysql_stmt_prepare(myStatement, cstr, strlen(cstr)); > > > This fixed the bug. > > Alexander Just in case the string has a NULL character, I'

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Raleigh Ledet
A contextual menu in a toolbar? Lets think about this for a moment. A) such a command would be hard to discover. Your customers have other ways to activate the same commands right? If not, why not use a popup button here? B) I assume that's because you have an action tied to single click…. why no

trying to make mouse cursor changes when hover an NSImageView

2011-08-25 Thread Wilker
Hi guys, I'm needing to make some linkable images on my software (for my about window), the part related to click and go to link is working fine, but I can't make the cursor change to hand (pointer) when mouse is over it, I tried some approaches like using mouseEntered and mouseExited to handle, b

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
I just need to present a contextual menu from my custom view toolbar item, but NSToolbarView is not passing the right mouse events down, so -menuForEvent: is never called. On 2011-08-25, at 4:27 PM, Corbin Dunn wrote: > ToolbarView overrides hitTest; to do some magic; that is probably the sourc

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Corbin Dunn
ToolbarView overrides hitTest; to do some magic; that is probably the source of your problem. What are you trying to do? corbin On Aug 25, 2011, at 3:14 PM, Indragie Karunaratne wrote: > Just realized something interesting, and remembered a key detail that I > forgot to mention. The view in q

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
Just realized something interesting, and remembered a key detail that I forgot to mention. The view in question is a custom view inside the toolbar of the window. The NSToolbar by default has a contextual menu that appears when the customizable property is set to YES. However, even though there

Re: "iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Manfred Schwind
>> Maybe the file is corrupt. In most cases it can be solved by deleting the >> XML file and then making a slight change in iTunes (e.g. rename a song). The >> file is then written again soon and should be fine. > > Yeah, it’s a strange problem because this file gets rewritten from scratch > al

Re: "iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Jens Alfke
On Aug 25, 2011, at 2:18 PM, Manfred Schwind wrote: > Maybe the file is corrupt. In most cases it can be solved by deleting the XML > file and then making a slight change in iTunes (e.g. rename a song). The file > is then written again soon and should be fine. Yeah, it’s a strange problem beca

Re: Sharing a persistent store between iOS and Mac

2011-08-25 Thread Jens Alfke
On Aug 25, 2011, at 1:30 PM, Fritz Anderson wrote: > My iOS app has to initialize a large, read-only dataset — a 12,000-word > vocabulary with definitions. In my early drafts, with 6000 words, I had it > parse a text file, but that took alarmingly long, and the watchdog timer > would probably

Re: "iTunes Music Library.xml" won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Manfred Schwind
> one of my customers is reporting that my app does not find the "iTunes Music > Library.xml" file. Its there and its filled with data. His iTunes runs fine. > He send me the file and to my eyes it looks fine. The way i load it is with: > > NSDictionary * xmldict = [NSDictionary > dictionaryWit

Re: Representation of strings with special chars

2011-08-25 Thread Alexander Reichstadt
Hi, Thank you for your many responses. >const char *cstr = [s UTF8String]; >mysql_stmt_prepare(myStatement, cstr, strlen(cstr)); This fixed the bug. Alexander Am 24.08.2011 um 22:37 schrieb Greg Parker: > On Aug 24, 2011, at 1:24 PM, Alexander Reichstadt wrote: >> Actually it's a c

Re: Sharing a persistent store between iOS and Mac

2011-08-25 Thread Gerd Knops
On Aug 25, 2011, at 3:30 PM, Fritz Anderson wrote: > iOS 4.3 Simulator, Xcode 4.1, Lion 10.7.1 > > I'm having trouble generating a Core Data store and opening it in an iOS app > (in the Simulator so far). > > My iOS app has to initialize a large, read-only dataset — a 12,000-word > vocabulary

Sharing a persistent store between iOS and Mac

2011-08-25 Thread Fritz Anderson
iOS 4.3 Simulator, Xcode 4.1, Lion 10.7.1 I'm having trouble generating a Core Data store and opening it in an iOS app (in the Simulator so far). My iOS app has to initialize a large, read-only dataset — a 12,000-word vocabulary with definitions. In my early drafts, with 6000 words, I had it p

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
Triple checked, I even copy/pasted the method directly from the docs to make sure: - (void)rightMouseDown:(NSEvent *)theEvent { NSLog(@"right mouse"); [super rightMouseDown:theEvent]; } Could it be something to do with the fact that it's a layer hosting view? I don't see how that would

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Ken Thomases
On Thu, Aug 25, 2011 at 11:45 AM, Indragie Karunaratne wrote: > I have an NSView subclass that I'm trying to capture right clicks in. I > override the rightMouseDown: method but it is never called. Any chance you simply have a typo or misspelling in your method signature? -Ken __

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
I'm on Lion, and I did find this bit in the AppKit Release Notes: NSView now passes unhandled -rightMouseDown: events up the responder chain Prior to 10.7, NSView did not pass unhandled -rightMouseDown: events up the responder chain. On 10.7, NSView passes -rightMouseDown: up the responder chain

Re: New allowsExternalBinaryDataStorage in Core Data

2011-08-25 Thread Frédéric Testuz
Thanks, Then for application where the user can choose the location of document, you can use it safely only if the store is in a package. If the document is moved/copied, the extern data are also moved/copied. I had made some test with stores in the Desktop and after your reply I had found man

Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Kyle Sluder
On Thu, Aug 25, 2011 at 11:45 AM, Indragie Karunaratne wrote: > I have an NSView subclass that I'm trying to capture right clicks in. I > override the rightMouseDown: method but it is never called. This is the first > time I've come across this issue as it has always worked fine for me before.

rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
I have an NSView subclass that I'm trying to capture right clicks in. I override the rightMouseDown: method but it is never called. This is the first time I've come across this issue as it has always worked fine for me before. All of the other mouse event methods (mouseDown:, mouseUp:, mouseDrag

rightMouseDown: never called in NSView subclass

2011-08-25 Thread Indragie Karunaratne
I have an NSView subclass that I'm trying to capture right clicks in. I override the rightMouseDown: method but it is never called. This is the first time I've come across this issue as it has always worked fine for me before. All of the other mouse event methods (mouseDown:, mouseUp:, mouseDrag

Re: New allowsExternalBinaryDataStorage in Core Data

2011-08-25 Thread Steven Vandeweghe
It seems that when the image (or data in general) is larger than 1MB, it's stored in a hidden folder in the same place as your main database. For example, if the application is called MyLionApp and its persistent store is located in the ~/Library/MyLionApp folder, the external files would be sto

Re: Crash using NSOpenPanel TFSVolumeInfo::GetSyncGCDQueue[SOLVED]

2011-08-25 Thread jonat...@mugginsoft.com
On 22 Aug 2011, at 08:30, jonat...@mugginsoft.com wrote: > From time to time I experience the following crash when displaying > NSOpenPanel on Lion in a GC app. > It has prior form according to > http://www.cocoabuilder.com/archive/cocoa/283840-odd-crash.html > > Does anyone have any recent in