Getting notified when memory gets tight

2010-07-02 Thread Graham Cox
On 10.6, NSCache is handy for caching stuff that I can afford to simply drop as needed - it works great. I'd like to be able to do something a bit like it on 10.5. Is there a notification or other callback I can use to get notified when the system is running low on memory for my app, to give it

Download images and modify bundle?

2010-07-02 Thread sebi
Hello, When I download an image and want to keep it for further reference, I assume I have to store it in the documents directory and not in the app bundle, because otherwise I would invalidate the signature and the app wont run anymore. Is this correct? Background: I write a catalog app that i

iOS4: VOIP App

2010-07-02 Thread Angelica Grace Tanchico
Hello Again, As stated in iPhone App Programming Guide Document, below are the interfaces that can be used to configure VOIP: - NSInputStream and NSOutputStream - NSURLRequest - CFReadStreamRef and CFWriteStreamRef I just want to clarify if the first two options can support only TCP connectio

Re: iOS4: VOIP App

2010-07-02 Thread Roland King
You may not be getting the answers you want here because it's quite possible nobody knows. I would say this is one of the times I'd go use one of my developer program support incidents (in fact 2 out of 3 I have used have been about networking and I've gotten great answers). The names CFStream

NSTextView editing top-down and right to left.

2010-07-02 Thread Abhinay Kartik Reddyreddy
Hi, I was wondering if its possible to use NSTextView for top-down editing. I could not find a method to set it to top down. Also how do i get the right to left editing working properly [myTextView setBaseWritingDirection:NSWritingDirectionRightToLeft]; this results in a split caret with

Re: Download images and modify bundle?

2010-07-02 Thread Andreas Mayer
Am 02.07.2010 um 10:01 Uhr schrieb sebi: When I download an image and want to keep it for further reference, I assume I have to store it in the documents directory and not in the app bundle, because otherwise I would invalidate the signature and the app wont run anymore. Is this correct?

Re: Download images and modify bundle?

2010-07-02 Thread Graham Cox
On 02/07/2010, at 6:01 PM, sebi wrote: > When I download an image and want to keep it for further reference, I assume > I have to store it in the documents directory and not in the app bundle, > because otherwise I would invalidate the signature and the app wont run > anymore. Is this correct?

Re: Download images and modify bundle?

2010-07-02 Thread sebi
Hello, Sorry, it*s on an iPad, I forgot to mention. That's why I mentioned the documents directory, on a Mac I wouldn't want to save anything there automatically, thats right. But to treat the bundle as non-writable is probably a good idea anyway. The problem is that I have thousands of files s

Re: Download images and modify bundle?

2010-07-02 Thread Graham Cox
On 02/07/2010, at 9:50 PM, Graham Cox wrote: > But a better location than Documents is ~/Library/Application > Support// Or if your app primarily is an image editor/manipulator, perhaps ~/Pictures//etc... I've noticed a few apps do that like Flipshare, and I guess that's OK. Or let the user

Re: Download images and modify bundle?

2010-07-02 Thread Graham Cox
On 02/07/2010, at 10:19 PM, sebi wrote: > The problem is that I have thousands of files so I can't cache them all. Also > there might be files with the same name and I have to use the newer one. So > for every file access I have to look into both folders. Well, whatever, it's > probably a bit

Flushing NSOutputStream gotten from NSNetService

2010-07-02 Thread Alexander Spohr
Hi List, i it possible to flush an NSOutputStream? I have some streams gotten from NSNetServices getInputStream:outputStream:. I send very small chunks (from 1 to 1000 bytes) of data through them. I would like to flush the stream after I wrote a chunk to get the data immediately sent to the ot

Manually set value of a textfield

2010-07-02 Thread Georg Seifert
Hi, If I bind a textfield to the selection of a ArrayController and have more than one item with different value selected, I get a grayed out "Multiple Value" string. Is there a way of doing this manually? I have a popup that displays the values from the selection, but need to have some manual

Custom bundle icon

2010-07-02 Thread John Johnson
Just an aesthetic question. I've implemented an API for cocoa plugins in my app, and the plugins use a custom extension, ftplugin. These plugins show up as folders in the finder, even though I've set the app icon to an icns file. Is there something particular I have to do to have the plugin trea

Re: Custom bundle icon

2010-07-02 Thread John Johnson
If only I'd searched a little longer, but the lack of definitive keywords made it difficult... http://lists.apple.com/archives/cocoa-dev/2006/Mar/msg01533.html Now it shows up and acts as a plugin in the Finder, but it still does not use the custom icon file that I've set. On Jul 2, 2010, at 8:

Re: Custom bundle icon

2010-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 2010 à 15:39, John Johnson a écrit : > Just an aesthetic question. I've implemented an API for cocoa plugins in my > app, and the plugins use a custom extension, ftplugin. These plugins show up > as folders in the finder, even though I've set the app icon to an icns file. > Is there

Info.plist settings for Quick Look?

2010-07-02 Thread Bill Cheeseman
My Mac OS X application for Leopard and Snow Leopard saves documents with a custom file extension, but the documents' content format is XML. I want my users to see a Quick Look preview of the documents' contents when they select one in the Finder and hit the spacebar. Since Apple's built-in Text

Re: iOS4: VOIP App

2010-07-02 Thread Michael Ash
On Fri, Jul 2, 2010 at 6:49 AM, Angelica Grace Tanchico wrote: > > > Hello Again, > > As stated in iPhone App Programming Guide Document, below are the interfaces > that can be used to configure VOIP: > - NSInputStream and NSOutputStream > - NSURLRequest > - CFReadStreamRef and CFWriteStreamRef >

Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Michael Jackson
Is there any way to bypass the system network preferences for DNS servers to perform all DNS lookups from within a Cocoa app? For example, I would like my app to always make DNS queries to a particular pair of DNS servers. -- Michael Jackson http://mjijackson.com @mjijackson __

phrase searching with SearchKit

2010-07-02 Thread Michael Thon
I'm trying to set up an index with SearchKit and search it with quoted phrases. It is my understanding that I need to enable proximity indexing to get phrase searches to work. If I don't enable proximity indexing, then it seems like my quoted string is treated as separate search terms. Howeve

Core Animation vs. table/browser/matrix views - looking for advice

2010-07-02 Thread James Bucanek
Greetings, I'm about to undertake an almost complete rewrite of my user interface. I've made the decision to drop support for OS X 10.4, which will allow me to (finally) use Core Animation and Grand Central extensively. Now I'm faced with how to engineer the many table, outline, browser, an

Re: iOS4: VOIP App

2010-07-02 Thread Shawn Erickson
On Fri, Jul 2, 2010 at 8:05 AM, Michael Ash wrote: > My understanding is that you MUST use TCP and an NSStream for your > "control" connection, that is the connection that you use to > rendezvous with the server, send keepalives, get notices of incoming > calls, etc. However, for the actual call

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread vincent habchi
Afaik, no. Why would you do that? Sent from my iPhone4 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Uns

Re: iOS4: VOIP App

2010-07-02 Thread Jens Alfke
On Jul 2, 2010, at 4:39 AM, Roland King wrote: > The names CFStream and NSInput/OutputStream really suggest you want a stream > socket underlying them, not a UDP one, but I can't find a thing in the > documentation which actually says that. Yes, those APIs use TCP, not UDP. Stream-based APIs

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Jens Alfke
On Jul 1, 2010, at 7:42 PM, Michael Jackson wrote: > Is there any way to bypass the system network preferences for DNS > servers to perform all DNS lookups from within a Cocoa app? For > example, I would like my app to always make DNS queries to a > particular pair of DNS servers. I’m pretty sur

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Todd Heberlein
> Afaik, no. Why would you do that? I don't know about the original sender's reason, but DNS servers are often the initial target of attacks. Then when you go to, say www.nike.com, the DNS server sends you the IP address of a malicious site. That site infects your browser, then redirects you to

Re: force rendering of views off screen

2010-07-02 Thread Martin Glaß
hello guys, thanks for your comments - i just found the right knob to draw the content of my "invisible" subview in my uiscrollview. i simply subclassed every subview and implemented -drawRect: additionally using uigraphicsgetcurrentcontext(). @david yeah, this was just simple math to picture the

Re: Flushing NSOutputStream gotten from NSNetService

2010-07-02 Thread Jens Alfke
On Jul 2, 2010, at 5:36 AM, Alexander Spohr wrote: > I have some streams gotten from NSNetServices getInputStream:outputStream:. I > send very small chunks (from 1 to 1000 bytes) of data through them. I would > like to flush the stream after I wrote a chunk to get the data immediately > sent t

Re: phrase searching with SearchKit

2010-07-02 Thread Michael Thon
On Jul 2, 2010, at 11:09 AM, Michael Thon wrote: > I'm trying to set up an index with SearchKit and search it with quoted > phrases. It is my understanding that I need to enable proximity indexing to > get phrase searches to work. If I don't enable proximity indexing, then it > seems like my

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread John Joyce
On Jul 1, 2010, at 9:42 PM, Michael Jackson wrote: > Is there any way to bypass the system network preferences for DNS > servers to perform all DNS lookups from within a Cocoa app? For > example, I would like my app to always make DNS queries to a > particular pair of DNS servers. > > -- > Micha

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Paul Sanders
On Jul 1, 2010, at 9:42 PM, Michael Jackson wrote: > Is there any way to bypass the system network preferences for DNS > servers to perform all DNS lookups from within a Cocoa app? For > example, I would like my app to always make DNS queries to a > particular pair of DNS servers. As a starting p

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 2010 à 19:33, Jens Alfke a écrit : > > On Jul 1, 2010, at 7:42 PM, Michael Jackson wrote: > >> Is there any way to bypass the system network preferences for DNS >> servers to perform all DNS lookups from within a Cocoa app? For >> example, I would like my app to always make DNS queri

NSMatrix setState and setSelectionFrom

2010-07-02 Thread koko
while(index != NSNotFound) { for(i=0;i int cmp = bfn.GetFileName().CompareNoCase(bmxc- >mBFilename.GetFileName()); if(cmp == 0) { [bmxc setState:NSOnState];

Re: Capturing output from another task with elevated privilages

2010-07-02 Thread Greg Guerin
Eric Hoaglin wrote: I have the following code: http://www.pasteit4me.com/763005 I'm trying to capture the output of the task that I run. and from what I understand, if you want to do so, you pass a FILE* to AuthorizationExecuteWithPrivileges and then just read it as a normal file (which you

Re: Capturing output from another task with elevated privilages

2010-07-02 Thread Greg Guerin
And you also need to identify what OS version you're running on. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.a

Calling javascript from Cocoa 'facelessly'

2010-07-02 Thread Geoffrey Holden
Thanks for this. I tried it, checking that provisionalDataSource is nil before continuing as per the documentation, but sadly I still get the same result - regardless of whether I have the real javascript function name or a made up one, and regardless of whether the URL I use is real or imagina

Sample code for supporting pinch zoom in Mac OS X?

2010-07-02 Thread Rick Mann
Is there sample code demonstrating how to support arbitrary pinch zoom/scroll in a custom view, on Mac OS X? Similar to how Preview.app does it. If not, what about recognizing the pinch gesture? Thanks! -- Rick ___ Cocoa-dev mailing list (Cocoa-dev

Re: Sample code for supporting pinch zoom in Mac OS X?

2010-07-02 Thread Kevin Wojniak
Override magnifyWithEvent: in your view then use -[NSEvent magnification] On Jul 2, 2010, at 1:54 PM, Rick Mann wrote: > Is there sample code demonstrating how to support arbitrary pinch zoom/scroll > in a custom view, on Mac OS X? Similar to how Preview.app does it. > > If not, what about rec

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Michael Jackson
It should be possible using the dynamic store of the System Configuration framework. http://developer.apple.com/mac/library/documentation/Networking/Conceptual/SystemConfigFrameworks/SC_Components/SC_Components.html#//apple_ref/doc/uid/TP40001065-CH207-CHDDDCHG The documentation says that this st

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Jens Alfke
On Jul 2, 2010, at 3:54 PM, Michael Jackson wrote: > I would simply like > to make my app always query the same set of DNS servers for > speed/security reasons. This shouldn't be a shocker to anyone who has > ever worked on high security applications. Understandable. Just be aware that (a) your

Re: Getting notified when memory gets tight

2010-07-02 Thread Jens Alfke
On Jul 2, 2010, at 12:14 AM, Graham Cox wrote: > I'd like to be able to do something a bit like it on 10.5. Is there a > notification or other callback I can use to get notified when the system is > running low on memory for my app, to give it an opportunity to discard stuff > before it starts

Re: NSTextView editing top-down and right to left.

2010-07-02 Thread Aki Inoue
Hello Abhinay, > I was wondering if its possible to use NSTextView for top-down editing. I > could not find a method to set it to top down. NSTextView currently does not support the vertical text editing. > this results in a split caret with top half caret at extreme left and bottom > half at e

Looking for GoFetch Core Data sample from WWDC08

2010-07-02 Thread Michael Crawford
This sample was featured in session 381 - Core Data Tips & Tricks. I looked in the current Mac sample library on developer.apple.com but no-joy. -Michael ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mode

Re: Getting notified when memory gets tight

2010-07-02 Thread Graham Cox
On 03/07/2010, at 9:47 AM, Jens Alfke wrote: > > On Jul 2, 2010, at 12:14 AM, Graham Cox wrote: > >> I'd like to be able to do something a bit like it on 10.5. Is there a >> notification or other callback I can use to get notified when the system is >> running low on memory for my app, to giv

How is 'truncate last visible line' accomplished?

2010-07-02 Thread Graham Cox
How is 'truncate last visible line' accomplished for wrapped text? I have a custom cell that I would like to have this behaviour in. Most of the system controls/cells support this but it's not clear how it's done for custom cells. I thought it would be a paragraph style attribute but I don't see