horizontal radio group

2010-07-02 Thread Angelo Chen
Hi,
radio group created in Interface builder is vertical, how  to set it 
horizontal? example, two radio buttons in one line? Thanks,
a.c.



___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: horizontal radio group

2010-07-02 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 11:05 PM, Angelo Chen angelochen...@yahoo.com.hk wrote:
 Hi,
 radio group created in Interface builder is vertical, how  to set it 
 horizontal? example, two radio buttons in one line? Thanks,
 a.c.

Please read the documentation before posting to the list.

--Kyle Sluder
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: horizontal radio group

2010-07-02 Thread Ken Thomases
On Jul 2, 2010, at 1:05 AM, Angelo Chen wrote:

 radio group created in Interface builder is vertical, how  to set it 
 horizontal? example, two radio buttons in one line? Thanks,

A group of radio buttons is really an NSMatrix.  The way to change the number 
of rows and columns in a matrix is to Option-resize it.  You can also directly 
edit the rows and columns by selecting the matrix and opening the attributes 
inspector.

Cheers,
Ken

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Error when closing window with IKImageBrowserView in it

2010-07-02 Thread Gideon King
I have tested using the orderOut: way of working around this issue, and it 
works for me. I will still file a bug report on the issue.

Gideon

On 02/07/2010, at 3:48 PM, Nick Zitzmann wrote:

 
 On Jul 1, 2010, at 9:41 PM, Dave Fernandes wrote:
 
 Hmmm. I still can't get it to happen reproducibly, but the workaround, if I 
 understand correctly would leek resources in a document-based app, would it 
 not?
 
 Perhaps. Then you could try removing the image browser from its superview 
 instead.
 
 Nick Zitzmann
 http://www.chronosnet.com/

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 an opportunity to discard stuff 
before it starts paging memory out?

--Graham


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 is delivered with a bunch of images 
already that are in some folder hierarchy in the app bundle. As the user looks 
through the catalog, new images are loaded from the web. I would like to store 
these new images in the same directory as the original ones since otherwise I 
would have to manage two separate image locations. If I can't store the images 
in the app bundle together with the others I'm reduced to two options, if I see 
it correctly: Duplicate the original images to the documents directory (waste 
of memory) or manage two image folders (administrative overhead). Does anyone 
have a better idea? Maybe use of file-aliases?

Thanks and regards,
Sebastian Mecklenburg

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 
connection? Or is UDP possible?
I already tried CFReadStreamRef and CFWriteStreamRef and they support TCP. I 
don't know if it is 
possible for UDP connection (for CFReadStreamRef and CFWriteStreamRef). Is it 
possible?

I need to know this since my VOIP app uses UDP connection. But I need to 
support multitasking 
feature on iOS4. Is this possible without changing its sockets UDP connection?


I really need help. T_T 


Regards,
Angie





  
_
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 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. 

The only three ways to find out for sure are to write some code to test it, or 
use a support incident, or search the developer forums. 

If you search the developer forums for 'CFStream udp' you may find out whether 
UDP sockets can be wrapped in a CFStream and may find an answer about whether 
UDP sockets can be backgrounded using the VOIP key. Make sure you search back 
more than the default 90 days to find your UDP answer. I can find only one post 
about each of those, however they're both from people whom I believe know what 
they are talking about. 

On 02-Jul-2010, at 6:49 PM, 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
 
 I just want to clarify if the first two options can support only TCP 
 connection? Or is UDP possible?
 I already tried CFReadStreamRef and CFWriteStreamRef and they support TCP. I 
 don't know if it is 
 possible for UDP connection (for CFReadStreamRef and CFWriteStreamRef). Is it 
 possible?
 
 I need to know this since my VOIP app uses UDP connection. But I need to 
 support multitasking 
 feature on iOS4. Is this possible without changing its sockets UDP connection?
 
 
 I really need help. T_T 
 
 
 Regards,
 Angie
 
 
 
 
 
 
 _
 Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
 https://signup.live.com/signup.aspx?id=60969___
 
 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/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 top half caret at extreme left and bottom 
half at extreme right and any character typed appears to the right. I want the 
new character appended to the left.

Thanks,
Abhinay.___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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?


You should always regard the app bundle as read only. The application  
might have been installed with administrator rights so that the  
current user does not have write access.


If I can't store the images in the app bundle together with the  
others I'm reduced to two options, if I see it correctly: Duplicate  
the original images to the documents directory (waste of memory) or  
manage two image folders (administrative overhead). Does anyone have  
a better idea? Maybe use of file-aliases?


First, it seems the Application Support folder might be a better place  
than Documents, depending on the nature of those images. Are they the  
actual data that the user is creating (put them in Documents) or are  
they material that the user uses to create his documents? (put them in  
Application Support)


To answer the question: Just copy them. That also has the benefit that  
the user can delete them if he wants to.



Andreas
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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?

Mac or iDevice?

It's just not a good idea to ever treat your app bundle as a writable location. 
It wouldn't necessarily break code signing (???) but depending on what 
privileges your user is running with could fail anyway. Basically you don't 
want to be modifying your app as it runs.

But a better location than Documents is ~/Library/Application 
Support/YourApp/subdirectories as needed

 Background: I write a catalog app that is delivered with a bunch of images 
 already that are in some folder hierarchy in the app bundle. As the user 
 looks through the catalog, new images are loaded from the web. I would like 
 to store these new images in the same directory as the original ones since 
 otherwise I would have to manage two separate image locations. If I can't 
 store the images in the app bundle together with the others I'm reduced to 
 two options, if I see it correctly: Duplicate the original images to the 
 documents directory (waste of memory) or manage two image folders 
 (administrative overhead). Does anyone have a better idea? Maybe use of 
 file-aliases?

Managing two (or more) folders or sources shouldn't be a big headache if you 
design it with that in mind from the start. The user interface and the data 
model behind it can consolidate various locations on disk (or web-based) into 
one big virtual space if you want - I do that with several managed resource 
types in my app and it works nicely. From experience I'd say that copying 
bundle-based resources to another folder at first launch is a waste of time and 
effort (not so much memory though, as disk space is generally abundant) - I did 
it that way in earlier versions and regretted it.  

--Graham___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 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 tedious, but should be managable...

Thanks and regards,
Sebastian Mecklenburg


On 02.07.2010, at 13:50, Graham Cox wrote:

 
 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?
 
 Mac or iDevice?
 
 It's just not a good idea to ever treat your app bundle as a writable 
 location. It wouldn't necessarily break code signing (???) but depending on 
 what privileges your user is running with could fail anyway. Basically you 
 don't want to be modifying your app as it runs.
 
 But a better location than Documents is ~/Library/Application 
 Support/YourApp/subdirectories as needed
 
 Background: I write a catalog app that is delivered with a bunch of images 
 already that are in some folder hierarchy in the app bundle. As the user 
 looks through the catalog, new images are loaded from the web. I would like 
 to store these new images in the same directory as the original ones since 
 otherwise I would have to manage two separate image locations. If I can't 
 store the images in the app bundle together with the others I'm reduced to 
 two options, if I see it correctly: Duplicate the original images to the 
 documents directory (waste of memory) or manage two image folders 
 (administrative overhead). Does anyone have a better idea? Maybe use of 
 file-aliases?
 
 Managing two (or more) folders or sources shouldn't be a big headache if you 
 design it with that in mind from the start. The user interface and the data 
 model behind it can consolidate various locations on disk (or web-based) into 
 one big virtual space if you want - I do that with several managed resource 
 types in my app and it works nicely. From experience I'd say that copying 
 bundle-based resources to another folder at first launch is a waste of time 
 and effort (not so much memory though, as disk space is generally abundant) - 
 I did it that way in earlier versions and regretted it.  
 
 --Graham
 

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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/YourApp/subdirectories as needed


Or if your app primarily is an image editor/manipulator, perhaps 
~/Pictures/Your App/etc...

I've noticed a few apps do that like Flipshare, and I guess that's OK. Or let 
the user choose...

--Graham


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 tedious, but should be managable...


Use the principle of copy-on-write. Load the images (or info about them) from 
your bundle, but as soon as the user changes one, you know that the file now 
needs to be copied elsewhere. Maintain some sort of index that tells your 
system where to load each image from. That way you're only pulling changed 
images from outside of your bundle, and only writing them when they have 
changed. The index can be small and lightweight and fast to parse. Big 
performance win all round.

--Graham


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 other side.

Is that possible or does the NSOutputStream flush after every write:maxLength: 
anyway?

Have a nice weekend,

atze

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 control over what is 
displayed. Is there something like Set to multiple selection state?

Best Regards
Georg___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 treated as a package 
with my custom icon showing?

Thanks,
John___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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:39 AM, John Johnson wrote:

 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 treated as a 
 package with my custom icon showing?
 
 Thanks,
 John

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 something particular I have to do to have the plugin treated as a 
 package with my custom icon showing?


Yes, declare an UTI for your file/plugin type and make sure your type conforms 
to  com.apple.package (take care to not put a white space before or after 
com.apple.package, else it will not works).


-- Jean-Daniel




___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.qlgenerator 
plug-in recognizes XML files, I should be able to get this to work with 
appropriate settings in my application's Info.plist file without writing my own 
Quick Look generator. I've got this working if I use the Finder to change the 
file extension on one of the documents to .xml -- hitting the spacebar shows me 
the document's XML contents. But when the document has my custom file 
extension, Quick Look only shows me the document's icon.

My Google search turned up many tips about how to set up my Info.plist file so 
that Quick Look will work with my custom file extension, but I can't get it to 
work. Can anybody supply step-by-step instructions?

The tips say to add public.xml to the UTTypeConformsTo entry in the 
UTExportedTypeDeclarations entry in Info.plist, then run 'sudo qlmanage -r' in 
Terminal. But my Info.plist file has always used public.xml, and that doesn't 
seem to be enough. My Info.plist file has also always had a 
UTTypeTagSpecification entry with the value set to my custom file extension.

--

Bill Cheeseman - b...@cheeseman.name

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iOS4: VOIP App

2010-07-02 Thread Michael Ash
On Fri, Jul 2, 2010 at 6:49 AM, Angelica Grace Tanchico
atanch...@live.com 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

 I just want to clarify if the first two options can support only TCP 
 connection? Or is UDP possible?
 I already tried CFReadStreamRef and CFWriteStreamRef and they support TCP. I 
 don't know if it is
 possible for UDP connection (for CFReadStreamRef and CFWriteStreamRef). Is it 
 possible?

 I need to know this since my VOIP app uses UDP connection. But I need to 
 support multitasking
 feature on iOS4. Is this possible without changing its sockets UDP connection?

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 itself, you'll have an audio
session keeping you alive and therefore can use UDP and plain sockets
for the call.

Mike
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.  However, when I enable 
proximity indexing, my quoted string doesn't return any hits from the index.  
The string I'm searching is from a document I know has been indexed.  When I 
try the quoted string with Spotlight, I can find the document.  Here is the 
code I'm using to create the database:


CFMutableDictionaryRef props = CFDictionaryCreateMutable(NULL, 0,
kCFTypeDictionaryKeyCallBacks, 
kCFTypeDictionaryValueCallBacks);
CFDictionaryAddValue(props, kSKProximityIndexing, kCFBooleanTrue);

theIndex = SKIndexCreateWithURL((CFURLRef) url,
(CFStringRef) dbName,
kSKIndexInverted,
props);


Anyone know what I'm doing wrong?

Mike

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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, and matrix views I have. I have some elements of the 
views that are animated, and I'll want to do more. I'll 
especially want to animate items (i.e. rows) as single 
entities—–sliding the row up or down, zooming it in or out, etc.


My table views are fairly complex. Not draw not just the content 
of individual cells, but also background graphics (that draws 
shaded regions around groups of objects) and overlay graphics 
(that draw lines between connected/related objects).


Right now, I'm using the trick of having the table or browser 
cell create persistent NSView subviews that preform the 
drawing+animation for selected cells. The rest are simply drawn 
using traditional NSCell objects.


Now I want to migrate to Core Animation, but I know that child 
CALayers and NSViews don't mix. That is, an NSView will either 
host CALayer objects or NSView subviews, but not both. This 
makes working CALayers into NSTableView and NSOutlineView 
somewhat problematic. For example, I can't just use CALayers to 
draw background or highlights if some of the cells are creating 
NSViews to display content in the same view.


So what's the best way to construct complex table, outline, and 
browser views that support CA layers?


So far I've imagined two ways of approaching this:

(1) Keep with the traditional table/outline/browser view + table 
cell logic, creating NSView subviews objects which then host 
their own CALayers to provide animation.


(2) Display all table data using CALayers. Instead of drawing 
anything, each cell invocation would spontaneously create a 
CALayer for each cell in the table. Background and overlay 
graphics would be provide by other CALayers.


I'm sure the first will work, but it feels clunky.

The second approach has a lot of appeal, but I worry that 
NSTableView or NSBrowser might create hidden/secret NSView 
subviews that will mess everything up.


I'm sure some of you have been down this road, and I value your advice.


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iOS4: VOIP App

2010-07-02 Thread Shawn Erickson
On Fri, Jul 2, 2010 at 8:05 AM, Michael Ash michael@gmail.com 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 itself, you'll have an audio
 session keeping you alive and therefore can use UDP and plain sockets
 for the call.

I have a similar understanding but would love to know if I am wrong.

-Shawn

(sorry for the duplicate email Mike)
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 make no sense for UDP.

—Jens___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 sure that’s not directly possible, since DNS lookups are done by a 
shared daemon process, not by individual apps.

What you could do is incorporate direct DNS-lookup code into your app (I’m sure 
there are open-source libraries for it), use that to resolve the hostname to an 
IP address, and then use that IP address with your favorite networking APIs 
instead of the hostname. (If you’re using NSURLConnection, you’d need to 
transform the raw address into dotted-quad form, or the equivalent for IPv6.)

—Jens___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 the original www.nike.com web site -- you never 
know you were just hit by a drive-by browser attack.

In any case, this discussion should probably be re-directed to the 
darwin-kernel mailing list instead of Cocoa.

Todd

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 scene - but you're
right, it depends...
and could you tell the iOS team i feel great with their APIs, please? thx ;)

here's the (ugly) method code, pdfRef and pageNo are properties of the
enclosing class/instance.

- (void) drawRect:(CGRect)rect {
// get the page reference
CGPDFPageRef page = CGPDFDocumentGetPage(pdfRef, pageNo);
CGContextRef context = UIGraphicsGetCurrentContext();

// white background
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(context, CGContextGetClipBoundingBox(context));

// transformation/-lation
CGContextTranslateCTM(context, 0.0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(page,
kCGPDFCropBox, rect, 0, true));
CGContextDrawPDFPage(context, page);

}

hope this help's someone else.

- bye

2010/6/24 David Duncan david.dun...@apple.com:
 On Jun 24, 2010, at 8:59 AM, Martin Glaß wrote:

 sorry, CATiledLayer actually improves performance. the downside is,
 the tiles need time to be drawn and are faded in using an animation of
 0.25 seconds.
 so, if there are 6 tiles to be drawn you end up seeing iOS building
 the mosaic in a total of 1.5 seconds.

 The fade time is not synchronous with the content generation. If you generate 
 content fast, it could all fade in in 0.25s. If it is taking longer, it is 
 due to the rendering time of that content, but unless your rendering time is 
 0.25s it is unlikely that you will take exactly 1.5s for all of it to display 
 :).

 --
 David Duncan


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 to the other side.
 Is that possible or does the NSOutputStream flush after every 
 write:maxLength: anyway?

TCP has some finely-tuned algorithms to decide when to send the buffer. Usually 
it’s best not to second-guess these, but there are some cases where you do need 
to. Terminal protocols like telnet and ssh use setsockopt to set a special 
immediate mode (I can’t remember the name of the option but it’s in the man 
page.).

I’m not sure how you get from an NSStream object to the underlying socket 
descriptor that you’d pass to setsockopt. You can get to that from a CFStream, 
but I don’t know whether NSStream is toll-free-bridged to CFStream.

(And there’s no reason you have to use NSStream with Bonjour. The 
-getInputStream:outputStream: method is just a convenience — you can resolve 
the service to find its IP address and then use whatever API you like to open a 
socket.)

—Jens___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 quoted string is treated as separate search terms.  However, 
 when I enable proximity indexing, my quoted string doesn't return any hits 
 from the index.  The string I'm searching is from a document I know has been 
 indexed.  When I try the quoted string with Spotlight, I can find the 
 document.  Here is the code I'm using to create the database:
 
 
   CFMutableDictionaryRef props = CFDictionaryCreateMutable(NULL, 0,
   kCFTypeDictionaryKeyCallBacks, 
 kCFTypeDictionaryValueCallBacks);
   CFDictionaryAddValue(props, kSKProximityIndexing, kCFBooleanTrue);
   
   theIndex = SKIndexCreateWithURL((CFURLRef) url,
   (CFStringRef) dbName,
   kSKIndexInverted,
   props);
 
 
 Anyone know what I'm doing wrong?


Answering my own question - 

you need to execute this function:

SKIndexFlush(theIndex);

before closing the index:

SKIndexClose (theIndex);

SKIndexFlush dosen't seem to occur in the example code that is in the SearchKit 
programming guide but it is buried in the text.  If you fail to fail to call 
SKIndexFlush or SKIndexClose you apparently get an index that SearchKit can 
search (without errors) but the results are unpredictable.

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.
 
 --
 Michael Jackson
 http://mjijackson.com
 @mjijackson
 ___




http://developer.apple.com/mac/library/documentation/Networking/Conceptual/SystemConfigFrameworks/SC_UnderstandSchema/SC_UnderstandSchema.html#//apple_ref/doc/uid/TP40001065-CH203-CHDIHDCG


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 point (following on from Jens' suggestion): 
http://sourceforge.net/projects/adns/.  Nice, simple source code which you can 
hack around, liberal license.  No doubt there are other options out there.

Regards,

Paul Sanders.
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 queries to a
 particular pair of DNS servers.
 
 I’m pretty sure that’s not directly possible, since DNS lookups are done by a 
 shared daemon process, not by individual apps.
 
 What you could do is incorporate direct DNS-lookup code into your app (I’m 
 sure there are open-source libraries for it), use that to resolve the 
 hostname to an IP address, and then use that IP address with your favorite 
 networking APIs instead of the hostname. (If you’re using NSURLConnection, 
 you’d need to transform the raw address into dotted-quad form, or the 
 equivalent for IPv6.)

FWIW, dig can do that, as you can specify a server when you use it to test DNS 
query:

http://www.opensource.apple.com/source/bind9/bind9-31/bind9/bin/dig/

-- Jean-Daniel




___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSMatrix setState and setSelectionFrom

2010-07-02 Thread koko

while(index != NSNotFound)
{
for(i=0;icount;i++)
{
BMatrixCell *bmxc = [cells objectAtIndex:i];
			int cmp = bfn.GetFileName().CompareNoCase(bmxc- 
mBFilename.GetFileName());

if(cmp == 0)
{
[bmxc setState:NSOnState];
[_browserView getRow:row column:col 
ofCell:bmxc];
NSInteger pos = (row*cols)+col;
[_browserView setSelectionFrom:pos to:pos 
anchor:pos highlight:YES];
break;
}
}
}


There is more code above and below this snippet but the point is that  
after executing with multiple bmxc cells that should be selected only  
the last one found is selected.


BUT, if [bmxc setState:NSOnState]; is not called as in:


while(index != NSNotFound)
{   for(i=0;icount;i++)
{
BMatrixCell *bmxc = [cells objectAtIndex:i];
			int cmp = bfn.GetFileName().CompareNoCase(bmxc- 
mBFilename.GetFileName());

if(cmp == 0)
{
[_browserView getRow:row column:col 
ofCell:bmxc];
NSInteger pos = (row*cols)+col;
[_browserView setSelectionFrom:pos to:pos 
anchor:pos highlight:YES];
break;
}
}
}


then all expected to be selected cells are selected !
Seems like strange behavior to me.  Comments please.

-koko
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 can see from lines 29-45



Your code has a serious bug.

if(taskFile != NULL) {
const int BYTES_TO_READ = 64;
char *theCString = malloc(sizeof(char) * BYTES_TO_READ);
int bufferSize = 64;
int bytesRead = 0;
int totalBytes = 0;
	while((bytesRead = fread(theCString, 1, BYTES_TO_READ, taskFile)) !=  
0) {

bufferSize += 64;
theCString = realloc(theCString, bufferSize);
totalBytes += bytesRead;
}
if (taskFile != NULL) { 
NSLog(@Total Bytes Read: %i, totalBytes);
		*tResults = [[NSString alloc] initWithBytesNoCopy:theCString  
length:totalBytes encoding:NSUTF8StringEncoding freeWhenDone:YES];

}

Your fread() is always reading data into the start of the buffer  
'theCString'.  This is wrong.  There should be a separate pointer  
that's advanced by the number of bytes just read.  Or use fread 
(theCString+totalBytes,...).


You also have a stylistic flaw of repeated use of the magic number  
64, despite defining a constant BYTES_TO_READ to represent it.


Another possible problem is you don't test the result returned from  
AEWP().  You go straight into reading the FILE, and only test the  
result later as part of a questionable retry block, not shown  
above. There is a dubious busy loop in the retry, and there may be  
other problems.


Is the fread() bug the cause of the problem you posted about?  I  
don't know.  But it certainly is a significant problem, and it has a  
huge effect on what data gets returned as the output of the task  
string.


You never said what you were actually executing with elevated  
privileges.  If I were you, I'd test your code by running it on /bin/ 
echo or /usr/bin/id.  Both of those executables are well  
characterized and well behaved, and they emit text only on stdout.   
If those fail in the same way, then make a well-isolated fully  
compilable example and post its source.


The first step to solving the problem is to replicate it, but you  
haven't provided enough code to do that.


  -- 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.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 imaginary.  Most 
frustrating.  I checked that my NSRunLoop was working properly by using sleep - 
and it is.

Perplexed.  Any other ideas?


On 30 Jun 2010, at 19:30, Michael Ash wrote:

 On Wed, Jun 30, 2010 at 1:01 PM, Geoffrey Holden
 45rpmli...@googlemail.com wrote:
 I realize that this is a hell of a big query, and I'm not entirely sure that 
 I've given enough information for anyone to help answer it.  At the very 
 least, I guess I'm hoping for a reference to some really solid documentation 
 on how to do what I'm trying to do - the documentation on ADC seems to be a 
 little light in this area.
 
 From the code you've posted, I suspect the problem is that the page
 hasn't actually loaded by the time you try to run your JS code.
 WebView generally works asynchronously. Something like [mainFrame
 loadRequest:request] will return quickly and the WebView will not
 actually load things until the runloop runs, and then you'll get
 notified later on when it's done loading.
 
 What you'll want to do is call loadRequest:, then run the NSRunLoop on
 the main thread until your load delegate is told that the page is done
 loading. Then you should be able to do your JS stuff.
 
 Note that it is possible, and not all that hard, to run an NSRunLoop
 in a faceless program, it just requires a bit more manual intervention
 than in a GUI app where it's all set up for you.
 
 If you're already doing that and your code was just abbreviated, well,
 ignore the above
 
 Mike
 ___
 
 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/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/45rpmlists%40googlemail.com
 
 This email sent to 45rpmli...@googlemail.com


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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@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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 recognizing the pinch gesture?
 
 Thanks!
 
 -- 
 Rick
 
 ___
 
 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/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/kainjow%40kainjow.com
 
 This email sent to kain...@kainjow.com

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 store contains a snapshot of the
current configured networking preferences, and it's constantly being
updated by various Configuration Agents as conditions change
(location, for example).

The documentation also outlines the system configuration schema which
is the complex data structure that contains all networking settings,
among other things. My problem is that the schema is so complex, I
can't figure out how to use it properly to change the DNS settings.

As far as my intent goes, it's nothing malicious. 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.

Any help would be appreciated.

Thanks,

Michael

--
Michael Jackson
http://mjijackson.com
@mjijackson



On Fri, Jul 2, 2010 at 11:33 AM, Jens Alfke j...@mooseyard.com wrote:

 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 sure that’s not directly possible, since DNS lookups are done by a 
 shared daemon process, not by individual apps.

 What you could do is incorporate direct DNS-lookup code into your app (I’m 
 sure there are open-source libraries for it), use that to resolve the 
 hostname to an IP address, and then use that IP address with your favorite 
 networking APIs instead of the hostname. (If you’re using NSURLConnection, 
 you’d need to transform the raw address into dotted-quad form, or the 
 equivalent for IPv6.)

 —Jens
___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 favorite DNS server may be slow if 
the computer is many hops away from it, (b) it may not be reachable at all if 
the computer is behind a firewall, and (c) it can still be spoofed if there are 
malicious/hacked routers in the way (unless you’re using DNS-Sec.)

—Jens___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 paging memory out?

On a Modern OS™ it’s not easy to say when the system’s running low on memory, 
because there’s physical RAM, and there’s address space, and the pages in 
address space can be clean or dirty, or mapped from a file, and so forth. And 
all of that stuff is shareable between processes.

What NSCache does, I believe, is use the vm_allocate() system call to allocate 
address space that’s marked as being purgeable: its pages won’t get written to 
backing store, they just get thrown away. You have to make calls to lock and 
unlock purgeable memory so it won’t get thrown away while you’re using it.

There’s some info about vm_allocate here, although it doesn’t talk about the 
purgeable mode. IIRC, the header file does, though.
http://developer.apple.com/mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html

—Jens___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 extreme right and any character typed appears to the right. I want 
 the new character appended to the left.
The Text System is handling bidirectional scripts based on the Unicode Bidi 
Algorithm.
With the specification, the position of a character is determined by the 
character's Bidi property.

For example, characters inside right-to-left words always flow to the left, and 
left-to-right words to the right.

The base writing direction API controls the general text flow direction in the 
paragraph.  It affects the relationships between words, but not characters 
inside each word.

This is, of course, an over-simplification (there are more to the 
specification), but you get the idea.

Aki

On 2010/07/02, at 4:44, Abhinay Kartik Reddyreddy wrote:

 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 top half caret at extreme left and bottom 
 half at extreme right and any character typed appears to the right. I want 
 the new character appended to the left.
 
 Thanks,
 Abhinay.___
 
 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/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com
 
 This email sent to a...@apple.com

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 give it an opportunity to discard stuff 
 before it starts paging memory out?
 
 On a Modern OS™ it’s not easy to say when the system’s running low on memory, 
 because there’s physical RAM, and there’s address space, and the pages in 
 address space can be clean or dirty, or mapped from a file, and so forth. And 
 all of that stuff is shareable between processes.
 
 What NSCache does, I believe, is use the vm_allocate() system call to 
 allocate address space that’s marked as being purgeable: its pages won’t get 
 written to backing store, they just get thrown away. You have to make calls 
 to lock and unlock purgeable memory so it won’t get thrown away while you’re 
 using it.
 
 There’s some info about vm_allocate here, although it doesn’t talk about the 
 purgeable mode. IIRC, the header file does, though.
 http://developer.apple.com/mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html
 
 —Jens


Thanks Jens, I'll look into it.

It might not be worth it, as we are trying to encourage users to move to 10.6. 
My 10.5 cache already limits the number of cached items and discards the least 
recently used ones to stay within the limit - that might be enough especially 
as previously we just cached these items in a NSMutableDictionary and it was 
never purged.

But now I've seen NSCache in action, it's a nice addition to the arsenal - pity 
it wasn't thought of earlier!

--Graham


___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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 
anything there.

--Graham

___

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/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com