Re: Failing in -init

2011-07-26 Thread Rick Mann
Thanks much! On Jul 26, 2011, at 23:42 , Roland King wrote: > Yes and yes. Read the paragraph titled "handling initialization failure" in > "the objective-c programming language" which covers this. > > > > On Jul 27, 2011, at 14:28, Rick Mann wrote: > >> If my object's initialization fails

Re: Failing in -init

2011-07-26 Thread Roland King
Yes and yes. Read the paragraph titled "handling initialization failure" in "the objective-c programming language" which covers this. On Jul 27, 2011, at 14:28, Rick Mann wrote: > If my object's initialization fails, can I return nil from it? If that > happens, do I need to call [self relea

Failing in -init

2011-07-26 Thread Rick Mann
If my object's initialization fails, can I return nil from it? If that happens, do I need to call [self release]? -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Con

Two NSTableViews, two data sources, one data model?

2011-07-26 Thread Izak van Langevelde
I currently have a single NSDocument subclass, which is also a data source for two different tables. Because the two tables show different aspects of the data and the code gets a little cluttered up, I am thinking about implementing two separate data sources, one for each table, both fetching it

Re: How to implement Autosaving, Browsing Versions, Reverting to Last Saved in Lion?

2011-07-26 Thread Zorg
I've just realized I forgot to CC my message to the mailing list. On Jul 26, 2011, at 7:41 PM, Zorg wrote: > Okay, thanks. I filed it as rdar://9845409 > > -Zorg:-. > > On Jul 26, 2011, at 2:00 PM, Kevin Perry wrote: > >> There is nothing that you are obviously doing wrong here. Please file a

Safari 5.1 update

2011-07-26 Thread Nava Carmon
Hi New Safari 5.1 doesn't run WebKit plugins! I read that it's supposed to happen from 10.7, I'm running 10.6.8. Apple recommends using netscape style plugins. Did somebody bump into this already? Nava Carmon ncar...@mac.com "Think good and it will be good!" __

Re: NSTask oddity with getting stdout

2011-07-26 Thread Scott Ribe
On Jul 26, 2011, at 5:52 PM, Shane Stanley wrote: >> Maybe you should try to re-open your bug ;-) > > I did, but no reply. Too bad, since it seems to me the person who responded didn't know what they were talking about. > In Snow Leopard that worked fine; a notification would be sent when new

Re: NSFileManager - a cautionary tale

2011-07-26 Thread Kyle Sluder
On Tue, Jul 26, 2011 at 6:51 PM, Graham Cox wrote: > > On 27/07/2011, at 11:14 AM, Graham Cox wrote: > >> This call to mkdir causes the App Store reviewers to have conniptions, even >> though it certainly fails. > > > Another thing to mention - we run this code during app launch, so we didn't >

Re: NSFileManager - a cautionary tale

2011-07-26 Thread Graham Cox
On 27/07/2011, at 11:14 AM, Graham Cox wrote: > This call to mkdir causes the App Store reviewers to have conniptions, even > though it certainly fails. Another thing to mention - we run this code during app launch, so we didn't see it in fs_usage, which requires that the process it's peeking

Re: How can i change a app position and size?

2011-07-26 Thread Diego Alvarez Nogueira
Sorry, i am new in cocoa, i've searched a lot about how can i do this. I'm capturing the bounds in this way: === CFArrayRef windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionAll, kCGNullWindowID); for (NSMutableDictionary* entry in (NSArray*) windowLis

NSFileManager - a cautionary tale

2011-07-26 Thread Graham Cox
Hi all, this is just a FYI really. We've had a difficult job getting our latest app update through the App Store review, failing under section 2.3.0 which claims the we were writing to a location within the application's bundle. The culprit turns out to be [NSFileManager createDirectoryAtPath:

Re: 1. Creating a TCP server? (Rick Mann)

2011-07-26 Thread Rick Mann
Oh, that looks promising, thanks! On Jul 26, 2011, at 16:20 , John MacMullin wrote: > http://developer.apple.com/library/mac/#samplecode/CocoaEcho/Introduction/Intro.html > ? > > On Jul 26, 2011, at 2:42 PM, cocoa-dev-requ...@lists.apple.com wrote: > >> Send Cocoa-dev mailing list submissions

Re: Creating a TCP server?

2011-07-26 Thread Rick Mann
I think that's what I want to use! On Jul 26, 2011, at 16:40 , vade wrote: > I would highly suggest looking at AsyncSocket. I've personally used it a few > times and its been a pleasure to work with. > > http://code.google.com/p/cocoaasyncsocket/ > > > > > On Jul 26, 2011, at 3:17 PM, Rick

Re: NSTask oddity with getting stdout

2011-07-26 Thread Shane Stanley
On 27/7/11 3:18 AM, "Scott Ribe" wrote: > Maybe you should try to re-open your bug ;-) I did, but no reply. Here's some code that's reading a file that's being written periodically: -(void)dataFromFile:(NSNotification *)notif { NSData *data = [[notif userInfo] objectForKey:NSFileHandleNoti

Re: Creating a TCP server?

2011-07-26 Thread vade
I would highly suggest looking at AsyncSocket. I've personally used it a few times and its been a pleasure to work with. http://code.google.com/p/cocoaasyncsocket/ On Jul 26, 2011, at 3:17 PM, Rick Mann wrote: > Hi. I need to build a little serial port-to-TCP server (so that clients can >

1. Creating a TCP server? (Rick Mann)

2011-07-26 Thread John MacMullin
http://developer.apple.com/library/mac/#samplecode/CocoaEcho/Introduction/Intro.html ? On Jul 26, 2011, at 2:42 PM, cocoa-dev-requ...@lists.apple.com wrote: > Send Cocoa-dev mailing list submissions to > cocoa-dev@lists.apple.com > > To subscribe or unsubscribe via the World Wide Web, vis

Re: Receiving unicode keyboard input

2011-07-26 Thread Aki Inoue
Bill, You cannot directly access the Cocoa text handling method inside the NPAPI plugins. Instead the NPAPI's Cocoa extension defines the composition handling logic by itself. Refer to the 'Text Input' section in this document . Aki On 2011/07

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
hi greg, this application is the dreamfactory player, this is a stand-alone development environment and also a NPAPI plugin for chrome, safari and firefox. there are huge limitations for npapi, for example, we only get a core graphics surface to draw the app on not an nsview or an nswindow the code

Re: Dialog Command Keys

2011-07-26 Thread Gregory Weston
Bill Appleton wrote: > Based on my app, the dialog boxes have to be created dynamically, so i can't > use Interface Builder, so they are assembled out of cocoa controls as > needed. > > My dialogs beep when i control-x to cut some selected text > > What is the simple way for my dialog window to

Re: Creating a TCP server?

2011-07-26 Thread Eric Gorr
What, I think distinguishes the SSD example from others is that it uses the two most modern methods to get the job done - launchd and GCD. On Jul 26, 2011, at 4:31 PM, Rick Mann wrote: > Thanks, I saw those messages going by. I'll take a look. > > -- > Rick > > On Jul 26, 2011, at 12:23 ,

Re: Creating a TCP server?

2011-07-26 Thread Tito Ciuro
Hello, More options: A simple, extensible HTTP server in Cocoa http://cocoawithlove.com/2009/07/simple-extensible-http-server-in-cocoa.html How to Write a Cocoa Web Server http://macdevcenter.com/pub/a/mac/2006/11/14/how-to-write-a-cocoa-web-server.html A Simple HTTP Server http://culturedcode.

Re: Toggle an object (image) when Command key is pressed: flagsChanged?

2011-07-26 Thread Kyle Sluder
On Tue, Jul 26, 2011 at 12:50 PM, Patrick Robertson wrote: > First, you can see from the code that I can't seem to find a mask for when > 'no' modifier keys are pressed. This method does get called for key downs > and key ups. It seems 'no keys' corresponds to 0x100, but is there no > constant I c

Re: App won't get to my code in Lion

2011-07-26 Thread Charles Srstka
On Jul 26, 2011, at 12:19 AM, John Nairn wrote: > My app won't start at all in Lion. I always thought the first code will be in > > - (void)applicationWillFinishLaunching:(NSNotification *)aNotification > > but that code is never reached. So I am a loss of how to fix it. > > Many of my users cl

Re: Creating a TCP server?

2011-07-26 Thread davelist
Here's some sample code (I'm not the author) https://bitbucket.org/snej/mynetwork/overview Dave On Jul 26, 2011, at 4:00 PM, Bing Li wrote: > Hi, Rick, > > If you are familiar with BSD socket, you can program with it to create a TCP > server. I have done that successfully. > > Thanks, > Bing

Re: Toggle an object (image) when Command key is pressed: flagsChanged?

2011-07-26 Thread Quincey Morris
On Jul 26, 2011, at 12:50, Patrick Robertson wrote: > First, you can see from the code that I can't seem to find a mask for when > 'no' modifier keys are pressed. This method does get called for key downs > and key ups. It seems 'no keys' corresponds to 0x100, but is there no > constant I can use

Re: Creating a TCP server?

2011-07-26 Thread Rick Mann
Thanks, I saw those messages going by. I'll take a look. -- Rick On Jul 26, 2011, at 12:23 , Eric Gorr wrote: > I would suggest checking out the SSD sample project from WWDC 2010. There are > a couple of problems in the source which are covered in this thread: > > http://lists.apple.com/archi

Re: Creating a TCP server?

2011-07-26 Thread Bing Li
Hi, Rick, If you are familiar with BSD socket, you can program with it to create a TCP server. I have done that successfully. Thanks, Bing On Wed, Jul 27, 2011 at 3:17 AM, Rick Mann wrote: > Hi. I need to build a little serial port-to-TCP server (so that clients can > connect to my Mac to inte

Toggle an object (image) when Command key is pressed: flagsChanged?

2011-07-26 Thread Patrick Robertson
Hi all, I'm wanting to toggle an object between its default and 'alternate' state (the object is made up of an image and some text) when the user hits the command (⌘) key. An obvious example is in Xcode 3.2 where if you press ⌥ the 'Build and Run' icon and text changes to 'Build and Debug' (or vic

Re: App won't get to my code in Lion

2011-07-26 Thread Greg Parker
On Jul 26, 2011, at 10:34 AM, John Nairn wrote: > I was trying to get away with XCode 3.25 on Lion to make a quick fix to my > code. I have now installed Xcode 4.1. So far I am getting the same error > message. I had this once before in a different application and the solution > then was to crea

Re: Creating a TCP server?

2011-07-26 Thread Eric Gorr
I would suggest checking out the SSD sample project from WWDC 2010. There are a couple of problems in the source which are covered in this thread: http://lists.apple.com/archives/Macnetworkprog/2011/Jul/msg5.html But the basics of what you want to do I believe are there... On Jul 26, 2011,

Creating a TCP server?

2011-07-26 Thread Rick Mann
Hi. I need to build a little serial port-to-TCP server (so that clients can connect to my Mac to interact with a serial port). Among other things, I want to advertise this using Bonjour. How do I create a TCP server in Cocoa? It seems like CF networking is my best bet, but I thought TCP should

Re: How to implement Autosaving, Browsing Versions, Reverting to Last Saved in Lion?

2011-07-26 Thread Kevin Perry
There is nothing that you are obviously doing wrong here. Please file a Radar with your test app attached. -KP On Jul 24, 2011, at 7:46 PM, Zorg wrote: > I'm having a difficult time figuring out how to implement these features > correctly in Lion. I've created a very simple NSDocument based te

Re: [SOLVED] Problem getting my layers to draw in the right order

2011-07-26 Thread Kyle Sluder
On Tue, Jul 26, 2011 at 10:51 AM, David Duncan wrote: > Except for certain situations, Core Animation effectively treats each layer > as a rendering target – that is, all of that layer's sublayers are flattened > into that layer  to produce the final image for that layer. What this means > is t

Re: [SOLVED] Problem getting my layers to draw in the right order

2011-07-26 Thread David Duncan
On Jul 26, 2011, at 7:50 AM, Kyle Sluder wrote: > From the description given in the documentation, I would think that because > CA is sorting the layers based on sibling order and zPosition that it would > be possible to render a layer of zPosition=0 atop a nephew layer with > zPosition=1000. >

Re: Dialog Command Keys

2011-07-26 Thread Kyle Sluder
On Tue, Jul 26, 2011 at 10:30 AM, Bill Appleton wrote: > hi all > > i set the target and the action on my menu items -- this is so that i can > get my handler called when someone selects a menu item > i will re-read the event handler docs with regard to menu items (no keyboard > issues) and see if

Re: Dialog Command Keys

2011-07-26 Thread Joar Wingfors
On 26 jul 2011, at 10:30, Bill Appleton wrote: > i set the target and the action on my menu items -- this is so that i can get > my handler called when someone selects a menu item > i will re-read the event handler docs with regard to menu items (no keyboard > issues) and see if that helps Yo

Re: App won't get to my code in Lion

2011-07-26 Thread John Nairn
I was trying to get away with XCode 3.25 on Lion to make a quick fix to my code. I have now installed Xcode 4.1. So far I am getting the same error message. I had this once before in a different application and the solution then was to create a completely new project and manually add all files b

Re: Dialog Command Keys

2011-07-26 Thread Matt Neuburg
On Tue, 26 Jul 2011 09:03:19 -0700, Bill Appleton said: >The items in the main menu DO have the standard key bindings, they are >disabled when the modal dialogs come up Well, that's a bug you need to fix. This might help: http://www.cocoabuilder.com/archive/cocoa/119051-small-notes-on-enabling-

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
hi all i set the target and the action on my menu items -- this is so that i can get my handler called when someone selects a menu item i will re-read the event handler docs with regard to menu items (no keyboard issues) and see if that helps thx bill On Tue, Jul 26, 2011 at 10:02 AM, Joar W

Re: NSTask oddity with getting stdout

2011-07-26 Thread Scott Ribe
On Jul 26, 2011, at 12:18 AM, Shane Stanley wrote: >> On Jul 25, 2011, at 3:40 AM, Shane Stanley wrote: >> I wonder if they've changed how the readInBackgroundAndNotify works. >>> >>> Yes, they have. I logged a bug on it, and was told that the way it worked in >>> 10.6 was wrong -- whereas

Re: Dialog Command Keys

2011-07-26 Thread Joar Wingfors
On 26 jul 2011, at 09:43, Raleigh Ledet wrote: >> Well, when the dialog field has selected text and i type command-x my menu >> item's action handler is NOT invoked, because there is a modal dialog up I >> guess. > > Wait! Are you saying that you modified the default target/action setup of the

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
hi all, >> Wait! Are you saying that you modified the default target/action setup of the Cut menu in your main nib file? If so, that would explain everything. >> try starting again with a standard NIB and inspect each item to see what things you may be missing. i think this is the right track, ou

ANN: CouchCocoa framework (CouchDB API)

2011-07-26 Thread Jens Alfke
tl;dr: CouchCocoa is a new Objective-C API for CouchDB on iOS and Mac OS. You can get it from . If you’re not familiar with CouchDB : it’s a popular “NoSQL” non-relational data store with a straightforward data model based

Re: Dialog Command Keys

2011-07-26 Thread Gary L. Wade
You had mentioned earlier that your UI is programmatically generated; are your menus also in that category? If so, and they need to remain that way, try starting again with a standard NIB and inspect each item to see what things you may be missing. - Gary L. Wade (Sent from my iPhone)

Re: Dialog Command Keys

2011-07-26 Thread Joar Wingfors
On 26 jul 2011, at 09:32, Bill Appleton wrote: > >> OK, great. In that case it's weird that your cut/copy/paste items are not > >> enabled while a text field in your dialog has focus. You have focus set in > >> one of your text fields / views, right? > > I just tried enabling the edit menu it

Re: Dialog Command Keys

2011-07-26 Thread Andy Lee
On Jul 26, 2011, at 12:32 PM, Bill Appleton wrote: > On microsoft windows if you have a text field up on a dialog with > focus it just responds to control-x and cuts the text. It doesn't matter > what is happening in the application menus. On the Mac, Command-X typically just works as well. The me

Re: Dialog Command Keys

2011-07-26 Thread Raleigh Ledet
On Jul 26, 2011, at 9:32 AM, Bill Appleton wrote: > I just noticed that even if i bring up a stock dialog (like the put file > dialog to save a file) that command-x still doesn't work. for these dialogs > it DOES flash (hilite) that menu, but no cutting happens. So I don't think > it matters how i

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
I just noticed that even if i bring up a stock dialog (like the put file dialog to save a file) that command-x still doesn't work. for these dialogs it DOES flash (hilite) that menu, but no cutting happens. So I don't think it matters how i am running the modal dialogs, because a stock dialog (coco

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
>> OK, great. In that case it's weird that your cut/copy/paste items are not enabled while a text field in your dialog has focus. You have focus set in one of your text fields / views, right? I just tried enabling the edit menu items when a dialog is up, that didn't change anything. The NSTextFie

Re: App won't get to my code in Lion

2011-07-26 Thread Jens Alfke
On Jul 25, 2011, at 11:39 PM, John Nairn wrote: > Program loaded. > run > [Switching to process 7184] > Running… > sharedlibrary apply-load-rules all > unable to read unknown load command 0x24 > unable to read unknown load command 0x26 > unable to read unknown load command 0x24 > unable to read u

Re: Dialog Command Keys

2011-07-26 Thread Andy Lee
On Jul 26, 2011, at 12:03 PM, Bill Appleton wrote: > The items in the main menu DO have the standard key bindings, they are > disabled when the modal dialogs come up That is odd. My question is, how do those menu items "know" to be enabled when we run a modal dialog the more usual way, using a ni

Re: Dialog Command Keys

2011-07-26 Thread Joar Wingfors
On 26 jul 2011, at 09:03, Bill Appleton wrote: > The items in the main menu DO have the standard key bindings, they are > disabled when the modal dialogs come up > The items in the right-click menu do NOT have the key bindings but they are > enabled, i didn't make these menus > The dialogs are

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
The items in the main menu DO have the standard key bindings, they are disabled when the modal dialogs come up The items in the right-click menu do NOT have the key bindings but they are enabled, i didn't make these menus The dialogs are modal I agree it should just work. Is the problem that the

Re: Dialog Command Keys

2011-07-26 Thread Joar Wingfors
On 26 jul 2011, at 08:09, Bill Appleton wrote: > There ARE cut, copy, and paste items in this menu, but they DONT have any > command key bindings, maybe that is the problem? i didn't create this menu > in the first place Yes, that is at least part of the problem. If the items in your main menu

Re: Fastest high-quality thumbnail display

2011-07-26 Thread James Merkel
On Jul 26, 2011, at 7:34 AM, Kyle Sluder wrote: On Jul 26, 2011, at 7:04 AM, James Merkel wrote: Yeah, it looks like I can't use CIImage because of the memory leak. Every time an image is opened, the memory footprint increases by the size of the image. Using CIImage was kind of a cul-de-s

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
The main edit menu items are disabled when the dialog(s) come up. On Tue, Jul 26, 2011 at 8:23 AM, Kyle Sluder wrote: > On Jul 26, 2011, at 8:09 AM, Bill Appleton > wrote: > > And when i right-click in them i get a clever menu with search in google, > convert to uppercase, etc. > > > Please

Re: Dialog Command Keys

2011-07-26 Thread Kyle Sluder
On Jul 26, 2011, at 8:09 AM, Bill Appleton wrote: > And when i right-click in them i get a clever menu with search in google, > convert to uppercase, etc. Please note I said "menu bar," not "right-click menu." What about the items on the Edit menu? --Kyle Sluder > __

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
Whoops yes, command-x So i create some NSTextFields on the dialog window (can't use Interface Builder, this is a dynamically created dialog) And when i right-click in them i get a clever menu with search in google, convert to uppercase, etc. There ARE cut, copy, and paste items in this menu, bu

Re: Dialog Command Keys

2011-07-26 Thread Kyle Sluder
On Jul 26, 2011, at 7:52 AM, Bill Appleton wrote: > BUT my question is that it seems like there ought to be an easy or automatic > way to do this. If i right-click on a text control i get a pop up menu with > cut, copy, and other options. That same control isn't smart enough to handle > the

Re: Dialog Command Keys

2011-07-26 Thread Bill Appleton
In the manual it says: "However, subclasses of other Application Kit classes (including custom views) need to provide their own implementations of performKeyEquivalent:. The implementation should extract the characters for a key equivalent from the passed-in NSEvent object using the charactersIgno

Re: [SOLVED] Problem getting my layers to draw in the right order

2011-07-26 Thread Kyle Sluder
On Jul 26, 2011, at 7:13 AM, Graham Cox wrote: > Anyway, what I've learned is that the z values need to be big, and probably > not terribly precise. David Duncan's post in this thread seems relevant: http://www.cocoabuilder.com/archive/cocoa/193266-reordering-calayer-sublayers-without-raping-m

Re: Fastest high-quality thumbnail display

2011-07-26 Thread Kyle Sluder
On Jul 26, 2011, at 7:04 AM, James Merkel wrote: > Yeah, it looks like I can't use CIImage because of the memory leak. > Every time an image is opened, the memory footprint increases by the size of > the image. > Using CIImage was kind of a cul-de-sac. I don't see how this is unexpected behavio

[SOLVED] Problem getting my layers to draw in the right order

2011-07-26 Thread Graham Cox
OK, turns out that the zPosition property of the layers is important here. I was setting them to values like 100, and -100. That turns out to be way too small - the perspective/rotation transform I was applying to the 'behind' layers was swinging these layers into a zPosition that greatly exceed

Re: Fastest high-quality thumbnail display

2011-07-26 Thread James Merkel
On Jul 26, 2011, at 1:39 AM, Mike Abdullah wrote: On 26 Jul 2011, at 01:55, James Merkel wrote: Well, I see I have a huge memory leak in CIImage. However, I don't see where my code is in error. Also, according to Instruments Object Allocation, ImageIO is holding this memory. So I guess Co

Cancelling a CATransaction's completionBlock

2011-07-26 Thread Graham Cox
I'm using a completion block with CATransaction to clear a few ivars when an animation finishes. The animation takes quite a few seconds, so it's quite easy for an event which 'undoes' the same animation to arrive during that time. That's no big problem - the animation just goes to the new value

Re: Disable Lion's window restoration?

2011-07-26 Thread Jean-Daniel Dupas
Le 26 juil. 2011 à 02:33, Gerd Knops a écrit : > Hi, > > Is there an application-global way of disabling window restoration? > > All I can find is NSWindow's "- (BOOL)isRestorable" method (and it's > relatives). > > I was hoping for something more global, like a "- (BOOL)shouldRestoreWindows"

[ANN] LuaCocoa v.0.3 released

2011-07-26 Thread Eric Wing
I am happy to announce the third public release of LuaCocoa (v. 0.3). This version is mostly a Xcode 4 and Lion compatibility release, but also includes a handful of improvements. LuaCocoa is a next generation Lua/Objective-C bridge that uses BridgeSupport and libffi on Mac OS X to provide full au

Re: How can i change a app position and size?

2011-07-26 Thread Bill Cheeseman
On Jul 26, 2011, at 1:02 AM, Jens Alfke wrote: > On Jul 24, 2011, at 4:14 PM, Diego Alvarez Nogueira wrote: > >> How can i change a app position and size by Pid number? > > You mean resizing other apps’ windows? I think the only option is using UI > Scripting, where you can send an app AppleEv

Re: Fastest high-quality thumbnail display

2011-07-26 Thread Mike Abdullah
On 26 Jul 2011, at 01:55, James Merkel wrote: > Well, I see I have a huge memory leak in CIImage. > However, I don't see where my code is in error. > Also, according to Instruments Object Allocation, ImageIO is holding this > memory. > So I guess Core Image calls IImageIO. Yes, since ImageIO's