Re: Appending CGPath to CGPath

2011-04-15 Thread Roland King
On 16-Apr-2011, at 12:17 PM, Quincey Morris wrote: > On Apr 15, 2011, at 20:55, Roland King wrote: > >> I have a CGPath which represents a small (but somewhat complicated) shape >> and I want to append a number of them together, connected with straight >> lines, to form a complete closed shape

Re: Appending CGPath to CGPath

2011-04-15 Thread Roland King
On 16-Apr-2011, at 12:23 PM, Graham Cox wrote: > > On 16/04/2011, at 1:55 PM, Roland King wrote: > >> I have a CGPath which represents a small (but somewhat complicated) shape >> and I want to append a number of them together, connected with straight >> lines, to form a complete closed shape

Re: Appending CGPath to CGPath

2011-04-15 Thread Graham Cox
On 16/04/2011, at 1:55 PM, Roland King wrote: > I have a CGPath which represents a small (but somewhat complicated) shape and > I want to append a number of them together, connected with straight lines, to > form a complete closed shape which I then want to use as a clip region. I > thought th

Re: Appending CGPath to CGPath

2011-04-15 Thread Quincey Morris
On Apr 15, 2011, at 20:55, Roland King wrote: > I have a CGPath which represents a small (but somewhat complicated) shape and > I want to append a number of them together, connected with straight lines, to > form a complete closed shape which I then want to use as a clip region. I > thought tha

Appending CGPath to CGPath

2011-04-15 Thread Roland King
I have a CGPath which represents a small (but somewhat complicated) shape and I want to append a number of them together, connected with straight lines, to form a complete closed shape which I then want to use as a clip region. I thought that CGPathAddPath would do what I wanted as I can easily

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Scott Anguish
Yes, if it was a situation where that was an issue, I would. But it’s a personal situation, only .mp4s are going to show up. On Apr 15, 2011, at 2:55 PM, Sean McBride wrote: > On Fri, 15 Apr 2011 01:47:56 -0400, Scott Anguish said: > >> if ([[eachPath pathExtension] isEqualToString:@"mp4"]) {

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Scott Anguish
nothing special, the files get copied in order. it’s a really simple app. The goal is to rename the existing directory with the new -APPL extension and then copy new files into that. On Apr 15, 2011, at 9:36 AM, Andy Lee wrote: > Scott, are you copying the files asynchronously? I wonder if the

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Scott Anguish
it actually isn’t in /tmp, that was just an example. it’s done in my home directory. On Apr 15, 2011, at 10:57 AM, Gary L. Wade wrote: > Have you tried this scenario outside of /tmp and verified that the owner of > the application running matches the owner of the directory? I'm wondering if >

Re: NSBrowser Drag and Drop Issue !!

2011-04-15 Thread Naresh Kongara
I tried by setting break point on objc_exception_throw. Unable to get anything from the stack trace. Following is the stack trace. #0 0x7fff835d70da in objc_exception_throw () #1 0x7fff81060c9b in -[NSBrowser _beginColumnDragging] () #2 0x7fff8105b04f in -[NSBrowserTableView d

Pixel cracks and scrolling performance in CALayer-Backed view

2011-04-15 Thread Dave Fernandes
I would like to use some CA features with a custom (data visualization) NSView. This view is inside an NSScrollView, and does not have any sub-views. A portion of the view contains an NSImage that is drawn in the view's drawRect method. My first experiment was to check the Core Animation Layer c

Still have to use a lock to protect the data backing a UITableView?

2011-04-15 Thread G S
Hi all. I have a tableview that displays data from a collection of C++ objects. In the background, I download an updated collection occasionally, then reconcile it with the one being shown by the tableview. I coded it so the list reconciliation occurs on the main thread, but is that enough to pr

Re: Injecting text into a CALayer?

2011-04-15 Thread Jon Sigman
Yes, that works splendidly! Thanks, David! From: David Duncan To: Jon Sigman Cc: cocoa-dev@lists.apple.com Sent: Fri, April 15, 2011 11:54:36 AM Subject: Re: Injecting text into a CALayer? Using a sublayer for this purpose is I think the best solution for you

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Sean McBride
On Fri, 15 Apr 2011 12:01:14 -0700, Quincey Morris said: >I'll ask the dumb question: what happens if you invoke >bookmarkDataWithContentsOfURL on a non-alias file? If it correctly >detects an error, your PITA code could be reduced to: I thought about that, the docs say: /* Given the url of a fi

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Quincey Morris
On Apr 15, 2011, at 11:10, Sean McBride wrote: > _this_ is a PITA: > > - (NSURL*)URLByResolvingSymlinksAndAliases > { > NSURL* resultURL = [self URLByResolvingSymlinksInPath]; > > NSError* error = nil; > NSNumber* isAliasFile = nil; > BOOL success = [resultURL getRe

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Sean McBride
On Fri, 15 Apr 2011 01:47:56 -0400, Scott Anguish said: >if ([[eachPath pathExtension] isEqualToString:@"mp4"]) { Not what you were asking, but you should probably do a case insensitive test here, there are a lot of FAT16 USB keys out there that turn extensions into .MP4. :) Also, better to tes

Re: Injecting text into a CALayer?

2011-04-15 Thread David Duncan
Using a sublayer for this purpose is I think the best solution for your issue. Just create a CATextLayer and add it as a sublayer and your set. On Apr 15, 2011, at 11:52 AM, Jon Sigman wrote: > "self' is my circle object. I forgot to mention that I move the circles > around onscreen, so the tex

Re: Injecting text into a CALayer?

2011-04-15 Thread Jon Sigman
"self' is my circle object. I forgot to mention that I move the circles around onscreen, so the text would ideally somehow be embedded within the circle objects so they could track together. Would it make sense to have a parallel CATextLayer associated with each CALayer in my circle object? Or d

Re: Injecting text into a CALayer?

2011-04-15 Thread David Duncan
On Apr 15, 2011, at 11:11 AM, Jon Sigman wrote: > In iOS 4.3, I have an app that uses CALayers to draw small circles on the > screen > like so: > > CALayer *_layer = [[CALayer alloc] init]; > [_layer setDelegate:self]; > [_layer setBounds:CGRectMake( 0,0,100,100 )]; > [_layer setNeedsDispla

Re: NSBrowser Drag and Drop Issue !!

2011-04-15 Thread Corbin Dunn
On Apr 14, 2011, at 5:16 PM, Naresh Kongara wrote: > HI All, > > I implemented drag and drop in NSBrowser, through which I can drag items from > other views or windows of the applications. The drag and drop in NSBrowser is > implemented through its delegate methods. > Everything is going fine

Re: Cocoa witch's broom

2011-04-15 Thread Kok-Yong Tan
See answers inline. On Fri, Apr 15, 2011, at 13:24, Rodrigo Zanatta Silva wrote: Ok, lets finish this thread. We start to talk about other things. :P I have one question about english grammar. I know use the *'s*, but when is 2 things, what i do? Like This is Linda's computer. (This is

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Sean McBride
On Fri, 15 Apr 2011 11:22:45 -0500, Ken Thomases said: >>> Yes. Bookmark data is the modern replacement for alias records. The >>> new bookmark APIs are backward compatible with aliases, including alias >>> files. See the documentation for +[NSURL >>> bookmarkDataWithContentsOfURL:error:]. You

Injecting text into a CALayer?

2011-04-15 Thread Jon Sigman
In iOS 4.3, I have an app that uses CALayers to draw small circles on the screen like so: CALayer *_layer = [[CALayer alloc] init]; [_layer setDelegate:self]; [_layer setBounds:CGRectMake( 0,0,100,100 )]; [_layer setNeedsDisplay]; Is there a way I can draw text into the circle regions?

Re: Searchable Cocoa and Carbon APIs?

2011-04-15 Thread li...@mgreg.com
On Apr 15, 2011, at 1:34 PM, Kyle Sluder wrote: > On Fri, Apr 15, 2011 at 9:44 AM, li...@mgreg.com wrote: >> I posted two questions back-to-back. I think your reply may have been for >> my other "Xcode" question. This question certainly applies as it is >> regarding the Cocoa/Carbon API refe

Re: Searchable Cocoa and Carbon APIs?

2011-04-15 Thread Kyle Sluder
On Fri, Apr 15, 2011 at 9:44 AM, li...@mgreg.com wrote: > I posted two questions back-to-back.  I think your reply may have been for my > other "Xcode" question.  This question certainly applies as it is regarding > the Cocoa/Carbon API references. Yes, but the documentation searching functiona

Re: Cocoa witch's broom

2011-04-15 Thread Rodrigo Zanatta Silva
Ok, lets finish this thread. We start to talk about other things. :P Roshne give-me: *Cocoa's Witches Broom* Jeff Kelley give-me: *Cocoa Witch’s Broom** * Koko give-me: *Cocoa Witch's Broom** * I have one question about english grammar. I know use the *'s*, but when is 2 things, what i do? Like T

Re: Searchable Cocoa and Carbon APIs?

2011-04-15 Thread li...@mgreg.com
On Apr 15, 2011, at 3:13 AM, Laurent Daudelin wrote: > On Apr 14, 2011, at 21:27, li...@mgreg.com wrote: > >> Hi All, >> >> Probably been asked a million times before, but I'm looking for Apple's >> searchable Cocoa and Carbon APIs. In the past, I could enter something like >> "double click"

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Ken Thomases
On Apr 15, 2011, at 11:16 AM, Sean McBride wrote: > On Fri, 15 Apr 2011 10:44:06 -0500, Ken Thomases said: > >> Yes. Bookmark data is the modern replacement for alias records. The >> new bookmark APIs are backward compatible with aliases, including alias >> files. See the documentation for +[N

Re: Error validating email addresses in Core Data

2011-04-15 Thread Dave Carrigan
RFC 5322's address grammar is too complicated to allow for validation with a regular expression, and you're going to end up rejecting perfectly legitimate email addresses if you try. Plus, even if you somehow came up with the perfect validation routine, it doesn't ensure that the address is actu

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Sean McBride
On Fri, 15 Apr 2011 10:44:06 -0500, Ken Thomases said: >> NSOpenPanel helpfully, by default, resolves aliases before it returns >> the URL to you. But NSPathControl does not and file drops that you get >> off NSPasteboard also do not. So in many cases I need to manually check >> if a URL points

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Mike Abdullah
On 15 Apr 2011, at 16:44, Ken Thomases wrote: > On Apr 15, 2011, at 10:20 AM, Sean McBride wrote: > >> Of late, I've been working to remove NSString-based paths, FSRefs, and >> Alias Manager usage in my code, in favour of NSURL. >> >> But I'm having trouble with alias files. >> >> NSOpenPanel

Re: dealing with alias files, finding URL to target file

2011-04-15 Thread Ken Thomases
On Apr 15, 2011, at 10:20 AM, Sean McBride wrote: > Of late, I've been working to remove NSString-based paths, FSRefs, and > Alias Manager usage in my code, in favour of NSURL. > > But I'm having trouble with alias files. > > NSOpenPanel helpfully, by default, resolves aliases before it returns

dealing with alias files, finding URL to target file

2011-04-15 Thread Sean McBride
Hi all, Of late, I've been working to remove NSString-based paths, FSRefs, and Alias Manager usage in my code, in favour of NSURL. But I'm having trouble with alias files. NSOpenPanel helpfully, by default, resolves aliases before it returns the URL to you. But NSPathControl does not and file d

Re: Error validating email addresses in Core Data

2011-04-15 Thread Kyle Sluder
On Apr 15, 2011, at 6:30 AM, Michael Crawford wrote: > I'm trying to validate email addresses in Core Data but the regular > expression I'm using doesn't seem to work even though it looks correct. I'm > using the following expression: > > ^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$ > You cannot

Re: Error validating email addresses in Core Data

2011-04-15 Thread Conrad Shultz
I'm not a Core Data guru at all, but the regex you supplied will not match lower case letters. (My understanding is that Core Data string comparisons are case insensitive by default, but does this apply to regexes?) In any case, be aware that there are many syntactically valid email addresses t

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Gary L. Wade
Have you tried this scenario outside of /tmp and verified that the owner of the application running matches the owner of the directory? I'm wondering if there's some interplay with a semi-sandboxing I've read happens with files in /tmp. I've found that when I have issues with NSFileManager, I ca

Re: Error validating email addresses in Core Data

2011-04-15 Thread Dave DeLong
Are you sure you want to be matching against self? Dave Sent from my iPhone On Apr 15, 2011, at 6:30 AM, Michael Crawford wrote: > I'm trying to validate email addresses in Core Data but the regular > expression I'm using doesn't seem to work even though it looks correct. I'm > using the fo

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Andy Lee
Scott, are you copying the files asynchronously? I wonder if there are some files still in the process of being copied to the old directory, so the old directory either doesn't really go away, or it gets recreated. What happens if you comment out the actual copying of the files? And if you log t

Error validating email addresses in Core Data

2011-04-15 Thread Michael Crawford
I'm trying to validate email addresses in Core Data but the regular expression I'm using doesn't seem to work even though it looks correct. I'm using the following expression: ^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$ Which produces the following error: NSValidationErrorKey=email, NSLocalizedDe

Re: Localized.strings is being ignored

2011-04-15 Thread Ray
Also, to be complete, this post by Chris Hanson might be helpful: (Perhaps you got similar answers already, I'm behind with my email queue ;) > I'm pretty sure the file should be called "Localizable.strings", not > "Localized.strings". > > Dave > > Sent

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Peter Lübke
Am 15.04.2011 um 08:51 schrieb Scott Anguish: It always creates a new directory wit the new name, in the existing shootPath directory (for example /tmp/boo/Friday) with Friday-APPL instead. and then copies the newly found files into that. If I get you right, the *real* path for the new dir

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Ken Thomases
Adding to what I said earlier... On Apr 15, 2011, at 1:51 AM, Scott Anguish wrote: > It’s the messed up behavior of moveItemAtPath:toPath:error: that is weirding > me out. > But this seems like wrong move behavior which I should be diagnosing and then > reporting. If you suspect a bug in -mov

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Ken Thomases
On Apr 15, 2011, at 1:51 AM, Scott Anguish wrote: > The directory is named a name derived from the file > > so /tmp/boo/Friday > > and when it encounters a file that has more specific information, it should > be renamed > > /tmp/boo/Friday-APPL > > that should rename the existing directory wi

Re: Adding custom view in IB

2011-04-15 Thread Vyacheslav Karamov
15-Apr-11 00:34, Luc Van Bogaert пишет: Hi, I know how to subclass NSView to create a custom view, and add it to a window as a subview using interface builder. But when I want to control my custom view with a viewcontroller object, both contained in a seperate nib file, I'm getting a bit con

Re: Searchable Cocoa and Carbon APIs?

2011-04-15 Thread Laurent Daudelin
On Apr 14, 2011, at 21:27, li...@mgreg.com wrote: > Hi All, > > Probably been asked a million times before, but I'm looking for Apple's > searchable Cocoa and Carbon APIs. In the past, I could enter something like > "double click" in the search and it would return a reference to something > l

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Laurent Daudelin
On Apr 14, 2011, at 23:51, Scott Anguish wrote: [snip!] > — > > The app works without the renaming of the directory, and I want feedback in > the table as to what got moved and where. and since I need to use spotlight > and don’t want to learn the necessary extras, how to access spotlight and >