Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Ken Ferry
Hi Bill, Thanks for the postmortem. Would you mind filing bugs for the items you think are too difficult? On Thu, May 27, 2010 at 12:43 PM, Bill Appleton < billapple...@dreamfactory.com> wrote: > hi all, > > > I just ported a huge code base to Cocoa, Core Graphics, Core Audio, and > QuickTime.

Re: Generating PDF images (+followup question)

2010-05-28 Thread Stephen J. Butler
On Fri, May 28, 2010 at 1:36 AM, Graham Cox wrote: > I understand that contexts can (still) be flipped. > > Let's break this down a bit, since I'm fighting two problems simultaneously > here. First, PDF File generation. > > Using the code I quoted, I generate PDF data in a flipped context. The >

Re: Generating PDF images (+followup question)

2010-05-28 Thread Graham Cox
Hallelujah!!! Thanks Stephen, that's the piece of the puzzle I was missing. I was assuming (or misinterpreting) that passing flipped:YES for the NSGraphicsContext ACTUALLY FLIPPED the context, not just informed it that the context had been flipped. I found I had to set the CTM after the CGPDFC

Re: Generating PDF images (+followup question)

2010-05-28 Thread Ken Ferry
Heh. Okay, glad that made sense, but as discussed in all the other resources, yes, context flippedness is a piece of _metadata_ orthogonal from the CTM. You may consult it to get the high level notion of which way should be considered "up". On Fri, May 28, 2010 at 12:22 AM, Graham Cox wrote: >

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Alastair Houghton
On 27 May 2010, at 20:43, Bill Appleton wrote: > *1) I can't hide a file, or test if a file is hidden* > > I had to resort to FSGetCatalogInfo -- there is no way to do it through > NSFileManager, etc. Right? chflags(), with UF_HIDDEN? And stat() to read the same? I don't think FSGet/SetCatalog

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Chaitanya Pandit
> > *3)** **I **can't get t**he right dimensions for a QuickTime movie or poster > * > NSSize movieSize = [[movieObject currentFrameImage] size]; > I used to call GetMovieBox, so I tried using [QTMovie posterImage] but the > NSImage reported a width and height of 100, and then my movie poster

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Tony Romano
To see if a file is hidden, I use on the URL(NSURL Class) for the file, resourceValuesForKeys and pass in the array of properties you are looking for. In the case of a hidden file, use NSURLIsHiddenKey. You should be able to make a file hidden as well by using the set counter part. Check out

NSURLConnection weirdiness

2010-05-28 Thread Nava Carmon
Hi, I'm experiencing a weird problem and i wonder if anybody else has noticed this: I'm using NSURLConnection as it appears in apple's examples to get xml files from a certain server (standard http get) - pretty straight forward. And most of time it works, but sometimes it's just stuck after in

Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
Hi, My app is set to observe a folder for changes to its contents (using UKKQueue. Thanks Uli! :-)). When files are dropped into the folder the app is notified and processes the files. This works well, except for one catch: sometimes we receive the notification and spawn the worker thread, and

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Uli Kusterer
On May 28, 2010, at 12:05 PM, Antonio Nunes wrote: > My app is set to observe a folder for changes to its contents (...) I get the > impression the notification happens as soon as the file transfer into the > watched directory begins, and my worker thread is ready and starts loading > the file b

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
On 28 May 2010, at 11:30, Uli Kusterer wrote: > The heuristic most people use is to wait a little time (a few seconds is > usually enough) and only start processing a file if a new write notification > hasn't arrived in the meantime. I usually use my UKPushbackMessenger for that > purpose (see

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
On 28 May 2010, at 11:41, Antonio Nunes wrote: > I was hoping the system would provide something better for this. Looks like > an enhancement request is in order. Request filed. Bug ID# 8038793: "Need notification of file system modification after completion of the operation". Cheers, António

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Uli Kusterer
On May 28, 2010, at 12:53 PM, Antonio Nunes wrote: > On 28 May 2010, at 11:41, Antonio Nunes wrote: >> I was hoping the system would provide something better for this. Looks like >> an enhancement request is in order. > > Request filed. Bug ID# 8038793: "Need notification of file system > modifi

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Jean-Daniel Dupas
Le 28 mai 2010 à 12:53, Antonio Nunes a écrit : > On 28 May 2010, at 11:41, Antonio Nunes wrote: > >> I was hoping the system would provide something better for this. Looks like >> an enhancement request is in order. > > Request filed. Bug ID# 8038793: "Need notification of file system > modi

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Uli Kusterer
On May 28, 2010, at 2:25 AM, Philip Vallone wrote: > This is a relative question, which depends on how the data is coming and > going. My question comes from the following situation. Suppose I have a > GKSession that is passing information via Bluetooth. The sender can send any > type of informa

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
On 28 May 2010, at 12:15, Jean-Daniel Dupas wrote: > I hope you properly defined what you mean by "operation", because on a file > system point of view, this is already what kqueue does. > A copy is not one operation but a bunch of operations (open, lots of write, > close, set attrs, set xattrs,

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Antonio Nunes
On 28 May 2010, at 12:07, Uli Kusterer wrote: > Are you doing this for Finder-originated copying only? In this case, you > could probably look at the file's OSType/creator. I believe they get set to > some special "busy"-values during copying, so if you get a write notification > and your file

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Sherm Pendley
On Thu, May 27, 2010 at 8:25 PM, Philip Vallone wrote: > > This is a relative question, which depends on how the data is coming and > going. My question comes from the following situation. Suppose I have a > GKSession that is passing information via Bluetooth. The sender can send any > type of

Re: Where is zlib located?

2010-05-28 Thread Tito Ciuro
Thanks a lot Roland! -- Tito On May 28, 2010, at 8:51 AM, Roland King wrote: > libz.dylib > > it's the last thing listed in the list if I go 'add framework' -> 'existing > frameworks'. > > > On 28-May-2010, at 2:40 PM, Tito Ciuro wrote: > >> Hello, >> >> I'm trying to incorporate zip-fram

NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?

2010-05-28 Thread Tito Ciuro
Hello, I'm trying to replace the following deprecated NSFileManager method: > /* attributesOfItemAtPath:error: returns an NSDictionary of key/value pairs > containing the attributes of the item (file, directory, symlink, etc.) at the > path in question. If this method returns 'nil', an NSError

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Charles Srstka
On May 27, 2010, at 2:43 PM, Bill Appleton wrote: > *5)** **I **can't create a simple list* > > I did it the only way I could -- with a table that has one column, etc. Man > that was painful for a simple list. Is there a better way? Have a look at NSArrayController. It makes table views a piece

Re: NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?

2010-05-28 Thread Charles Srstka
On May 28, 2010, at 10:01 AM, Tito Ciuro wrote: > The old statement traverses the link: > > NSDictionary* attr = [[NSFileManager defaultManager] > fileAttributesAtPath:file traverseLink:YES]; > > The problem is that the header states that 'attributesOfItemAtPath:error:' > that it's a rep

Re: NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?

2010-05-28 Thread Tito Ciuro
Thanks Charles! -- Tito On May 28, 2010, at 5:17 PM, Charles Srstka wrote: > On May 28, 2010, at 10:01 AM, Tito Ciuro wrote: > >> The old statement traverses the link: >> >> NSDictionary* attr = [[NSFileManager defaultManager] >> fileAttributesAtPath:file traverseLink:YES]; >> >> The pr

Re: NSFileManager 'attributesOfItemAtPath:error:' does not traverse a link?

2010-05-28 Thread Kevin Perry
That documentation is incorrect and is scheduled to be corrected. -attribtuesOfItemAtPath:error: will never automatically resolve symlinks, and that will never change. -Kevin Perry On May 28, 2010, at 8:17 AM, Charles Srstka wrote: > On May 28, 2010, at 10:01 AM, Tito Ciuro wrote: > >> The ol

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Kevin Wojniak
On May 27, 2010, at 12:43 PM, Bill Appleton wrote: > *4)** **I **can't call the printing code* > > I know, the printing code calls me. But other platforms don't work like > this. I eventually used Core Printing and the Cocoa dialogs by sub-classing > and faking out NSPrintPanel. Is there a bette

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Uli Kusterer
On May 28, 2010, at 4:00 PM, Sherm Pendley wrote: > I would let the sent objects handle the work themselves. A switch or > series of ifs based on class is an OOP anti-pattern. Polymorphism is > often a better alternative, and Objective-C's ability to add a > category to any class makes it easy to i

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Bill Appleton
hi all, wow, i am getting a lot of help solving these last issues! thanks all. on printing, the problem is that i have to port an enterprise application that expects to be able to call a fx for the page layout and the page setup dialog, a fx to begin/end a page, and a fx to begin/end printing. s

Re: Stealing settings from Mail.app

2010-05-28 Thread Greg Guerin
Chris Idou wrote: I've got an app that needs to send out emails. I'm trying to import mail settings from Mail.app. For some reason my keychain has passwords for smtp.gmail.com, but not for smtp.me.com. AFAIK, there is only the one MobileMe password for all uses. Double-click your MobileMe

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Ricky Sharp
On May 28, 2010, at 11:20 AM, Bill Appleton wrote: > on printing, the problem is that i have to port an enterprise application > that expects to be able to call a fx for the page layout and the page setup > dialog, a fx to begin/end a page, and a fx to begin/end printing. > > so Cocoa has this a

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Bill Appleton
Hi Chaitanya, that code always returns a size of 100, 100 for every movie I try. really. and then the poster or frame is really pixelated because it is coming from such a small source. i am surely missing something here! thanks, bill On Fri, May 28, 2010 at 1:17 AM, Chaitanya Pandit wrot

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Scott Ribe
On May 28, 2010, at 7:57 AM, Antonio Nunes wrote: > I expect many of the files will arrive in the watched folder either through > user manipulation in the Finder or through scripts/automation. I don't think > I can assume only Finder-originated copying. Then there's no way for the system to kno

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Kevin Wojniak
Did you try QTMovieNaturalSizeAttribute? http://developer.apple.com/mac/library/technotes/tn2005/tn2138.html#TNTAG11 On May 28, 2010, at 9:43 AM, Bill Appleton wrote: > Hi Chaitanya, > > that code always returns a size of 100, 100 for every movie I try. really. > > and then the poster or fram

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Wade Williams
On May 28, 2010, at 11:04 AM, Kevin Wojniak wrote: >> *4)** **I **can't call the printing code* >> >> I know, the printing code calls me. But other platforms don't work like >> this. I eventually used Core Printing and the Cocoa dialogs by sub-classing >> and faking out NSPrintPanel. Is there a

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Sean McBride
On Thu, 27 May 2010 12:43:42 -0700, Bill Appleton said: >*2)** **I **can't **get the current caret blink rate in milliseconds* > >I used to call GetCaretTime, but now I just use 500 milliseconds. Eeek! >Where is the current blink rate? Please don't tell me I don't need it, we >implement our own sc

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread James Walker
On 5/27/2010 12:43 PM, Bill Appleton wrote: *1) I can't hide a file, or test if a file is hidden* I had to resort to FSGetCatalogInfo -- there is no way to do it through NSFileManager, etc. Right? Since there are several ways to hide a file, I don't think FSGetCatalogInfo will necessarily tel

Spotlight SDK replacement on iPad/iPhone

2010-05-28 Thread sebi
Hello, I'd like to have a quick full text search on a pdf in my app. Unfortunately the NSMetadata* classes are not available in the iPhone SDK. Does someone know of a 3rd party solution or so? Thanks and regards, sebastian mecklenburg___ Cocoa-dev ma

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Alastair Houghton
On 28 May 2010, at 18:25, James Walker wrote: > On 5/27/2010 12:43 PM, Bill Appleton wrote: >> *1) I can't hide a file, or test if a file is hidden* >> >> I had to resort to FSGetCatalogInfo -- there is no way to do it through >> NSFileManager, etc. Right? > > Since there are several ways to hid

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread James Walker
On 5/28/2010 11:18 AM, Alastair Houghton wrote: On 28 May 2010, at 18:25, James Walker wrote: On 5/27/2010 12:43 PM, Bill Appleton wrote: *1) I can't hide a file, or test if a file is hidden* I had to resort to FSGetCatalogInfo -- there is no way to do it through NSFileManager, etc. Right?

Changing cursors in window's bounds

2010-05-28 Thread John Love
I do not have a custom view, rather just the window's contentView with its various graphics, buttons, text etc. I wish to simply change the cursor anytime the mouse is inside any part of this contentView. If I did have a custom view, I understand all the machinations pertaining to changing cur

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Bill Appleton
hi Kevin, sorry if this is a repost, my last one was rejected for being too big YES, the QTMovieNaturalSizeAttribute definitely returns the size i am looking for the remaining problem is that the movie posetr returns a size of 100 x 100 so when i capture the poster it is really pixelated i've

Re: Changing cursors in window's bounds

2010-05-28 Thread Quincey Morris
On May 28, 2010, at 11:55, John Love wrote: > My challenge centers on trying to make this magic happen just in the window's > canned contentView without creating a custom NSView within Interface Builder. > My sub-classed NSDocument knows about the window via my overridden > -windowControllerDi

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Alex Curylo
On 2010-05-28, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > i've tried everything -- how do other people get movie posters and/or grab > movie frames? With classic QuickTime if there was no poster frame specifically set in the movie QuickTime would reliably return the first frame. Wi

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Jean-Daniel Dupas
Le 28 mai 2010 à 20:55, Bill Appleton a écrit : > hi Kevin, > > sorry if this is a repost, my last one was rejected for being too big > > YES, the QTMovieNaturalSizeAttribute definitely returns the size i am > looking for > > the remaining problem is that the movie posetr returns a size of 100

Re: Spotlight SDK replacement on iPad/iPhone

2010-05-28 Thread Laurent Cerveau
You can try swish-e. Pretty good stuff. I still wish SearchKit would be public on the iPhoneOS Laurent Sent from my road phone On May 28, 2010, at 7:58 PM, sebi wrote: Hello, I'd like to have a quick full text search on a pdf in my app. Unfortunately the NSMetadata* classes are not ava

Re: NSURLConnection weirdiness

2010-05-28 Thread Jens Alfke
On May 28, 2010, at 2:58 AM, Nava Carmon wrote: > sometimes it's just stuck after initialing and don't get into connection's > delegate methods. I'm working with WiFi & 3G and the same server all the > time. When it comes to didFailWithError i see that mostly it was a timeout > error. Do you

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Robert Martin
Try using the QTMovie method frameImageAtTime: withAttributes: error: You can specify the image size you want returned in the attributes dictionary (along with the image format). On May 28, 2010, at 2:55 PM, Bill Appleton wrote: > the remaining problem is that the movie posetr returns a size

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Jens Alfke
> On May 28, 2010, at 2:25 AM, Philip Vallone wrote: >> This is a relative question, which depends on how the data is coming and >> going. My question comes from the following situation. Suppose I have a >> GKSession that is passing information via Bluetooth. The sender can send any >> type of

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Jens Alfke
On May 27, 2010, at 12:43 PM, Bill Appleton wrote: > there were some things i > noticed that i couldn't do easily in Cocoa or any other 64 bit OSX API. Cocoa doesn’t claim to do everything. There are a lot of tasks that should be done using lower level APIs. > *1) I can't hide a file, or test

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Bill Appleton
hi all, i fixed the movie poster problem as well thanks for all the help, this is a great forum have a nice weekend! best, bill On Fri, May 28, 2010 at 1:28 PM, Robert Martin wrote: > Try using the QTMovie method frameImageAtTime: withAttributes: error: > > You can specify the image si

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Philip Vallone
Hi, > Wait, are you archiving and unarchiving data over a network? That’s a bad > idea unless you’re extremely careful. The problem is that a malicious peer > can send you an archive that expands into any codable object, not just the > types you were expecting; this can be exploited to do Bad T

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Kyle Sluder
On May 28, 2010, at 4:40 PM, Philip Vallone wrote: How is it possible using GKSession to be introduced to a malicious peer.? I am creating a GKSession object and connecting via GKPeerPickerController. A hand shack is made between the the two peers. Once both peers accept the connection,

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Michael Ash
On Fri, May 28, 2010 at 7:40 PM, Philip Vallone wrote: > Hi, > >> Wait, are you archiving and unarchiving data over a network? That’s a bad >> idea unless you’re extremely careful. The problem is that a malicious peer >> can send you an archive that expands into any codable object, not just the

Re: NSURLConnection weirdiness

2010-05-28 Thread Jerry Krinock
On 2010 May 28, at 02:58, Nava Carmon wrote: > When I enter same link in Safari it takes a second to bring data. I understand that you're saying it "works OK at the same time from the same IP address from Safari", meaning that you have ruled out being throttled by this "certain server", or you

Re: authenticating peers

2010-05-28 Thread Jens Alfke
On May 28, 2010, at 6:59 PM, Michael Ash wrote: > An attacker can execute a man-in-the-middle attack... > An attacker can simply impersonate your app... > Neither of these can be defended against, even theoretically, when > communicating peer-to-peer. Not true; if you use SSL or some equivalent

Help w/ first step of creating Help Book for app

2010-05-28 Thread Shane
I'm trying to create a help book for my app using the "Apple Help Programming Guide", which is not easy for me to follow. I'm at the section "Creating a Basic Help Book", trying to get the structure right where the HTML files are to go. It says I should have a dir structure like: SurfWriter.app/ (

Re: drawing border of NSPopUpButtonCell drawInteriorWithFrame:inView:

2010-05-28 Thread Shane
>> [path moveToPoint:NSMakePoint(cellFrame.origin.x, cellFrame.size.height)]; >> [path lineToPoint:NSMakePoint(cellFrame.size.width, cellFrame.size.height)]; > > > If cellFrame = {500, 300, 120, 20} > > You're drawing from {500, 20} to {120, 20} > I have four NSView cell's (so I have four data tab

Re: Help w/ first step of creating Help Book for app

2010-05-28 Thread Ron Fleckner
On 29/05/2010, at 2:29 PM, Shane wrote: I'm trying to create a help book for my app using the "Apple Help Programming Guide", which is not easy for me to follow... Stop right there! Fortunately, Matt Neuburg has created a very helpful short movie showing exactly how to do this. As Matt sa

Using table view cells from nibs

2010-05-28 Thread Tino Rachui
I've created a table view cell in interface builder with a custom height. However when I load and use that kind of cell at runtime it disregards my custom height. I have to use 'heightForRowAtIndexPath' to set the desired cell height. Is there anything I'm missing? Thanks in advance, Tino__