Re: Binding of invisible controls: is lazy data loading possible?

2009-01-21 Thread Ken Thomases

On Jan 19, 2009, at 7:25 PM, Quincey Morris wrote:

If anyone can find a place in any documentation or header files that  
*says* the indexed to-many accessors (such as  
insertObject:inAtIndex: and removeObjectFromAtIndex:) are  
KVO-compliant when used directly, you'd be doing a public service by  
posting a link.


While researching an answer for a different thread, I found it:

The description of NSKeyValueChangeKindKey in the NSKeyValueObserving  
protocol reference[1] says that:


A value of NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or  
NSKeyValueChangeReplacement indicates that mutating messages have  
been sent to the array returned by a mutableArrayValueForKey:  
message sent to the object, or that one of the key-value-coding- 
compliant array mutation methods for the key has been invoked, or  
that willChange:valuesAtIndexes:forKey:/ 
didChange:valuesAtIndexes:forKey: has otherwise been invoked.


It documents that "the key-value-coding-compliant array mutation  
methods" generate change notifications of one of those kinds.   
Further, it makes clear, by implication, that KVO does this by hooking  
into those methods when a property is being observed and invoking will/ 
didChange:valuesAtIndexes:forKey: within its overrides.


Cheers,
Ken

[1] http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/Reference/Reference.html#/ 
/apple_ref/doc/uid/20002299-SW1

___

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: Cursor updates - bug or programmer ignorance?

2009-01-21 Thread Luke Evans

Thanks for the suggestion.  You were spot on!

I changed the scroll view cursor to pointingHandCursor and guess what  
appears after the short pause?  Pity cocoa doesn't have a standard  
icon of a smoking gun :-)


Right, well at least now I know the perpetrator!  The next question is  
of course what to do about it.


I looked in the NSScrollView, NSClipView and NSView documentation, and  
I think "poorly documented" is a bit mild.  I can see the methods on  
NSScrollView and NSClipView, but haven't found anything that indicates  
when the scroll view updates the cursor, how to stop it trying or how  
to know that it has gone and messed with the cursor so I can 'repair  
the damage'.  Any suggestions for the fix?


I can probably have my code update the scroll view's idea of what the  
cursor should be every time I assert it - but that seems extremely  
awkward.  I tried setting 'nil' as the cursor to see if I could bind  
the little imp in NSScroller and prevent him from setting the cursor,  
but apparently he interprets this as my desire to have an arrow cursor  
forced on my table view every few seconds.


I'm hoping for a reasonable way to turn this off - otherwise is really  
seems like a bug (to harken back to by original subject line).


Thanks again for the help so far.  I can't imagine how long it would  
have taken to finger NSScrollView as the culprit otherwise - that was  
so outside the lines of enquiry I had drafted up to that point!



It's poorly documented, but a NSScrollView (or perhaps its  
NSClipView) will sometimes reset the cursor, and your NSTableView is  
of course embedded in a NSScrollView. However, I've only seen it  
change the cursor like this when the mouse is down (e.g.  
autoscrolling or interacting with the scroll bars).


There's also an easy experiment you can try. In your subclass  
initialization, call [NSScrollView setDocumentCursor:] with an  
easily recognizable cursor that you don't otherwise use. Then if  
your problem is NSScrollView's fault, the cursor will switch to that  
cursor instead of the arrow.




___

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: Binding of invisible controls: is lazy data loading possible?

2009-01-21 Thread Quincey Morris

On Jan 21, 2009, at 00:06, Ken Thomases wrote:


On Jan 19, 2009, at 7:25 PM, Quincey Morris wrote:

If anyone can find a place in any documentation or header files  
that *says* the indexed to-many accessors (such as  
insertObject:inAtIndex: and removeObjectFromAtIndex:) are  
KVO-compliant when used directly, you'd be doing a public service  
by posting a link.


While researching an answer for a different thread, I found it:


Ah, thanks for finding it. :) I'm working up to submitting a  
documentation bug report, but the whole subject is (TBH) kind of of  
messily documented, and I haven't quite worked out yet what I want to  
complain about.


The description of NSKeyValueChangeKindKey in the  
NSKeyValueObserving protocol reference[1] says that:


A value of NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or  
NSKeyValueChangeReplacement indicates that mutating messages have  
been sent to the array returned by a mutableArrayValueForKey:  
message sent to the object, or that one of the key-value-coding- 
compliant array mutation methods for the key has been invoked, or  
that willChange:valuesAtIndexes:forKey:/ 
didChange:valuesAtIndexes:forKey: has otherwise been invoked.


It documents that "the key-value-coding-compliant array mutation  
methods" generate change notifications of one of those kinds.   
Further, it makes clear, by implication, that KVO does this by  
hooking into those methods when a property is being observed and  
invoking will/didChange:valuesAtIndexes:forKey: within its overrides.


I wondered about this, too, though I came up with some reason (which  
I've now forgotten) for thinking that the accessor overrides did *not*  
go through will/didChange. If they do, it should be possible to  
override all 6 will/didChange methods themselves, and watch *all* KVO  
notifications being sent. I guess that's testable easily enough.



___

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


Job Opportunity: Experienced Cocoa User Interface Developer ( Full Time, New York City)

2009-01-21 Thread Marc Van Olmen
Experienced Cocoa User Interface Developer (full time position, New  
York City)


Responsibilities:

• Participate in design activities with team members
• Discuss requirements with end users
• Sketch and wireframe possible user interfaces
	• Implement, test, debug, document and integrate new User Interface  
components into existing code base

Requirements:

• Very good knowledge of Cocoa/Objective-C
• At least 3 year experience with Cocoa/Objective-C
• Must have worked on shipping Cocoa products
• Experience with Quartz
• Experience with customizing Cocoa controls
• Passion for user interface design
• Knowledge of Apple Human Interface Guidelines
	• Ability to work on-location in Manhattan (no off-site consultants  
please)

Useful experience:

• OpenGL
• Subversion or git
Job Benefits (beside the industry standards):

	• Be part of a small team of experienced developers who enjoy  
creative freedom.

• Work in a large, bright Manhattan office.
	• Contribute to an exciting product that will be publicly launched to  
change the world of digital photography.

Who is Boxwork

Boxwork is the digital division of Box, a multimedia company that  
combines technical innovation and artistic sensibility. Using  
customized tools we offer a full suite of creative services from  
digital capture and image fabrication to exhibition and book  
publishing. Work by Box regularly appears on the covers and pages of  
major publications, television and cable networks, in fine art books  
and museums as well as some of the world's leading advertising  
campaigns.


Boxwork includes an internal research and development team that acts  
as a think tank to create novel solutions for internal and external  
production and administrative challenges. Our expert programmers,  
engineers and technicians work side by side to quickly turn ideas into  
realities. As a result we have several software and hardware products  
that have given us a range of tools to address digital capture,  
digital asset management, workflow oversight, color profiling, color  
enhancement and color management. We see these tools as a  
differentiator that keeps Box continually on the forefront of the  
industry.


Please send your resumes to:

boxworkj...@boxstudios.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: draw two strokes(lines) simultaneousy on NSView

2009-01-21 Thread Mark Barclay
Gami,

To handle two input devices separately, as long as at least one of tehm is a
tablet type of device (such as a Wacom tablet), you can etst the value of
deviceId in the NSEvent that accompanies the mouseDragged, mouseDragged and
mouseUp methods you override in your NSView subclass (assuming that fits in
the way you are dealing with pointing device input).

/* this message is valid for mouse events with subtype
NSTabletPointEventSubtype or NSTabletProximityEventSubtype, and for
NSTabletPoint and NSTabletProximity events */
- (NSUInteger)deviceID;

OT - I¹m sorry if this message did not hit the list the way it¹s supposed
to. I subscribe to this list in a digest, and I could not figure out how to
reply directly to one of the messages in it. Please help if you know how I
can do that.

Mark

___

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


CALayer animating images

2009-01-21 Thread Kishore Gedela

Hi All,
	I'm working on a presentation application which will animate given  
images with a specified transition. I'm using CALayer to animate/ 
display the images.
	When animating/displaying large sized images I'm getting a white  
screen with "... image is too large for GPU, ignoring" exception.


	In the same application I'm displaying an RSS crawler (Quartz  
Composition layer), when the image transition takes place the crawler  
seems to hang for a while.


BTW, I am placing the layers on top of a single layer.

Anybody please direct me in resolving such issues.

Thanks
Kishore

___

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 iPod icon, was Getting the network Machine Icon

2009-01-21 Thread Russell Hancox

Dave,

Due to there being an icon stored on the root of each iPod, I don't  
*think* there is an icon stored on the system for each one.


Russell

On 20 Jan 2009, at 02:38 pm,  wrote:


Hi All,

I would like to something similar which is to display the Icons of  
iPods. I can get the .icns files for the iPhone and iPod Touch from:


/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/

But where to locate the icons for iPods?

Thanks a lot
All the Best
Dave

On 11 Jan 2009, at 19:31, Sandro Noel wrote:


Greetings

I'm looking for a way to programatically get the machine icon from  
my servers, just like finder does in the finder.
for every type of mac it has a different icon, and for windows  
computers, it;s the nice crash screen icon.


I would like my application to represent the network hosts as  
finder does.


I looked over the internet but could not find how finder does it.
I did however find the icons in /System/Library/CoreServices/ 
CoreTypes.bundle/Contents/Resources/


Any suggestions on where to look??

Thank you in advance.
Sandro Noel.
___

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/dave%40looktowindward.com

This email sent to d...@looktowindward.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/admin 
%40soulsniper.net


This email sent to ad...@soulsniper.net




smime.p7s
Description: S/MIME cryptographic signature
___

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 iPod icon, was Getting the network Machine Icon

2009-01-21 Thread Jean-Daniel Dupas
iTunes contains a full list of iPod icon (in iTunes.rsrc). Could it be  
responsible to set the iPod icon ?



Le 20 janv. 09 à 19:40, Russell Hancox a écrit :


Dave,

Due to there being an icon stored on the root of each iPod, I don't  
*think* there is an icon stored on the system for each one.


Russell

On 20 Jan 2009, at 02:38 pm,  wrote:


Hi All,

I would like to something similar which is to display the Icons of  
iPods. I can get the .icns files for the iPhone and iPod Touch from:


/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/

But where to locate the icons for iPods?

Thanks a lot
All the Best
Dave

On 11 Jan 2009, at 19:31, Sandro Noel wrote:


Greetings

I'm looking for a way to programatically get the machine icon from  
my servers, just like finder does in the finder.
for every type of mac it has a different icon, and for windows  
computers, it;s the nice crash screen icon.


I would like my application to represent the network hosts as  
finder does.


I looked over the internet but could not find how finder does it.
I did however find the icons in /System/Library/CoreServices/ 
CoreTypes.bundle/Contents/Resources/


Any suggestions on where to look??

Thank you in advance.
Sandro Noel.
___

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/dave%40looktowindward.com

This email sent to d...@looktowindward.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/admin%40soulsniper.net

This email sent to ad...@soulsniper.net


___

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/devlists%40shadowlab.org

This email sent to devli...@shadowlab.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


Re: Cursor updates - bug or programmer ignorance?

2009-01-21 Thread Quincey Morris

On Jan 21, 2009, at 00:12, Luke Evans wrote:

I changed the scroll view cursor to pointingHandCursor and guess  
what appears after the short pause?  Pity cocoa doesn't have a  
standard icon of a smoking gun :-)


No, but you got the Flying Fickle Finger of Fate, which is almost as  
good.


Right, well at least now I know the perpetrator!  The next question  
is of course what to do about it.


I looked in the NSScrollView, NSClipView and NSView documentation,  
and I think "poorly documented" is a bit mild.  I can see the  
methods on NSScrollView and NSClipView, but haven't found anything  
that indicates when the scroll view updates the cursor, how to stop  
it trying or how to know that it has gone and messed with the cursor  
so I can 'repair the damage'.  Any suggestions for the fix?


I can probably have my code update the scroll view's idea of what  
the cursor should be every time I assert it - but that seems  
extremely awkward.  I tried setting 'nil' as the cursor to see if I  
could bind the little imp in NSScroller and prevent him from setting  
the cursor, but apparently he interprets this as my desire to have  
an arrow cursor forced on my table view every few seconds.


I'm hoping for a reasonable way to turn this off - otherwise is  
really seems like a bug (to harken back to by original subject line).



The only thing I can think of, offhand, that *might* have the timing  
you describe is automatic toolbar item validation. Do you have a  
toolbar on this window by any chance?


Or, if something in your underlying data model is changing constantly,  
there may be a stream of user interface element updates causing this.  
For example, if you're constantly telling the NSTableView that its  
(variable) row heights are changing, it may keep resizing itself  
without any actual updates being visually apparent.


If you're devious enough, you might be able to set a breakpoint where  
NSScrollView is setting the cursor. (You could try, for example, to  
subclass NSCursor using an image you supply, with an override of  
setCursor: that just calls super. Then pass a cursor of your subclass  
to setDocumentCursor.) The backtrace when the breakpoint is hit  
*might* give you a clue as to why it's doing it.


If you want to try for a quick fix, I'd suggest you try turning on  
mouseEntered/Exited for your tracking area, and to change the  
NSScrollView cursor on mouseEntered, and restore it on mouseExited. It  
wouldn't be perfect, due to some unrelated defects in tracking areas,  
but it might well be good enough.



___

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: Binding of invisible controls: is lazy data loading possible?

2009-01-21 Thread mmalc Crawford


On Jan 21, 2009, at 12:30 AM, Quincey Morris wrote:

If anyone can find a place in any documentation or header files  
that *says* the indexed to-many accessors (such as  
insertObject:inAtIndex: and removeObjectFromAtIndex:)  
are KVO-compliant when used directly, you'd be doing a public  
service by posting a link.

While researching an answer for a different thread, I found it:

Ah, thanks for finding it. :)


It's not clear why this is any more satisfactory than the previous...

I'm working up to submitting a documentation bug report, but the  
whole subject is (TBH) kind of of messily documented, and I haven't  
quite worked out yet what I want to complain about.


"'Ensuring KVO Compliance' at  should make explicit whether a class that allows automatic observer  
notifications for a property will automatically emit KVO change  
notifications for KVC-compliant collection mutators."


mmalc

___

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


Store value of qc color picker in plist

2009-01-21 Thread Jonathan Selander
I use a QCCompositionParameterView to manipulate values of my  
composition, and i want to store those values in a plist. It works  
fine for al strings and numbers, but storing a 'color' seems to be a  
bit more complicated.


This is the code i tried:

[standardUserDefaults setObject:[qcView valueForInputKey:@"keyColor"]  
forKey:@"keyColor"];


And it logs the following:

2009-01-21 10:30:18.982 Calibrator[36961:10b] *** -[NSUserDefaults  
setObject:forKey:]: Attempt to insert non-property value  
'NSCalibratedRGBColorSpace 1 0 0 1' of class 'NSCachedRGBColor'.


After this also comes the problem of reading the value into the color  
picker.

___

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 iPod icon, was Getting the network Machine Icon

2009-01-21 Thread jonat...@mugginsoft.com


On 21 Jan 2009, at 08:50, Jean-Daniel Dupas wrote:

iTunes contains a full list of iPod icon (in iTunes.rsrc). Could it  
be responsible to set the iPod icon ?



A convenient way to browse this resource is with ThemePark. Goto menu  
File - Open Special - iTunes.rsrc

http://www.geekspiff.com/software/themepark/



Le 20 janv. 09 à 19:40, Russell Hancox a écrit :


Dave,

Due to there being an icon stored on the root of each iPod, I don't  
*think* there is an icon stored on the system for each one.


Russell

On 20 Jan 2009, at 02:38 pm,  wrote:


Hi All,

I would like to something similar which is to display the Icons of  
iPods. I can get the .icns files for the iPhone and iPod Touch from:


/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/

But where to locate the icons for iPods?

Thanks a lot
All the Best
Dave

On 11 Jan 2009, at 19:31, Sandro Noel wrote:


Greetings

I'm looking for a way to programatically get the machine icon  
from my servers, just like finder does in the finder.
for every type of mac it has a different icon, and for windows  
computers, it;s the nice crash screen icon.


I would like my application to represent the network hosts as  
finder does.


I looked over the internet but could not find how finder does it.
I did however find the icons in /System/Library/CoreServices/ 
CoreTypes.bundle/Contents/Resources/


Any suggestions on where to look??

Thank you in advance.
Sandro Noel.
___

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/dave%40looktowindward.com

This email sent to d...@looktowindward.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/admin%40soulsniper.net

This email sent to ad...@soulsniper.net


___

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/devlists%40shadowlab.org

This email sent to devli...@shadowlab.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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.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: Binding of invisible controls: is lazy data loading possible?

2009-01-21 Thread Quincey Morris

On Jan 21, 2009, at 01:11, mmalc Crawford wrote:


It's not clear why this is any more satisfactory than the previous...


It's just that the previous one appeared to be talking about what to  
implement, not what to call. *That* is only an issue because the main  
text at


	http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/AccessorConventions.html#/ 
/apple_ref/doc/uid/20002174-178830-BAJEDEFB


obscures what ought to be obvious or explicit -- that what you  
implement *is* what you call (or can be). For example, in that  
section, talking about getters:


Supporting to-many relationships in this manner requires that your  
class implement two methods using the naming pattern -countOf  
and -objectInAtIndex:. [...] Implementing these methods allows  
your application to invoke valueForKey: using the key for the to- 
many property.


It appears to be making a clear distinction between what you implement  
and what you call. "Implement this, invoke that." Or, later, for  
setters:


The key-value coding methods mutableArrayValueForKey: and  
mutableArrayValueForKeyPath: provide mutable access to a to-many  
relationship [...]. In order to support these methods, your class  
must implement two additional methods for each of these keys: - 
insertObject:inAtIndex: and -removeObjectFromAtIndex:.
Same distinction. "Implement these, mutable access via those", it  
appears to say. It speaks the truth, just not enough of it.
"'Ensuring KVO Compliance' at  should make explicit whether a class that allows automatic  
observer notifications for a property will automatically emit KVO  
change notifications for KVC-compliant collection mutators."


So this is not the only place that really needs just a little bit of  
clarifying wording.



___

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


Flickering while capturing Live Video...

2009-01-21 Thread Anshul jain
I am trying to capture live video through a fire wire camera. and for  
displaying live video i am using  QCCaptureLayer. it works fine with a  
USB Camera but as soon as Firewire camera is use flickering starts  
happening. Any suggestion where i am going wrong or its a bug with  
QCCaptureLayer.?





Thanks!,
Anshul





___

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


Document based application and drag & drop open

2009-01-21 Thread Domenico Testa
I'm writing a pyobjc document-based cocoa application, but i think my
question relates to cocoa framework rather than on programming language, so
i post it here.

The application is a digital signature client that should be able to sign
any file type producing a .p7m file.
Apllication will support timestamping too, so it could generate .tsr files
too.

I began from the document-based cocoa template from XCode and i've
subclassed NSDocument for P7MDocument and for TSRDocument, writing two
separating Windows, each in its XIB file.

Using Info.plist i can obtain that double clicks on supported file types
open my app (and the right NSDocument window too), showing the right UI.

Now i want that every file could be dragged on application dock icon to
spawn a modal window asking the operation to take. I've tried overloading
application:openFiles but it works just for supported files.
I want to distinguish drag-on-icon file opening from double-click file
opening: how could i achieve this result?

Thanks in advance

-- 
Domenico Testa
http://del.icio.us/domtes
___

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


PDFView printing subviews

2009-01-21 Thread Martin F. Carianni
I've a PDFView (built in IB) with a loaded PDFDocument containing a  
form. I want to compile the form with a bunch of textfields already  
populated.


PDFDocument *model = [[PDFDocument alloc] initWithData:[NSData  
dataWithContentsOfFile:@"/Users/neospiez/Desktop/model.pdf"]];


	NSTextField *oneText = [[NSTextField alloc]  
initWithFrame:NSMakeRect(200, 555, 200, 17)];

[oneText setStringValue:[oneConstText stringValue]];

[PDFForPrinting addSubview: oneText];
[PDFForPrinting setDocument: model];
[PDFForPrinting layoutDocumentView];

	[PDFForPrinting printWithInfo:[NSPrintInfo sharedPrintInfo]  
autoRotate:YES];



Now, this prints the PDFVIEW without the subview, prints just the  
model from the PDFDocument.


Is there any way to make it print it alongside the subviews?

Thank you.

___

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: Store value of qc color picker in plist

2009-01-21 Thread Mike Abdullah
Well, pretty much as the message says, a colour object is unsuitable  
for inclusion in a property list. I suggest you instead serialise it  
to an NSData object using NSKeyedArchiver/Unarchive.


Mike.

On 21 Jan 2009, at 09:31, Jonathan Selander wrote:

I use a QCCompositionParameterView to manipulate values of my  
composition, and i want to store those values in a plist. It works  
fine for al strings and numbers, but storing a 'color' seems to be a  
bit more complicated.


This is the code i tried:

[standardUserDefaults setObject:[qcView  
valueForInputKey:@"keyColor"] forKey:@"keyColor"];


And it logs the following:

2009-01-21 10:30:18.982 Calibrator[36961:10b] *** -[NSUserDefaults  
setObject:forKey:]: Attempt to insert non-property value  
'NSCalibratedRGBColorSpace 1 0 0 1' of class 'NSCachedRGBColor'.


After this also comes the problem of reading the value into the  
color picker.

___

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net


___

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


Switching NSDocument based application to tabbed views interface

2009-01-21 Thread Vladimir Pouzanov

Hi all,

I have a NSDocument based application, that seem to work ok for a case  
of one-two opened documents. However common usage pattern means, that  
an user would have 4-5 documents open at the same time requiring often  
use. I consider switching to tabbed interface model, but I'm somewhat  
lost in NSDocument window managing. Can someone give me a hint how can  
I switch one window per document model (that currently works as  
expected thanks to NSDocument) to one tab per document, same window?


--
Sincerely,
Vladimir "Farcaller" Pouzanov





___

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


Format float value to display with commas

2009-01-21 Thread Tharindu Madushanka
Hi
I have float variables that stores my currency values, I want to display
these values in a string with commas at each 3 digits, can I do it with
Objective C. I am new to the language. Please help me to solve this.
For example, float ft = 12333.8905;
NSString *strFloat = [NSString stringWithFormat:@"%.2f",ft];

this will show my float value with 2 decimal places 12333.89 , But I want it
to be displayed as 12,333.89
Can I do it with objective-C. I want to create a string like above from my
float value.

Thanks
Tharindu
___

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: Format float value to display with commas

2009-01-21 Thread Kenneth Bruno II

On Jan 21, 2009, at 6:59 AM, Tharindu Madushanka wrote:

I have float variables that stores my currency values, I want to  
display
these values in a string with commas at each 3 digits, can I do it  
with

Objective C. I am new to the language. Please help me to solve this.
For example, float ft = 12333.8905;
NSString *strFloat = [NSString stringWithFormat:@"%.2f",ft];

this will show my float value with 2 decimal places 12333.89 , But I  
want it

to be displayed as 12,333.89
Can I do it with objective-C. I want to create a string like above  
from my

float value.


What you probably want to do is use NSNumberFormatter.  With that  
class you can create a formatted string from a number or vice versa.


Here's a simple example:

   NSNumber *aNumber = [NSNumber numberWithFloat:123456.789];
   NSNumberFormatter *aFormatter = [NSNumberFormatter new];

   [aFormatter setNumberStyle:kCFNumberFormatterDecimalStyle];

   NSString *formattedNumber = [aFormatter  
stringFromNumber:aNumber];


   NSLog(formattedNumber);

Under my system this prints the following to console:

   123,456.789

I'm just relying on my default locale settings to format the number  
string.  Other people's locale might display differently.  If you want  
to force display of the grouping separator then you should look at the  
setUsesGroupingSeparator: method of NSNumberFormatter.




___

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


CALayer autoresizing behaviour

2009-01-21 Thread Joe Wildish

All,

I'm having trouble getting a CALayer to resize automatically to fill  
its superlayer. I have the following code snippet:


layer = [CALayer layer];
layer.layoutManager  = [CAConstraintLayoutManager layoutManager];
layer.autoresizingMask = kCALayerWidthSizable |  
kCALayerHeightSizable;


object.frame = CGRectMake(0.0f, 0.0f, 100.0f, 100.0f);
[object addSublayer:layer];

NSLog(@"object.frame=%@,\nlayer.frame=%@",
NSStringFromRect(NSRectFromCGRect(object.frame)),
NSStringFromRect(NSRectFromCGRect(layer.frame)));

(NB: "object" is an instance of a CALayer).

It was my understanding that with the options that I've used for the  
autoresizing mask on "layer", it should be resized to be the same size  
as its super-layer. However, the output on the console indicates  
otherwise:


2009-01-21 13:03:31.538 TheAppName[37894:10b] object.frame={{0, 0},  
{100, 100}},

layer.frame={{0, 0}, {0, 0}}

I thought that it might be that the change was in a state of animation  
at the point of the NSLog, but the actual visual output I'd expect  
from my app also indicates that the resize hasn't occurred.


Is anyone able to point out what I'm doing wrong?

Many thanks,
-Joe
___

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


Setting the result of a javascript function to NSString

2009-01-21 Thread Alex Mills
Hey,

The Javascript based editor is here 
http://www.alexmillsdesign.com/Developer/FernEngine/Default.htm

>From Cocoa I want to get the 'innerHTML' from the iFrame and store it in a 
>NSString. 

What would be the best way of accomplishing this?

Cheers Guys, very much appreciated your help so far!

Cheers
Alex Mills
___

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: Setting the result of a javascript function to NSString

2009-01-21 Thread Jean-Daniel Dupas

Completly untested:

NSString *content = [[myWebView windowScriptObject]  
evaluateWebScript 
:@"document.getElementById('box').contentDocument.body.innerHTML"];


And more info about Obj-C/JS integration at:

http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html


Le 21 janv. 09 à 14:56, Alex Mills a écrit :


Hey,

The Javascript based editor is here 
http://www.alexmillsdesign.com/Developer/FernEngine/Default.htm

From Cocoa I want to get the 'innerHTML' from the iFrame and store  
it in a NSString.


What would be the best way of accomplishing this?

Cheers Guys, very much appreciated your help so far!

Cheers
Alex Mills
___

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/devlists%40shadowlab.org

This email sent to devli...@shadowlab.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


Newbie Memory Questions on a Code Fragment

2009-01-21 Thread James Cicenia

Hello -

I am new to iphone and objective-c etc.

Here is some code I wrote for the appdelegate to initialize some  
dictionaries and arrays:
My main question has to do with memory and releasing it.  In my app I  
will need listOfMonthNames for my popups
and will also need dictionaryOfProduceTypes to populate other  
dependent popups.


thanks
James

-(void)initializeArraysAndDictionaries {
if(!listOfMonthNames){
		NSArray *listOfMonthNamesTmp = [[NSArray alloc] initWithObjects:  
@"January 
",@"February 
",@"March 
",@"April 
",@"May 
",@"June 
",@"July",@"August",@"September",@"October",@"November",@"December"];


// enumerate over items
printf( "static array\n" );


[listOfMonthNames 
arrayByAddingObjectsFromArray:listOfMonthNames2];

// free memory
[listOfMonthNamesTmp release];
}
if(!dictionaryOfProduceTypes){
		// Create a distinct dictionary of types that hold an array of  
subtypes per type.

// Types and subtypes are attributes of the ProduceItem object

dictionaryOfProduceTypes = [[NSMutableDictionary alloc] init];

NSEnumerator *en = [produceItems objectEnumerator];
ProduceItem *item = nil;

while (item = [en nextObject]) {
if(![dictionaryOfProduceTypes objectForKey:item.type]){
//Doesn't exist yet, so allocate and initialize
[dictionaryOfProduceTypes takeValue:[[NSMutableArray alloc] init]  
forKey:item.type];

}


			NSMutableArray *subtypes = [dictionaryOfProduceTypes  
objectForKey:item.type];


			//Get the array then iterate through to see if we need to add a new  
subtype to be added

NSEnumerator *en2 = [subtypes objectEnumerator];
NSString *subtype = nil;

BOOL found = FALSE;
while (subtype = [en2 nextObject]) {
if([subtype compare:item.subtype]){
found = TRUE;
break;
}
}
if(!found){
[subtypes addObject:item.subtype];
}

[dictionaryOfProduceTypes takeValue:subtypes 
forKey:item.type];
[subtypes release];

}

[dictionaryOfProduceTypes release];
}

}
___

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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread Kenneth Bruno II

On Jan 21, 2009, at 9:23 AM, James Cicenia wrote:

Here is some code I wrote for the appdelegate to initialize some  
dictionaries and arrays:
My main question has to do with memory and releasing it.  In my app  
I will need listOfMonthNames for my popups
and will also need dictionaryOfProduceTypes to populate other  
dependent popups.

...

-(void)initializeArraysAndDictionaries {
if(!listOfMonthNames){
		NSArray *listOfMonthNamesTmp = [[NSArray alloc] initWithObjects:  
@"January 
",@"February 
",@"March 
",@"April 
",@"May 
",@"June 
",@"July",@"August",@"September",@"October",@"November",@"December"];


// enumerate over items
printf( "static array\n" );

[listOfMonthNames 
arrayByAddingObjectsFromArray:listOfMonthNames2];

// free memory
[listOfMonthNamesTmp release];


First of all, you probably should just use the localized list of month  
names that you can get through NSDateFormatter:


NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];


This will give you an NSArray populated with NSString objects that  
contain the localized month names in the proper order.  Notice that I  
retained the NSArray object.  I did this because it is given to me  
autoreleased so if I want to own it I need to retain it.  When I no  
longer need it I'll just call release on the object, this would most  
likely be done in the dealloc method of the class in which I  
initialized my object.



if(!dictionaryOfProduceTypes){
		// Create a distinct dictionary of types that hold an array of  
subtypes per type.

// Types and subtypes are attributes of the ProduceItem object

dictionaryOfProduceTypes = [[NSMutableDictionary alloc] init];

...


[dictionaryOfProduceTypes release];
}


By releasing the dictionaryOfProduceTypes object you are giving up  
control of the object and allowing it to be deallocated.  This means  
that the object that you just initialized won't be around when you  
need it.  You want to only call release when you are 100% sure that  
you won't need the object any more or when you are cleaning up, such  
as in the dealloc method for a class.


			NSMutableArray *subtypes = [dictionaryOfProduceTypes  
objectForKey:item.type];

...


[subtypes release];


The objecForKey method returns an autoreleased NSArray.  This means  
that its retain count is greater than zero for now, but it will be  
decremented to zero at some point in the future.  By calling release  
on this object you are causing it to be over-released and even worse  
this will happen at some apparently random time in the future.


You should only call release on objects that you have created through  
methods that begin with alloc, new, or copy or objects that you have  
previously called retain upon.  I suggest that you review the Cocoa  
Memory Management Rules to understand this further:




___

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: Format float value to display with commas

2009-01-21 Thread Rob Boellaard


  In addition to Kenneth Bruno's suggestion, there is also the Data  
Formatting guide:


  
http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/DataFormatting.html

  hth,

  Rob



On Jan 21, 2009, at 12:59 PM, Tharindu Madushanka wrote:


Hi
I have float variables that stores my currency values, I want to  
display
these values in a string with commas at each 3 digits, can I do it  
with

Objective C. I am new to the language. Please help me to solve this.
For example, float ft = 12333.8905;
NSString *strFloat = [NSString stringWithFormat:@"%.2f",ft];

this will show my float value with 2 decimal places 12333.89 , But I  
want it

to be displayed as 12,333.89
Can I do it with objective-C. I want to create a string like above  
from my

float value.

Thanks
Tharindu
___

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/rboell%40tuparev.com

This email sent to rbo...@tuparev.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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread James Cicenia

Thanks that helped a lot and clarified something I suspected.

James

On Jan 21, 2009, at 9:07 AM, Kenneth Bruno II wrote:


On Jan 21, 2009, at 9:23 AM, James Cicenia wrote:

Here is some code I wrote for the appdelegate to initialize some  
dictionaries and arrays:
My main question has to do with memory and releasing it.  In my app  
I will need listOfMonthNames for my popups
and will also need dictionaryOfProduceTypes to populate other  
dependent popups.

...

-(void)initializeArraysAndDictionaries {
if(!listOfMonthNames){
		NSArray *listOfMonthNamesTmp = [[NSArray alloc] initWithObjects:  
@"January 
",@"February 
",@"March 
",@"April 
",@"May 
",@"June 
",@"July",@"August",@"September",@"October",@"November",@"December"];


// enumerate over items
printf( "static array\n" );

[listOfMonthNames 
arrayByAddingObjectsFromArray:listOfMonthNames2];

// free memory
[listOfMonthNamesTmp release];


First of all, you probably should just use the localized list of  
month names that you can get through NSDateFormatter:


NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];


This will give you an NSArray populated with NSString objects that  
contain the localized month names in the proper order.  Notice that  
I retained the NSArray object.  I did this because it is given to me  
autoreleased so if I want to own it I need to retain it.  When I no  
longer need it I'll just call release on the object, this would most  
likely be done in the dealloc method of the class in which I  
initialized my object.



if(!dictionaryOfProduceTypes){
		// Create a distinct dictionary of types that hold an array of  
subtypes per type.

// Types and subtypes are attributes of the ProduceItem object

dictionaryOfProduceTypes = [[NSMutableDictionary alloc] init];

...


[dictionaryOfProduceTypes release];
}


By releasing the dictionaryOfProduceTypes object you are giving up  
control of the object and allowing it to be deallocated.  This means  
that the object that you just initialized won't be around when you  
need it.  You want to only call release when you are 100% sure that  
you won't need the object any more or when you are cleaning up, such  
as in the dealloc method for a class.


			NSMutableArray *subtypes = [dictionaryOfProduceTypes  
objectForKey:item.type];

...


[subtypes release];


The objecForKey method returns an autoreleased NSArray.  This means  
that its retain count is greater than zero for now, but it will be  
decremented to zero at some point in the future.  By calling release  
on this object you are causing it to be over-released and even worse  
this will happen at some apparently random time in the future.


You should only call release on objects that you have created  
through methods that begin with alloc, new, or copy or objects that  
you have previously called retain upon.  I suggest that you review  
the Cocoa Memory Management Rules to understand this further:





___

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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread Scott Ribe
You just need to know basic C and follow the very simple rules and not
needlessly complicate things.

- initWithObjects gives a perfectly good (and already retained)
array--there's no need to put it into a temp variable and then try to copy
it

- if listOfMonthNames is nil, then you would need to alloc & init an array
and assign to it--you can't call arrayByAddingObjectsFromArray on something
that's not an array and expect it to work

- what is listOfMonthNames2?



-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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: Setting the result of a javascript function to NSString

2009-01-21 Thread Mike Abdullah
WebKit has a full Obj-C DOM API which you can access starting at - 
[WebFrame DOMDocument]
From there it should be fairly easy to locate your iframe and grab  
it's inner HTML.


Mike.

On 21 Jan 2009, at 13:56, Alex Mills wrote:


Hey,

The Javascript based editor is here 
http://www.alexmillsdesign.com/Developer/FernEngine/Default.htm

From Cocoa I want to get the 'innerHTML' from the iFrame and store  
it in a NSString.


What would be the best way of accomplishing this?

Cheers Guys, very much appreciated your help so far!

Cheers
Alex Mills
___

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net


___

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


Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
How do you prevent an NSTextField from accepting anything aside from
numbers? Or will I need to code up a solution to remove text from the
field automatically? Display a dialog & clear the contents?

Thanks,
Brooke
___

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: Switching NSDocument based application to tabbed views interface

2009-01-21 Thread Ross Carter
Can someone give me a hint how can I switch one window per document  
model (that currently works as expected thanks to NSDocument) to one  
tab per document, same window?


This is answered in the archives. Search cocoabuilder.com for document  
window tabs

___

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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread Kenneth Bruno II

On Jan 21, 2009, at 9:07 AM, Kenneth Bruno II wrote:



NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];


One small error here, I should have added this line after these two in  
order to properly release the NSDateFormatter:


[aFormatter release];

This needs to be done because I created a new NSDateFormatter which  
has a retain count of 1.  Since I don't need it past this point I  
should release it.  It's a small memory leak if I don't but it's a  
good idea to always properly clean up after yourself.  Instead of  
adding an additional line to release I could have also just changed  
the first line to this:


NSDateFormatter *aFormatter = [[NSDateFormatter new] autorelease];

The advantage to using autorelease is that I now don't need to  
remember to release later and it puts the allocation and cleanup all  
in one line, producing cleaner code.  The disadvantage is that  
autoreleasing takes up a bit more time and memory than just releasing  
the object.  In this case that's negligible, only worry about it if  
you are creating and autoreleasing tons of objects in time or memory- 
critical code.

___

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: Limiting NSTextField to numbers?

2009-01-21 Thread I. Savant
On Wed, Jan 21, 2009 at 10:40 AM, Brooke Gravitt  wrote:
> How do you prevent an NSTextField from accepting anything aside from
> numbers? Or will I need to code up a solution to remove text from the
> field automatically? Display a dialog & clear the contents?

  See NSNumberFormatter.

--
I.S.
___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 11:07 AM, I. Savant  wrote:

>  See NSNumberFormatter.

Thanks for the RTFM.

It looks like you can no longer get an NSNumberFormatter from the
Views pane in Interface Builder & wire it up as was ( recent? )
convention. Is there still a way to do this? I'm not even sure how to
subclass objects in IB anymore, the GUI is quite a bit different than
in 2.x. Am I missing it? All the Cocoa books & web references point to
dragging the formatter from the Views pane onto your text field and
configuring it, then overriding the methods.

Brooke
___

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: Binding of invisible controls: is lazy data loading possible?

2009-01-21 Thread mmalc Crawford


On Jan 21, 2009, at 2:30 AM, Quincey Morris wrote:

So this is not the only place that really needs just a little bit of  
clarifying wording.



So just copy and paste what you just wrote into a bug report.

mmalc

___

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


Is there any mirroring in the Cocoa UI ?

2009-01-21 Thread eric b

Hello the list,

The idea is to use an application who needs RTL ( e.g. arabic or  
hebrew) and the question is : is there any mirroring in the UI ?


After searching a while, we found no mention of that in the Aqua  
Human Interface Guideline.



Thanks in advance for any hint  :-)

Eric Bachard

--
qɔᴉɹə




___

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


NSScrollView Tiger v Leopard

2009-01-21 Thread David Blanton

Given an NSMatrix enclosing scroll view,  _browserScrollView
Given an NSTableView enclosing scroll view,  _tableScrollView

Add _tableScrollView to  _browserScrollView

[_browserScrollView addSubview:_tableScrollView];

When the user switches from NSMatrix to NSTableView run this code:

[_tableScrollView setFrame:[_browserScrollView frame]]; 
[_tableScrollView setHidden:NO];
[_tableScrollView setNeedsDisplay:YES]; 
[_tableView reloadData];



On Tiger it works as I expect.

On Leopard the Thumb of the vertical scroll bar does not move.

The table can be scrolled by line / page up / down.


So, what am I doing that works in Tiger but not in Leopard?


David Blanton




___

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


Strange behaviour UITableView

2009-01-21 Thread Fabrizio Guglielmino
Hi all,
I have a UITableView where, sublcassing UITableViewCell, I made a
custom cell. This custom cell is made of a UIImageView and some
UILabel. This UITableView it's made with IB in a specific .xib with a
custom UITableViewController as File's owner.

I also need to make cell height custom so I've used "-
(CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath"  method and all
works.
There is only a strange graphic defect in the first row (the top one),
it has a thin horizontal line inside (same the ones make the border of
cell). I think this line is where the cell border was before it was
resized.
I'm not sure this is a problem only on iPhone simulator because I
can't still try it in real device (I'm waiting for enrollment) but I
suspect it's also in device. Are there some "best pratices" about row
height handling?

Many thanks
Fabrizio
___

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: Format float value to display with commas

2009-01-21 Thread Sanjay Samani

Tharindu,

you need to look at NSNumberFormatter in Cocoa, which will be able to  
do this for you.


Sanjay Samani
DayTime Software
http://daytimesoftware.com

On 21 Jan 2009, at 11:59, Tharindu Madushanka wrote:


Hi
I have float variables that stores my currency values, I want to  
display
these values in a string with commas at each 3 digits, can I do it  
with

Objective C. I am new to the language. Please help me to solve this.
For example, float ft = 12333.8905;
NSString *strFloat = [NSString stringWithFormat:@"%.2f",ft];

this will show my float value with 2 decimal places 12333.89 , But I  
want it

to be displayed as 12,333.89
Can I do it with objective-C. I want to create a string like above  
from my

float value.

Thanks
Tharindu
___

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/samani_sanjay%40yahoo.co.uk

This email sent to samani_san...@yahoo.co.uk



___

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: draw two strokes(lines) simultaneousy on NSView

2009-01-21 Thread Mark Barclay
Gami,

To handle two input devices separately, as long as at least one of tehm is a
tablet type of device (such as a Wacom tablet), you can etst the value of
deviceId in the NSEvent that accompanies the mouseDragged, mouseDragged and
mouseUp methods you override in your NSView subclass (assuming that fits in
the way you are dealing with pointing device input).

/* this message is valid for mouse events with subtype
NSTabletPointEventSubtype or NSTabletProximityEventSubtype, and for
NSTabletPoint and NSTabletProximity events */
- (NSUInteger)deviceID;



On 1/20/09 12:36 PM, "Raleigh Ledet"  wrote:

> Gami,
> 
> I assume that you have some way of knowing which device any given set
> of coordinates are from. You need to combine this information with
> your previous location data.
> 
> It sounds like you are doing this:
> xy = coordinateFromSomeDevice()
> draw line from prevXY to xy
> prevXY = xy
> 
> With multiple devices you will get very weird results as xy keeps
> jumping from one device to another. Instead do something along these
> lines:
> deviceIdx = indexOfSomeDevice()
> xy = coordinateFromSomeDevice()
> draw line from prevXY[deviceIdx] to xy
> prevXY[deviceIdx] = xy
> 
> Exactly how you want to store each devices prev location is up to you
> and my pseudo code above makes many assumptions for simplicity.
> 
> Note: Do not draw outside of your view's drawRect: method. Use the
> setNeedsDisplayInRect: and drawRect: methods as intended and described
> here:
> http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/In
> troduction/chapter_1_section_1.html
> 
> -raleigh
> 
> On Jan 19, 2009, at 10:35 PM, Gami Ravi wrote:
> 
>> Hi Graham,
>> Thanks for your answer.
>> Let me explain current scenario.
>> I have two input device from which i am getting raw coordinates(x,y).
>> When there is only one device i can draw paths using x,y
>> coordinates. All things are working fine.
>> Now if user writes using two input device on one surface
>> simultaeously then it should draw two individual path depending on
>> (x,y) coordinates from different input device.
>> so what is your inputs on this situation?
>> 
>> Thanks & Regards,
>> Ravi.
>> 
>> - Original Message - From: "Graham Cox" >> 
>> To: "Gami Ravi" 
>> Cc: 
>> Sent: Tuesday, January 20, 2009 11:56 AM
>> Subject: Re: draw two strokes(lines) simultaneousy on NSView
>> 
>> 
>>> 
>>> On 20 Jan 2009, at 5:12 pm, Gami Ravi wrote:
>>> 
 I want to create an application that will draws two strokes
 simultaneously on NSView. How can i draw two strokes
 simultaneously ?
 Any help would be appreciated.
>>> 
>>> You don't say what you want to stroke, but let's assume a
>>> NSBezierPath.
>>> 
>>> // ...set up stroke parameters for stroke 1 here ...
>>> 
>>> [path stroke];
>>> 
>>> // ...set up stroke parameters for stroke 2 here...
>>> 
>>> [path stroke];
>>> 
>>> 
>>> 
>>> In other words, you just draw one stroke then the other.
>>> 
>>> If you really want to stroke two lines or other paths
>>> "simultaneously" (not sure what you mean by that either - nothing
>>> is  truly simultaneous), then you can combine paths into one bezier
>>> path  object and stroke it all at once. However, you can't apply
>>> separate  stroke parameters to different parts of the path this way.
>>> 
>>> --Graham
>>> 
>>> 
>>> 
>>> 
>>> Email Scanned for Virus & Dangerous Content by : www.CleanMailGateway.com
>> 
>> -- 
>> _
>> Disclaimer: This e-mail message and all attachments transmitted with
>> it
>> are intended solely for the use of the addressee and may contain
>> legally
>> privileged and confidential information. If the reader of this message
>> is not the intended recipient, or an employee or agent responsible for
>> delivering this message to the intended recipient, you are hereby
>> notified that any dissemination, distribution, copying, or other use
>> of
>> this message or its attachments is strictly prohibited. If you have
>> received this message in error, please notify the sender immediately
>> by
>> replying to this message and please delete it from your computer. Any
>> views expressed in this message are those of the individual sender
>> unless otherwise stated.Company has taken enough precautions to
>> prevent
>> the spread of viruses. However the company accepts no liability for
>> any
>> damage caused by any virus transmitted by this email.
>> __
>> ___
>> 
>> 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/ledet%40apple.com
>> 
>> This email sent to le...@apple.com
> 
> _

Re: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread mmalc Crawford


On Jan 21, 2009, at 7:07 AM, Kenneth Bruno II wrote:


On Jan 21, 2009, at 9:23 AM, James Cicenia wrote:
First of all, you probably should just use the localized list of  
month names that you can get through NSDateFormatter:

NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];
This will give you an NSArray populated with NSString objects that  
contain the localized month names in the proper order.  Notice that  
I retained the NSArray object.  I did this because it is given to me  
autoreleased so if I want to own it I need to retain it.


As has been stated so many times here, talking in terms of whether  
something is autoreleased or not is typically counter-productive.  It  
may or may not be autoreleased.  You don't care.  All you care about  
is whether you own it or not.

The very simple rules for memory management are given here:
	


To diagnose memory management problems, you can use the Clang/LLVM  
static analyser which will tell you about problems even before you run  
your application:

   


 When I no longer need it I'll just call release on the object, this  
would most likely be done in the dealloc method of the class in  
which I initialized my object.



As a general statement, this is at best misleading.
If you maintain an object as an instance variable, you're expected to  
provide accessor methods to retain and release it as well.




The objecForKey method returns an autoreleased NSArray.


"An array you don't own".


You should only call release on objects that you have created  
through methods that begin with alloc, new, or copy or objects that  
you have previously called retain upon.  I suggest that you review  
the Cocoa Memory Management Rules to understand this further:



If you review that, you will find that your summary contains a small  
but important omission.  This is why it's typically better simply to  
point to the Guide than to try to summarise yourself.




NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];


One small error here, I should have added this line after these two  
in order to properly release the NSDateFormatter:

   [aFormatter release];
This needs to be done because I created a new NSDateFormatter which  
has a retain count of 1.




"Which you don't own..."
Chasing retain counts is one of the surest ways of quickly becoming  
confused when trying to track down memory management problems.



Since I don't need it past this point I should release it.  It's a  
small memory leak if I don't but it's a good idea to always properly  
clean up after yourself.


It's not clear why this is simply a "good idea"?  You should not allow  
your program to leak memory.  Even a "small" memory leak on an iPhone  
application can become a terminal problem if the code is called often  
enough.



Instead of adding an additional line to release I could have also  
just changed the first line to this:

   NSDateFormatter *aFormatter = [[NSDateFormatter new] autorelease];
The advantage to using autorelease is that I now don't need to  
remember to release later and it puts the allocation and cleanup all  
in one line, producing cleaner code.  The disadvantage is that  
autoreleasing takes up a bit more time and memory than just  
releasing the object.  In this case that's negligible, only worry  
about it if you are creating and autoreleasing tons of objects in  
time or memory-critical code.



Best practice is to avoid autorelease where you can.
On iPhone, this is especially true.  You should get into the habit of  
always directly managing objects' lifetimes when you can.


mmalc


___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Andy Lee
I haven't used a formatter myself, but I typed "formatter" in the  
search field of the Library window in IB, and it gave me three kinds  
of formatter object I could drag and drop, including NSNumberFormatter.


--Andy

On Jan 21, 2009, at 11:14 AM, Brooke Gravitt wrote:

On Wed, Jan 21, 2009 at 11:07 AM, I. Savant  
 wrote:



See NSNumberFormatter.


Thanks for the RTFM.

It looks like you can no longer get an NSNumberFormatter from the
Views pane in Interface Builder & wire it up as was ( recent? )
convention. Is there still a way to do this? I'm not even sure how to
subclass objects in IB anymore, the GUI is quite a bit different than
in 2.x. Am I missing it? All the Cocoa books & web references point to
dragging the formatter from the Views pane onto your text field and
configuring it, then overriding the methods.

Brooke
___

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/aglee%40mac.com

This email sent to ag...@mac.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: Limiting NSTextField to numbers?

2009-01-21 Thread CodingMammoth
Search for http://h4xr.org/59qy and drag-drop the left one into your  
NSTextField.


Jelle

On 21 Jan 2009, at 17:14, Brooke Gravitt wrote:

On Wed, Jan 21, 2009 at 11:07 AM, I. Savant  
 wrote:



See NSNumberFormatter.


Thanks for the RTFM.

It looks like you can no longer get an NSNumberFormatter from the
Views pane in Interface Builder & wire it up as was ( recent? )
convention. Is there still a way to do this? I'm not even sure how to
subclass objects in IB anymore, the GUI is quite a bit different than
in 2.x. Am I missing it? All the Cocoa books & web references point to
dragging the formatter from the Views pane onto your text field and
configuring it, then overriding the methods.

Brooke
___

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/maillist%40codingmammoth.com

This email sent to maill...@codingmammoth.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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread Kenneth Bruno II

On Jan 21, 2009, at 12:04 PM, mmalc Crawford wrote:



On Jan 21, 2009, at 7:07 AM, Kenneth Bruno II wrote:



When I no longer need it I'll just call release on the object, this  
would most likely be done in the dealloc method of the class in  
which I initialized my object.



As a general statement, this is at best misleading.
If you maintain an object as an instance variable, you're expected  
to provide accessor methods to retain and release it as well.


Not necessarily, the object could be purely for internal use in the  
class in which case you wouldn't provide accessor methods.  I made the  
general statement simply because I wanted to emphasize that you should  
only call release when you want to end your ownership of the object,  
for whatever reason.  It's up to the programmer to decide when that is  
appropriate.


You should only call release on objects that you have created  
through methods that begin with alloc, new, or copy or objects that  
you have previously called retain upon.  I suggest that you review  
the Cocoa Memory Management Rules to understand this further:



If you review that, you will find that your summary contains a small  
but important omission.  This is why it's typically better simply to  
point to the Guide than to try to summarise yourself.


Which is exactly why I linked to it and suggested that he read it  
instead of just relying on my summary.



NSDateFormatter *aFormatter = [NSDateFormatter new];
	NSArray *listOfMonthNames = [[aFormatter standaloneMonthSymbols]  
retain];


One small error here, I should have added this line after these two  
in order to properly release the NSDateFormatter:

  [aFormatter release];
This needs to be done because I created a new NSDateFormatter which  
has a retain count of 1.


"Which you don't own..."
Chasing retain counts is one of the surest ways of quickly becoming  
confused when trying to track down memory management problems.


I wouldn't ever advocate chasing retain counts, I was simply pointing  
out the fact that the object will stay around because I retained it.   
I probably should have said "has been retained by me and must be  
released" or something similar.


Since I don't need it past this point I should release it.  It's a  
small memory leak if I don't but it's a good idea to always  
properly clean up after yourself.


It's not clear why this is simply a "good idea"?  You should not  
allow your program to leak memory.  Even a "small" memory leak on an  
iPhone application can become a terminal problem if the code is  
called often enough.


Yes, memory leaks are a bad idea and should be taken care of - that's  
why I bothered to make a second post correcting my error.  I guess I  
could have said it more strongly but I think the point was made, avoid  
memory leaks.


___

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: NSURLConnection changing the URL

2009-01-21 Thread Mohan Parthasarathy
Mike,


On Tue, Jan 20, 2009 at 8:45 PM, Michael Ash  wrote:

> On Tue, Jan 20, 2009 at 7:49 PM, Mohan Parthasarathy 
> wrote:
> >>  Is there a way to not to allocate the connection everytime i need to
> send
> > a new request ?
> >
> 
>  Yes. I'm pretty sure that the URL loading framework will use HTTP
>  keepalives automatically when appropriate.
> 
> >>>
> >>> I am not sure i undrstood this.  If i allocate a NSURL connection
> >>> everytime
> >>> i need to fetch from a URL, wouldn't it set up a TCP connection
> everytime
> >>> and then download the data. If i can avoid that, wouldn't it be nice ?
> >>>
> >>
> >> Again, I'm pretty sure that the Cocoa URL loading functions will do this
> >> for you as appropriate. Trying to implement it yourself is unnecessary,
> and
> >> trying to go about it this particular way is futile as well as
> incorrect.
> >
> >
> > I don't want to do this myself. But i don't see anything in
> NSURLConnection
> > that would do this. If so, please point to me.
>
> *Do* *not* *make* *assumptions*.
>
> You're making a huge assumption here:
>
> A) NSURLConnections must be reused in order to have persistent HTTP
> connections.
>
> And then we have this simple fact:
>
> B) There is no way to reuse an NSURLConnection.
>
> Putting these two together, we have a conclusion:
>
> C) NSURLConnection does not allow persistent HTTP connections.
>
> Since conclusion C is pretty much absurd, it would follow that perhaps
> assumption A is wrong.
>

I have been doing networking for a long time but i admit that i am new to
Cocoa and Objective C. I did use Wireshark to see what happens when
initWithRequest multiple times and there was only one TCP connection, but
multiple GETs. Then i was told that using init multiple times is wrong which
did not occur to me inspite of reading Cocoa Guide and a book that i am
slowly trying examples with.


>
> But don't assume. *Test*. Write some code and then use a network
> sniffer to see if, in fact, persistent connections are being used.


Ah! this is the part i assumed. Sorry. When i release an NSURLConnection, i
assumed that all resources are released. It never occured me that
underneath, a connection will be maintained. I did see the TCP connection
close but i did not see the time when it was closed. Bad part on me.


> If you don't know how to use a sniffer, this is your golden
> opportunity to learn. Doing network programming without a sniffer is
> like doing carpentry without any eyes. A particularly talented person
> might get astonishingly far without them, but he's still going to
> suffer from a severe handicap relative to a person who can actually
> see.
>
> Above all, please don't come barging onto the mailing list asking
> about a half-baked solution for a problem that you haven't even
> verified the existence of.


Sorry, next time i will do my homework thoroughly.

-mohan


>
> 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/suruti94%40gmail.com
>
> This email sent to surut...@gmail.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: Limiting NSTextField to numbers?

2009-01-21 Thread Peter Hudson
In IB in the Library panel, just below half way down there is a symbol  
on the left hand side which is a dollar sign ( and a calendar symbol  
next to it )  which is the number formatter.  Click this and drag it  
to the text field - and drop it on it.  Once the formatter is applied  
to the text field there is a small circle to the lower right of the  
edge of the text field - with a dollar in it.  Click this symbol and  
the formatter setup panel will appear in the Attributes Inspector.   
Set away !


There is however a slight problem in using formatters for input.  If  
you set it for numbers only, when the user types in an illegal  
character ( something other than a digit ) and tries to tab out of the  
field, they simply can't escape.  Likewise if you set a target /  
action and they try to press return to complete the entry.  There must  
be ways of frigging with the formatter to change this - but I've never  
bothered.


Instead of using a formatter,  if I want to collect digits from the  
user I simply subclass the NSTextField  and override - 
(void)textDidChange:(NSNotification *)aNotification.  Then every time  
the user enters something you can check what they have written and  
either allow it or not.


For example to convert input to uppercase I do the following :-


-(void)textDidChange:(NSNotification *)aNotification
{
if( [upperCaseBtn  state] == NSOnState )
{
[self  setStringValue:[[self  stringValue]  uppercaseString]];
}
}



peter
___

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: Is there any mirroring in the Cocoa UI ?

2009-01-21 Thread Gary L. Wade
Not in the sense you get from the Windows platform whereby setting a flag on
the parent window causes everything to automatically jump to the opposite
side of the window and lay itself out right-to-left.  Such alignment
requires a different layout (NIB/code/etc.), although with controls like
check boxes and radio buttons, you can affect such a result by changing the
icon placement to be on the right rather than the left.

On 01/21/2009 8:24 AM, "eric b"  wrote:

> Hello the list,
> 
> The idea is to use an application who needs RTL ( e.g. arabic or
> hebrew) and the question is : is there any mirroring in the UI ?
> 
> After searching a while, we found no mention of that in the Aqua
> Human Interface Guideline.
> 
> 
> Thanks in advance for any hint  :-)
> 
> Eric Bachard


___

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: NSScrollView Tiger v Leopard

2009-01-21 Thread Kyle Sluder
On Wed, Jan 21, 2009 at 11:48 AM, David Blanton  wrote:
> Add _tableScrollView to  _browserScrollView

Gah!  Why?

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


Adjusting cursor in non-key Panel window

2009-01-21 Thread Matt Gough
I have an NSButton subclass which sets the cursor to the  
pointingHandCursor whenever the mouse is over it. This button is in an  
NSPanel (Utility-styled).


@implementation PointingHandButton

-(void)resetCursorRects
{
  [self addCursorRect:[self bounds] cursor:[NSCursor  
pointingHandCursor]];

}

@end

Unfortunately the cursor only gets set when the panel is the key  
window and does not get set if the panel is non-key (but still front- 
most).


What is the best way to try and achieve this? If I could require 10.5  
then it looks like NSTrackingArea would be the way to go, in  
conjunction with NSTrackingActiveInActiveApp. Unfortunately I need to  
support 10.4 so this is not an option for now.


Thanks
___

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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Shawn Erickson
On Tue, Jan 20, 2009 at 5:30 PM, Graham Cox  wrote:

> When the nib is loaded, the accessor is used rather than setting the ivar 
> directly (as per Mac)

To be clear NIB loading on Mac OS X will use a setter if one exists
(assuming a name match)...

Outlet connections
In Mac OS X, the nib-loading code tries to reconnect outlets using the
object's own methods first. For each outlet, Cocoa looks for a method
of the form setOutletName: and calls it if such a method is present.
If it cannot find such a method, Cocoa searches the object for an
instance variable with the corresponding outlet name and tries to set
the value directly. If the instance variable cannot be found, no
connection is created.
...

So if you are targeting Mac OS X 10.5 and later you can use the same
property syntax as you see on the iPhone ... the same consistent
pattern will support both.

-Shawn
___

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


Observing [NSWindow orderOut:] ?

2009-01-21 Thread Matt Gough
Are there any notifications that get sent when a window is ordered out  
(as opposed to closing)? I have a button subclass that needs to know  
when its parent window is hidden. I was hoping that a [MyButton  
viewDidHide] override would catch these, but that isn't getting called  
when the window hides.



Thanks

Matt Gough
___

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: NSScrollView Tiger v Leopard

2009-01-21 Thread David Blanton

Why not?

On Jan 21, 2009, at 10:54 AM, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 11:48 AM, David Blanton  
 wrote:

Add _tableScrollView to  _browserScrollView


Gah!  Why?

--Kyle Sluder




David Blanton





___

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: Observing [NSWindow orderOut:] ?

2009-01-21 Thread Shawn Erickson
On Wed, Jan 21, 2009 at 10:04 AM, Matt Gough  wrote:
> Are there any notifications that get sent when a window is ordered out (as
> opposed to closing)? I have a button subclass that needs to know when its
> parent window is hidden. I was hoping that a [MyButton viewDidHide] override
> would catch these, but that isn't getting called when the window hides.

To help answer your question can you better explain why a button needs
to know about its "owning" window being ordered out? Why just when
ordered out?

-Shawn
___

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: Observing [NSWindow orderOut:] ?

2009-01-21 Thread I. Savant
On Wed, Jan 21, 2009 at 1:04 PM, Matt Gough  wrote:
> Are there any notifications that get sent when a window is ordered out (as
> opposed to closing)? I have a button subclass that needs to know when its
> parent window is hidden. I was hoping that a [MyButton viewDidHide] override
> would catch these, but that isn't getting called when the window hides.

  I would think NSWindow's notifications would be better suited, no? A
view hiding and reappearing is not the same as a window ...

--
I.S.
___

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


access programmatically the quartz composer image filters?

2009-01-21 Thread Michael Hanna
I'd like to access programmatically the quartz composer image
filters(just like it's done in the Automator script "Apply Quartz
Composition Filter to Image Files). How do I do this? Are they really
just CIFilters of a particular category?

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: Newbie Memory Questions on a Code Fragment

2009-01-21 Thread mmalc Crawford


On Jan 21, 2009, at 9:27 AM, Kenneth Bruno II wrote:


On Jan 21, 2009, at 12:04 PM, mmalc Crawford wrote:
When I no longer need it I'll just call release on the object,  
this would most likely be done in the dealloc method of the class  
in which I initialized my object.

As a general statement, this is at best misleading.
If you maintain an object as an instance variable, you're expected  
to provide accessor methods to retain and release it as well.
Not necessarily, the object could be purely for internal use in the  
class in which case you wouldn't provide accessor methods.


On the contrary, even if the object is purely for internal use, you  
should typically provide accessor methods.
You might not make them public, but using accessor methods pervasively  
is the best first step to getting memory management right (especially  
for a beginner...).


You should only call release on objects that you have created  
through methods that begin with alloc, new, or copy or objects  
that you have previously called retain upon.  I suggest that you  
review the Cocoa Memory Management Rules to understand this further:

If you review that, you will find that your summary contains a  
small but important omission.  This is why it's typically better  
simply to point to the Guide than to try to summarise yourself.
Which is exactly why I linked to it and suggested that he read it  
instead of just relying on my summary.



So why post an inaccurate summary in the first place?
Please, as I've said before, I'm increasingly convinced that most  
newcomers' confusion with memory management stems from inaccurate and  
misleading advice from forums and the web, so just point to the  
documentation.



One small error here, I should have added this line after these  
two in order to properly release the NSDateFormatter:

 [aFormatter release];
This needs to be done because I created a new NSDateFormatter  
which has a retain count of 1.

"Which you don't own..."
Chasing retain counts is one of the surest ways of quickly becoming  
confused when trying to track down memory management problems.
I wouldn't ever advocate chasing retain counts, I was simply  
pointing out the fact that the object will stay around because I  
retained it.  I probably should have said "has been retained by me  
and must be released" or something similar.



Yes.

mmalc

___

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: Observing [NSWindow orderOut:] ?

2009-01-21 Thread Jim Correia

On Jan 21, 2009, at 1:12 PM, Shawn Erickson wrote:

On Wed, Jan 21, 2009 at 10:04 AM, Matt Gough   
wrote:
Are there any notifications that get sent when a window is ordered  
out (as
opposed to closing)? I have a button subclass that needs to know  
when its
parent window is hidden. I was hoping that a [MyButton viewDidHide]  
override
would catch these, but that isn't getting called when the window  
hides.


To help answer your question can you better explain why a button needs
to know about its "owning" window being ordered out? Why just when
ordered out?


A use case for this is making a color swatch that "detaches" from the  
color panel correctly.


NSColorWell will detach from the color panel if you close the color  
panel by clicking in the close box, but doesn't detach if you toggle  
the color panel closed via a menu item targeting - 
orderFrontColorPanel:  (whose behavior no longer matches the literal  
name.)


Jim
___

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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
I have seen this same behavior too, creating @properties for IBOutlets
on the iPhone.  I have yet to run into a problem not
@property/@synthsizeing my Outlets on the iPhone, everything seems to
work just fine if you don't.  So am I missing something?  And am I
correct in assuming you would then be responsible for [myOutlet
release] in the dealloc?


On Wed, Jan 21, 2009 at 10:04 AM, Shawn Erickson  wrote:
> On Tue, Jan 20, 2009 at 5:30 PM, Graham Cox  wrote:
>
>> When the nib is loaded, the accessor is used rather than setting the ivar 
>> directly (as per Mac)
>
> To be clear NIB loading on Mac OS X will use a setter if one exists
> (assuming a name match)...
>
> Outlet connections
> In Mac OS X, the nib-loading code tries to reconnect outlets using the
> object's own methods first. For each outlet, Cocoa looks for a method
> of the form setOutletName: and calls it if such a method is present.
> If it cannot find such a method, Cocoa searches the object for an
> instance variable with the corresponding outlet name and tries to set
> the value directly. If the instance variable cannot be found, no
> connection is created.
> ...
>
> So if you are targeting Mac OS X 10.5 and later you can use the same
> property syntax as you see on the iPhone ... the same consistent
> pattern will support both.
>
> -Shawn
> ___
>
> 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/aventurella%40gmail.com
>
> This email sent to aventure...@gmail.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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
Answered my own question re the dealloc here:

Important: You are responsible for releasing the top-level objects of
any nib files you load when you are finished with those objects.
Failure to do so is a cause of memory leaks in many applications.
After releasing the top-level objects, it is a good idea to clear any
outlets pointing to objects in the nib file by setting them to nil.
You should clear outlets associated with all of the nib file's
objects, not just the top-level objects.

http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_6.html#//apple_ref/doc/uid/1051i-CH4-SW30


On Wed, Jan 21, 2009 at 10:25 AM, Adam Venturella  wrote:
> I have seen this same behavior too, creating @properties for IBOutlets
> on the iPhone.  I have yet to run into a problem not
> @property/@synthsizeing my Outlets on the iPhone, everything seems to
> work just fine if you don't.  So am I missing something?  And am I
> correct in assuming you would then be responsible for [myOutlet
> release] in the dealloc?
>
>
> On Wed, Jan 21, 2009 at 10:04 AM, Shawn Erickson  wrote:
>> On Tue, Jan 20, 2009 at 5:30 PM, Graham Cox  wrote:
>>
>>> When the nib is loaded, the accessor is used rather than setting the ivar 
>>> directly (as per Mac)
>>
>> To be clear NIB loading on Mac OS X will use a setter if one exists
>> (assuming a name match)...
>>
>> Outlet connections
>> In Mac OS X, the nib-loading code tries to reconnect outlets using the
>> object's own methods first. For each outlet, Cocoa looks for a method
>> of the form setOutletName: and calls it if such a method is present.
>> If it cannot find such a method, Cocoa searches the object for an
>> instance variable with the corresponding outlet name and tries to set
>> the value directly. If the instance variable cannot be found, no
>> connection is created.
>> ...
>>
>> So if you are targeting Mac OS X 10.5 and later you can use the same
>> property syntax as you see on the iPhone ... the same consistent
>> pattern will support both.
>>
>> -Shawn
>> ___
>>
>> 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/aventurella%40gmail.com
>>
>> This email sent to aventure...@gmail.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: NSURLConnection changing the URL

2009-01-21 Thread Mohan Parthasarathy
On Tue, Jan 20, 2009 at 9:17 PM, Michael Vannorsdel wrote:

> I've looked into this quite some time ago and have seen NSURLConnection
> keep FTP and HTTP connections open even after the originating
> NSURLConnection had been deallocated.  The same connection was reused for
> subsequent NSURLConnections to the same destination.  I never did see these
> close though so I don't know their lifetimes.  All I know is they lasted at
> least 5 mins.
>

Currently with iPhone Simulator, it seems 30 seconds. I am wondering why
this is not documented. Note the time it is open, but there is a possibility
that the connection may not be closed immediately. Wouldn't it make simpler
? At least to avoid flames :-)

>
> This came about because I saw the connections still open after the request
> had ended and was debugging to see why they were stuck open.  Never did
> figure out how to force them to close.
>
Once you lost control from the application, you better be sure that the
framework underneath is not buggy :-)

-mohan


>
>
>
>
> On Jan 20, 2009, at 9:45 PM, Michael Ash wrote:
>
>  *Do* *not* *make* *assumptions*.
>>
>> You're making a huge assumption here:
>>
>> A) NSURLConnections must be reused in order to have persistent HTTP
>> connections.
>>
>> And then we have this simple fact:
>>
>> B) There is no way to reuse an NSURLConnection.
>>
>> Putting these two together, we have a conclusion:
>>
>> C) NSURLConnection does not allow persistent HTTP connections.
>>
>> Since conclusion C is pretty much absurd, it would follow that perhaps
>> assumption A is wrong.
>>
>> But don't assume. *Test*. Write some code and then use a network
>> sniffer to see if, in fact, persistent connections are being used.
>>
>> If you don't know how to use a sniffer, this is your golden
>> opportunity to learn. Doing network programming without a sniffer is
>> like doing carpentry without any eyes. A particularly talented person
>> might get astonishingly far without them, but he's still going to
>> suffer from a severe handicap relative to a person who can actually
>> see.
>>
>> Above all, please don't come barging onto the mailing list asking
>> about a half-baked solution for a problem that you haven't even
>> verified the existence of.
>>
>
> ___
>
> 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/suruti94%40gmail.com
>
> This email sent to surut...@gmail.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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Dave DeLong
On Jan 21, 2009, at 11:25 AM, Adam Venturella   
wrote:



I have seen this same behavior too, creating @properties for IBOutlets
on the iPhone.  I have yet to run into a problem not
@property/@synthsizeing my Outlets on the iPhone, everything seems to
work just fine if you don't.  So am I missing something?  And am I
correct in assuming you would then be responsible for [myOutlet
release] in the dealloc?












My understanding is that declaring IBOotlets as properties is the  
recommended way of doing things. If you look in template code, you'll  
see that the outlets are released. This is to balance the retains sent  
during nib loading.


So really, it helps clarify the memory management of GUI elements.

Dave

Sent from my iPod. 
 
___


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


"Show In Menu Bar" Option?

2009-01-21 Thread Chunk 1978
what is the proper way to update the menu bar after switching the view
of the app's menu bar extension?  force quit the SystemUIServer?  or
actually just quit the SystemUIServer?  or is there a more common
method to updating the menu bar?
___

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: Switching NSDocument based application to tabbed views interface

2009-01-21 Thread Fritz Anderson

On 21 Jan 2009, at 9:42 AM, Ross Carter wrote:

Can someone give me a hint how can I switch one window per document  
model (that currently works as expected thanks to NSDocument) to  
one tab per document, same window?


This is answered in the archives. Search cocoabuilder.com for  
document window tabs


I'm sure it's answered in the archives _somewhere_, but searching  
cocoabuilder for "document window tabs" produces tens of thousands of  
results, and none in the first few pages is relevant. Likewise  
cocoabuilder or Google "multiple NSDocument one window" (you can have  
multiple NSDocuments! NSDocuments can have multiple windows!) and  
"NSWindow MDI" (don't do that!).


I did turn up , but it is very summary.


I don't have an immediate need for a solution myself, and I think I  
have an inkling of how I'd proceed, but I'd like to hear someone's  
evolved thoughts on the question.


If you could spare the posting or search terms you have in mind, it  
would be helpful.


— F

___

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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
I also just found this bit in the docs:

http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_4.html#//apple_ref/doc/uid/1051i-CH4-SW18

Nib Object Retention
iPhone OS - managed memory model

Objects in the nib file are created with a retain count of 1 and then
autoreleased. As it rebuilds the object hierarchy, however, UIKit
reestablishes connections between the objects using the
setValue:forKey: method, which uses the available setter method or
retains the object by default if no setter method is available. If you
define outlets for nib-file objects, you should also define a setter
method for accessing that outlet. Setter methods for outlets should
retain their values, and setter methods for outlets containing
top-level objects must retain their values to prevent them from being
deallocated. If you do not store the top-level objects in outlets, you
must retain either the array returned by the
loadNibNamed:owner:options: method or the objects inside the array to
prevent those objects from being released prematurely.

So as Dave stated, creating the properties is the recommended way,
though if the properties are not present, then a retain will be sent
to the object anyway.  I guess that is a nice fail-safe they put in
place.




On Wed, Jan 21, 2009 at 10:33 AM, Dave DeLong  wrote:
> On Jan 21, 2009, at 11:25 AM, Adam Venturella  wrote:
>
>> I have seen this same behavior too, creating @properties for IBOutlets
>> on the iPhone.  I have yet to run into a problem not
>> @property/@synthsizeing my Outlets on the iPhone, everything seems to
>> work just fine if you don't.  So am I missing something?  And am I
>> correct in assuming you would then be responsible for [myOutlet
>> release] in the dealloc?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
> My understanding is that declaring IBOotlets as properties is the
> recommended way of doing things. If you look in template code, you'll see
> that the outlets are released. This is to balance the retains sent during
> nib loading.
>
> So really, it helps clarify the memory management of GUI elements.
>
> Dave
>
> Sent from my iPod.___
>
> 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/aventurella%40gmail.com
>
> This email sent to aventure...@gmail.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: CALayer animating images

2009-01-21 Thread David Duncan

On Jan 20, 2009, at 2:08 AM, Kishore Gedela wrote:


Hi All,
	I'm working on a presentation application which will animate given  
images with a specified transition. I'm using CALayer to animate/ 
display the images.
	When animating/displaying large sized images I'm getting a white  
screen with "... image is too large for GPU, ignoring" exception.


CALayers are limited to the maximum texture size of the underlying  
graphics hardware, so if you are getting this warning, your images are  
too big for the hardware your on and you will need to make them smaller.

--
David Duncan
Apple DTS Animation and Printing

___

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: Cursor updates - bug or programmer ignorance?

2009-01-21 Thread Luke Evans


If you're devious enough, you might be able to set a breakpoint  
where NSScrollView is setting the cursor. (You could try, for  
example, to subclass NSCursor using an image you supply, with an  
override of setCursor: that just calls super. Then pass a cursor of  
your subclass to setDocumentCursor.) The backtrace when the  
breakpoint is hit *might* give you a clue as to why it's doing it.





I tried the trojan horse NSCursor subclass.  The backtrace is:

(gdb) backtrace
#0  -[TraceCursor set] (self=0x13b5a0, _cmd=0x96c69d34) at /Users/luke/ 
Projects/TableTester/TraceCursor.m:24

#1  0x911d85ce in _handleInvalidCursorRectsNote ()
#2  0x935cb9a2 in __CFRunLoopDoObservers ()
#3  0x935cccfc in CFRunLoopRunSpecific ()
#4  0x935cdcd8 in CFRunLoopRunInMode ()
#5  0x93a022c0 in RunCurrentEventLoopInMode ()
#6  0x93a020d9 in ReceiveNextEventCommon ()
#7  0x93a01f4d in BlockUntilNextEventMatchingListInMode ()
#8  0x9114cd7d in _DPSNextEvent ()
#9  0x9114c630 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()

#10 0x9114566b in -[NSApplication run] ()
#11 0x911128a4 in NSApplicationMain ()
#12 0x25d8 in main (argc=1, argv=0xb768) at /Users/luke/ 
Projects/TableTester/main.m:13


The only thing I can see (vaguely) useful here is the  
_handleInvalidCursorRectsNote, the rest being just event marshalling.


Maybe this is just old-school cursor management demanding attention  
when I thought I could just implement the modern tracking area stuff  
to manage the cursor?
I was hoping to avoid having to bother with the old cursor rects in  
its dotage, but maybe there are places where it just has to be taken  
care of.  I'd better go read up on how this old stuff works in case  
that's the solution.



___

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: runModalForWindow, best solution to modal session

2009-01-21 Thread Alexander Reichstadt

Hi Ken,

On 17.01.2009, at 17:51, Ken Thomases wrote:


On Jan 16, 2009, at 2:06 AM, Alexander Reichstadt wrote:


@implementation KSingleItemSelectorController

#pragma mark -
#pragma mark Init+Dealloc
+ (id)selectItemUsingFenstertyp:(NSString *)aFenstertyp  
withComposition:(NSString *)aKomposition

{
	KSingleItemSelectorController *newXelector = [[self alloc]  
initWithWindow:nil];


Why are you initializing your window controller with a window, and a  
nil window at that, rather than with a nib name?  If you want the  
window controller to load the window to be controlled from a nib,  
tell it to do that directly.
That's the problem, see beginning of this thread. The initial problem  
was that regardless of what initializer I used, none would give me a  
window. I thought that if in the end all initializers of  
NSWindowController do call initWithWindow I try that. Someone else off- 
list was certain that init would only give me an object and not take  
care of all else that should be taken care of when initializing a  
window controller.



[...]
}

- (id)initWithWindow:(NSWindow *)aWindow
{
if ((self = [super initWithWindow:aWindow])){
[NSBundle loadNibNamed:[self windowNibName] owner:self];
return self;
}
return nil;
}


You don't need to override the initWithWindow: method.  The usual  
pattern with window controller subclasses is to either: 1) don't  
override any of the initializers (at least not for the purpose of  
nib loading) and instead have the code with allocates and  
initializes the object invoke -initWithWindowNibName:, or 2)  
override plain old -init and have the subclass hard-code the name of  
the nib it manages when it invokes [super  
initWithWindowNibName:YourNibName].


Regards,
Ken


I think I go with the second option.

Thanks
Alex

smime.p7s
Description: S/MIME cryptographic signature
___

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: Cocoa-dev Digest, Vol 6, Issue 124

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 12:44 PM,  Peter Hudson wrote:


> In IB in the Library panel, just below half way down there is a symbol
> on the left hand side which is a dollar sign ( and a calendar symbol
> next to it )  which is the number formatter.  Click this and drag it
> to the text field - and drop it on it.  Once the formatter is applied
> to the text field there is a small circle to the lower right of the
> edge of the text field - with a dollar in it.  Click this symbol and
> the formatter setup panel will appear in the Attributes Inspector.
> Set away !

Hmm. I seem to remember this being in in older versions of IB, but I
am not seeing this in the new one. Unless I am being stupid, which I
probably am.

> There is however a slight problem in using formatters for input.  If
> you set it for numbers only, when the user types in an illegal
> character ( something other than a digit ) and tries to tab out of the
> field, they simply can't escape.  Likewise if you set a target /
> action and they try to press return to complete the entry.  There must
> be ways of frigging with the formatter to change this - but I've never
> bothered.

Hmm. This is all touch-input, so I'll see how it goes.

> Instead of using a formatter,  if I want to collect digits from the
> user I simply subclass the NSTextField  and override -
> (void)textDidChange:(NSNotification *)aNotification.  Then every time
> the user enters something you can check what they have written and
> either allow it or not.
>
> For example to convert input to uppercase I do the following :-
>
>
> -(void)textDidChange:(NSNotification *)aNotification
> {
>if( [upperCaseBtn  state] == NSOnState )
>{
>[self  setStringValue:[[self  stringValue]  uppercaseString]];
>}
> }
> peter

I'm interested in numbers only, so I'll have to figure it out.
___

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: Switching NSDocument based application to tabbed views interface

2009-01-21 Thread jonat...@mugginsoft.com


On 21 Jan 2009, at 18:38, Fritz Anderson wrote:


On 21 Jan 2009, at 9:42 AM, Ross Carter wrote:

Can someone give me a hint how can I switch one window per  
document model (that currently works as expected thanks to  
NSDocument) to one tab per document, same window?


This is answered in the archives. Search cocoabuilder.com for  
document window tabs


I'm sure it's answered in the archives _somewhere_, but searching  
cocoabuilder for "document window tabs" produces tens of thousands  
of results, and none in the first few pages is relevant. Likewise  
cocoabuilder or Google "multiple NSDocument one window" (you can  
have multiple NSDocuments! NSDocuments can have multiple windows!)  
and "NSWindow MDI" (don't do that!).


I did turn up , but it is very summary.


I don't have an immediate need for a solution myself, and I think I  
have an inkling of how I'd proceed, but I'd like to hear someone's  
evolved thoughts on the question.


If you could spare the posting or search terms you have in mind, it  
would be helpful.



Googling with search terms of - NSDocument tabs site:www.cocoabuilder.com

109 hits, item 13 looks promising:

Cocoabuilder - (Jacob Lukas) multiple documents, single window

which in turn references

CocoaDev: DocumentBasedAppWithOneWindowForAllDocuments


— F

___

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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.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: Cursor updates - bug or programmer ignorance?

2009-01-21 Thread Quincey Morris

On Jan 21, 2009, at 10:49, Luke Evans wrote:


I tried the trojan horse NSCursor subclass.  The backtrace is:

(gdb) backtrace
#0  -[TraceCursor set] (self=0x13b5a0, _cmd=0x96c69d34) at /Users/ 
luke/Projects/TableTester/TraceCursor.m:24

#1  0x911d85ce in _handleInvalidCursorRectsNote ()
#2  0x935cb9a2 in __CFRunLoopDoObservers ()
#3  0x935cccfc in CFRunLoopRunSpecific ()
#4  0x935cdcd8 in CFRunLoopRunInMode ()
#5  0x93a022c0 in RunCurrentEventLoopInMode ()
#6  0x93a020d9 in ReceiveNextEventCommon ()
#7  0x93a01f4d in BlockUntilNextEventMatchingListInMode ()
#8  0x9114cd7d in _DPSNextEvent ()
#9  0x9114c630 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()

#10 0x9114566b in -[NSApplication run] ()
#11 0x911128a4 in NSApplicationMain ()
#12 0x25d8 in main (argc=1, argv=0xb768) at /Users/luke/ 
Projects/TableTester/main.m:13


The only thing I can see (vaguely) useful here is the  
_handleInvalidCursorRectsNote, the rest being just event marshalling.


Maybe this is just old-school cursor management demanding attention  
when I thought I could just implement the modern tracking area stuff  
to manage the cursor?


It shouldn't be necessary to do any cursorRects management if you're  
not using them yourself. Something is calling resetCursorRects (or a  
similar method), and NSScrollView is dutifully paying attention.


You probably have enough specific information here to justify a bug  
report, assuming there aren't (say) any custom or 3rd-party controls  
in the window that might be messing with the cursor rects.


As a workaround, you could also try calling disableCursorRects for the  
window. The only two important cases of built-in cursor changing  
behavior I can think of are setting the I-beam in text fields and  
resetting to the arrow when exiting a managed region, and I *think*  
they both use NSTrackingArea now -- so disabling cursor rects might  
not break anything important. :)



___

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: PDFView printing subviews

2009-01-21 Thread John Calhoun


On Jan 21, 2009, at 2:03 AM, Martin F. Carianni wrote:
Now, this prints the PDFVIEW without the subview, prints just the  
model from the PDFDocument.


As you observe, calling the print method in PDFView renders the PDF  
document ... not the PDFView content.


If the PDF is a single page you can get the -[PDFView documentView]  
and print just that (using NSView methods not PDFKit).


Otherwise it gets trickier than that

One alternative might be to subclass the PDFView and override the - 
[drawPage:] method and, during the print, draw your subviews by hand  
for each page.  It seems doable to me, just unfortunately more  
complicated than you would like.


John Calhoun—___

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: Number Formatter

2009-01-21 Thread Alex Kac
If you're on the iPhone, there is no IB formatters. I only mention  
that because of your comment about touch input.



On Jan 21, 2009, at 1:21 PM, Brooke Gravitt wrote:


On Wed, Jan 21, 2009 at 12:44 PM,  Peter Hudson wrote:


In IB in the Library panel, just below half way down there is a  
symbol

on the left hand side which is a dollar sign ( and a calendar symbol
next to it )  which is the number formatter.  Click this and drag it
to the text field - and drop it on it.  Once the formatter is applied
to the text field there is a small circle to the lower right of the
edge of the text field - with a dollar in it.  Click this symbol and
the formatter setup panel will appear in the Attributes Inspector.
Set away !


Hmm. I seem to remember this being in in older versions of IB, but I
am not seeing this in the new one. Unless I am being stupid, which I
probably am.


There is however a slight problem in using formatters for input.  If
you set it for numbers only, when the user types in an illegal
character ( something other than a digit ) and tries to tab out of  
the

field, they simply can't escape.  Likewise if you set a target /
action and they try to press return to complete the entry.  There  
must
be ways of frigging with the formatter to change this - but I've  
never

bothered.


Hmm. This is all touch-input, so I'll see how it goes.


Instead of using a formatter,  if I want to collect digits from the
user I simply subclass the NSTextField  and override -
(void)textDidChange:(NSNotification *)aNotification.  Then every time
the user enters something you can check what they have written and
either allow it or not.

For example to convert input to uppercase I do the following :-


-(void)textDidChange:(NSNotification *)aNotification
{
  if( [upperCaseBtn  state] == NSOnState )
  {
  [self  setStringValue:[[self  stringValue]   
uppercaseString]];

  }
}
peter


I'm interested in numbers only, so I'll have to figure it out.


Alex Kac - President and Founder
Web Information Solutions, Inc.

"Champions aren't made in the gyms. Champions are made from something  
they have deep inside of them - a desire, a dream, a vision. They have  
last-minute stamina, they have to be a little faster, they have to  
have the skill, and the will. But the will must be stronger than the  
skill."

-- Muhammad Ali





___

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


Log4Cocoa

2009-01-21 Thread Robert Kukuchka

Hello,
	I'm looking into logging frameworks and see references to this  
project. Does anyone know if this project is still running? I was  
hoping to find some examples of how to get things setup. Anyone here  
use it within a commercial application? Our Mac team is small, so if I  
don't have to "roll my own", I'd rather not.


Cheers,
Rob
___

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: Number Formatter

2009-01-21 Thread Alex Kac

Check the Numbers only flag in the IB palette.

On Jan 21, 2009, at 1:57 PM, Brooke Gravitt wrote:


On Wed, Jan 21, 2009 at 2:50 PM, Alex Kac  wrote:
If you're on the iPhone, there is no IB formatters. I only mention  
that

because of your comment about touch input.


There we go! So any idea how i prevent alpa chars in the text field?


Alex Kac - President and Founder
Web Information Solutions, Inc.

"The optimist proclaims that we live in the best of all possible  
worlds; and the pessimist fears this is true."

-- James Clabell




___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 2:58 PM, Andy Lee  wrote:

> 3.1.2.  But Alex Kac just posted a relevant note... I had no idea IB was
> different for the iPhone/Touch.
>
> --Andy

The good news is I'm not a *complete* idiot, as it appears the option
just isn't there for the iPhone/iTouch.

Bad news is I *still* have no clue how to do what I'd like to.

I'm going to dig into the docs again, but if anyone can clue-bat me
into knowledge-ness, I'd be really grateful.

Thanks!!

Brooke
___

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: Number Formatter

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 3:04 PM, Alex Kac  wrote:
> Check the Numbers only flag in the IB palette.
>

So my options are ( if I'm looking in the right place )  on the Text
Field Attributes tab on the inspector, Text Input Traits panel

Keyboard Type:
  Default
  ASCII Capable
  Numbers & Punctuation
  URL
  Number Pad
  Phone Pad
  Name Phone Pad
  Email Address

Choosing "Numbers & Punctuation" doesn't prevent users from inputting
other punctuation, nor switching to a keyboard.

Don't see a check box anywhere for "Numbers Only."

Thanks,
Brooke
___

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: Switching NSDocument based application to tabbed views interface

2009-01-21 Thread Fritz Anderson

On 21 Jan 2009, at 1:34 PM, jonat...@mugginsoft.com wrote:


Googling with search terms of - NSDocument tabs site:www.cocoabuilder.com

109 hits, item 13 looks promising:

Cocoabuilder - (Jacob Lukas) multiple documents, single window

which in turn references

CocoaDev: DocumentBasedAppWithOneWindowForAllDocuments


There we go. To prime the search engines:

A guide to putting more than one NSDocument into a single NSWindow  
(like the Windows MDI pattern -- useful in human interfaces like those  
of Shark and Xcode) can be found at
.


It involves subclassing NSDocumentController and NSWindowController.  
There's a singleton NSWindowController, and your NSDocument subclass  
instance should claim it as it activates. There is much more to it;  
read the article.


There's also an argument about an alternative method, involving one  
NSWindow per NSDocument, and hiding/swapping each into the same  
location, but that's not precisely on point.


— F

___

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: Number Formatter

2009-01-21 Thread Alex Kac
Ah, I was thinnking of Number Pad. But if you need Numbers and  
Punctuation, just implement the delegate  
textField:shouldChangeCharactersInRange:replacementString: and  make  
sure the only characters are numbers.


On Jan 21, 2009, at 2:13 PM, Brooke Gravitt wrote:


On Wed, Jan 21, 2009 at 3:04 PM, Alex Kac  wrote:

Check the Numbers only flag in the IB palette.



So my options are ( if I'm looking in the right place )  on the Text
Field Attributes tab on the inspector, Text Input Traits panel

Keyboard Type:
 Default
 ASCII Capable
 Numbers & Punctuation
 URL
 Number Pad
 Phone Pad
 Name Phone Pad
 Email Address

Choosing "Numbers & Punctuation" doesn't prevent users from inputting
other punctuation, nor switching to a keyboard.

Don't see a check box anywhere for "Numbers Only."

Thanks,
Brooke


Alex Kac - President and Founder
Web Information Solutions, Inc.

"There will always be death and taxes; however, death doesn't get  
worse every year."

-- Anonymous




___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Nick Zitzmann


On Jan 21, 2009, at 3:06 PM, Brooke Gravitt wrote:


The good news is I'm not a *complete* idiot, as it appears the option
just isn't there for the iPhone/iTouch.

Bad news is I *still* have no clue how to do what I'd like to.

I'm going to dig into the docs again, but if anyone can clue-bat me
into knowledge-ness, I'd be really grateful.



You could always attach the formatter manually, like this: (written in  
Mail, untested, use at your own risk, and all that)


- (void)awakeFromNib
{
	NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init]  
autorelease];


	// Normally you'd have to set the formatter behavior here, but this  
isn't necessary on the iPhone/iPod

[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
[someTextField setFormatter:formatter];
}

Nick Zitzmann




___

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: "Show In Menu Bar" Option?

2009-01-21 Thread Seth Willits

On Jan 21, 2009, at 10:34 AM, Chunk 1978 wrote:


what is the proper way to update the menu bar after switching the view
of the app's menu bar extension?  force quit the SystemUIServer?  or
actually just quit the SystemUIServer?  or is there a more common
method to updating the menu bar?


Do what?!

Just simply call setView:


--
Seth Willits



___

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: Limiting NSTextField to numbers?

2009-01-21 Thread glenn andreas


On Jan 21, 2009, at 2:31 PM, Nick Zitzmann wrote:



On Jan 21, 2009, at 3:06 PM, Brooke Gravitt wrote:


The good news is I'm not a *complete* idiot, as it appears the option
just isn't there for the iPhone/iTouch.

Bad news is I *still* have no clue how to do what I'd like to.

I'm going to dig into the docs again, but if anyone can clue-bat me
into knowledge-ness, I'd be really grateful.



You could always attach the formatter manually, like this: (written  
in Mail, untested, use at your own risk, and all that)


- (void)awakeFromNib
{
	NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init]  
autorelease];


	// Normally you'd have to set the formatter behavior here, but this  
isn't necessary on the iPhone/iPod

[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
[someTextField setFormatter:formatter];
}



Note that none of this is truly applicable to the iPhone - there is no  
NSTextField on the iPhone, and UITextField works quite a bit  
differently (there is no formatter, for example, but only the ability  
to set what kind of keyboard appears when it becomes the first  
responder).



Glenn Andreas  gandr...@gandreas.com
  wicked fun!
quadrium | flame : flame fractals & strange attractors : build,  
mutate, evolve, animate




___

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: "Show In Menu Bar" Option?

2009-01-21 Thread Peter Ammon


On Jan 21, 2009, at 10:34 AM, Chunk 1978 wrote:


what is the proper way to update the menu bar after switching the view
of the app's menu bar extension?  force quit the SystemUIServer?  or
actually just quit the SystemUIServer?  or is there a more common
method to updating the menu bar?


I think what you are asking is, you have an NSStatusItem and you call  
setView: on it.  In this case, the status item should redraw  
automatically with the new view.  You should not need to interact with  
SystemUIServer.


-Peter

___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, Jan 21, 2009 at 3:31 PM, Nick Zitzmann  wrote:
>
> You could always attach the formatter manually, like this: (written in Mail,
> untested, use at your own risk, and all that)
>
> - (void)awakeFromNib
> {
>NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init]
> autorelease];
>
>// Normally you'd have to set the formatter behavior here, but this
> isn't necessary on the iPhone/iPod
>[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
>[someTextField setFormatter:formatter];
> }
>
> Nick Zitzmann
> 

This was what I was thinking I might do.

Perhaps I'm coming at this backwards as well - I should probably just
display the number pad and automagically insert the decimal place.

What's a good strategy for forcing the text field to always have the
last two digits as  cents?

i.e.

Text field looks like : $ 0.00

as user punches 12345 it would update like this -

$ 0.01
$ 0.12
$ 1.23
$ 12.34
$ 123.45

Make sense?
___

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


[WORKAROUND] Re: Cursor updates - bug or programmer ignorance?

2009-01-21 Thread Luke Evans


It shouldn't be necessary to do any cursorRects management if you're  
not using them yourself. Something is calling resetCursorRects (or a  
similar method), and NSScrollView is dutifully paying attention.


I've played with subclassing NSScrollView and NSClipView, so as to  
suppress resetCursorRects doing anything - but haven't hit upon the  
actual place that the cursor rect is being set.


You probably have enough specific information here to justify a bug  
report, assuming there aren't (say) any custom or 3rd-party controls  
in the window that might be messing with the cursor rects.


Yes, I think I'm confident enough in my belief that there is something  
untoward going on in the framework to warrant a bug report.  There are  
absolutely no special controls or anything else in the mix to observe  
this behaviour - the two methods I originally posted in a subclass of  
NSTableView is literally all it takes.  Probably most people don't set  
cursors over tables much - so the fact that the arrow cursor is  
continually reasserted goes unnoticed.


As a workaround, you could also try calling disableCursorRects for  
the window. The only two important cases of built-in cursor changing  
behavior I can think of are setting the I-beam in text fields and  
resetting to the arrow when exiting a managed region, and I *think*  
they both use NSTrackingArea now -- so disabling cursor rects might  
not break anything important. :)


disableCursorRects does work to prevent the extraneous cursor  
setting.  So, apparently, does creating a new NSCursor subclass that  
expressly does nothing in a -set method override, and setting this as  
the document cursor in the instance of NSScrollView surrounding the  
table.


As the latter _seems_ more discrete and (so far) has no unwanted side  
effects, I have that installed as a work-around.


So, that probably wraps it up for now - at least w.r.t. working around  
the odd behaviour.  Assistance was much appreciated!


___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Nick Zitzmann


On Jan 21, 2009, at 3:48 PM, Brooke Gravitt wrote:


This was what I was thinking I might do.


Glen is correct, though; I was wrong about there being a formatter  
property on UITextField. You can still do this, but you'll have to  
apply the formatter manually using the  
UITextFieldTextDidChangeNotification.



What's a good strategy for forcing the text field to always have the
last two digits as  cents?



Use a currency number formatter?

Nick Zitzmann




___

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: Limiting NSTextField to numbers?

2009-01-21 Thread Alex Kac
Use the delegate I gave you and format it there. UITextField does not  
accept formatters. Look at the docs - all the answers are right there.  
Here is how I do it:


Type in the class in the dev doc window. Set it to only show the  
iPhone OS 2.2 docs. Contains. Full Text. It shows me immediately the  
class reference and the delegates. Usually one or the other will  
answer what I'm looking for. If not, sometimes a sample will.


The Tasks sub-pane in the reference is usually very good. In this case  
you see clearly that  
textField:shouldChangeCharactersInRange:replacementString: tells you  
when a user types in a character and from there you can do what you  
need.


On Jan 21, 2009, at 2:48 PM, Brooke Gravitt wrote:

On Wed, Jan 21, 2009 at 3:31 PM, Nick Zitzmann   
wrote:


You could always attach the formatter manually, like this: (written  
in Mail,

untested, use at your own risk, and all that)

- (void)awakeFromNib
{
  NSNumberFormatter *formatter = [[[NSNumberFormatter alloc]  
init]

autorelease];

  // Normally you'd have to set the formatter behavior here,  
but this

isn't necessary on the iPhone/iPod
  [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
  [someTextField setFormatter:formatter];
}

Nick Zitzmann



This was what I was thinking I might do.

Perhaps I'm coming at this backwards as well - I should probably just
display the number pad and automagically insert the decimal place.

What's a good strategy for forcing the text field to always have the
last two digits as  cents?

i.e.

Text field looks like : $ 0.00

as user punches 12345 it would update like this -

$ 0.01
$ 0.12
$ 1.23
$ 12.34
$ 123.45

Make sense?
___

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/alex%40webis.net

This email sent to a...@webis.net


Alex Kac - President and Founder
Web Information Solutions, Inc.

"In the Country of the Blind, the one-eyed man is king."
--Desiderius Erasmus





___

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: Log4Cocoa

2009-01-21 Thread Kyle Sluder
On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  wrote:
>I'm looking into logging frameworks and see references to this
> project. Does anyone know if this project is still running? I was hoping to
> find some examples of how to get things setup. Anyone here use it within a
> commercial application? Our Mac team is small, so if I don't have to "roll
> my own", I'd rather not.

Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html

--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: Log4Cocoa

2009-01-21 Thread jonat...@mugginsoft.com


On 21 Jan 2009, at 21:15, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  
 wrote:

  I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html



Not a framework, but better than NSLog().

http://borkware.com/rants/agentm/mlog/

Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com


--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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.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: access programmatically the quartz composer image filters?

2009-01-21 Thread Matt Long
I don't know for sure the answer to whether or not the Quartz Composer  
filters are the same as what Core Image gives you, but I would bet  
they are. Have you seen this reference?


http://developer.apple.com/DOCUMENTATION/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html

Also, the CIRAWFilterSample under /Developer/Examples/Quartz/Core  
Image/ provides pretty much everything you need to apply filters to  
images programatically.


HTH,

-Matt


On Jan 21, 2009, at 11:13 AM, Michael Hanna wrote:


I'd like to access programmatically the quartz composer image
filters(just like it's done in the Automator script "Apply Quartz
Composition Filter to Image Files). How do I do this? Are they really
just CIFilters of a particular category?

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: Log4Cocoa

2009-01-21 Thread Robert Kukuchka
I was hoping to find something with built in log level support and non- 
recompile options to turn logging modules on / off

On 21-Jan-09, at 1:15 PM, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  
 wrote:

  I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html

--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: Log4Cocoa

2009-01-21 Thread Robert Kukuchka
It's better than NSLog(), but as I replied previously was looking for  
something with built in log level and ways to reconfigure logging  
without recompile

On 21-Jan-09, at 1:23 PM, jonat...@mugginsoft.com wrote:



On 21 Jan 2009, at 21:15, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  
 wrote:

 I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html



Not a framework, but better than NSLog().

http://borkware.com/rants/agentm/mlog/

Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com


--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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.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/rkukuchka%40gmail.com

This email sent to rkukuc...@gmail.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: Log4Cocoa

2009-01-21 Thread jonat...@mugginsoft.com


On 21 Jan 2009, at 21:40, Robert Kukuchka wrote:

I was hoping to find something with built in log level support and  
non-recompile options to turn logging modules on / off


On .NET you can accomplish this with the Enterprise Library Logging  
Application Block, which is very highly configurable.
I looked around for similar functionality in Cocoa frameworks about a  
year ago and did not find anything remotely similar.


But maybe it is hiding out there in the bushes somewhere...



On 21-Jan-09, at 1:15 PM, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  
 wrote:

 I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html

--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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.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: Limiting NSTextField to numbers?

2009-01-21 Thread Brooke Gravitt
On Wed, 21 Jan 2009 14:56:34 -0600 Alex Kac wrote:

> Use the delegate I gave you and format it there. UITextField does not
> accept formatters. Look at the docs - all the answers are right there.
> Here is how I do it:
>
> Type in the class in the dev doc window. Set it to only show the
> iPhone OS 2.2 docs. Contains. Full Text. It shows me immediately the
> class reference and the delegates. Usually one or the other will
> answer what I'm looking for. If not, sometimes a sample will.

Ok, Ok, I get it. RTFM. LOL.

> The Tasks sub-pane in the reference is usually very good. In this case
> you see clearly that
> textField:shouldChangeCharactersInRange:replacementString: tells you
> when a user types in a character and from there you can do what you
> need.

I'll d/l the newer SDK for 2.2 and have a look. It appears that the
Number Pad keyboard type doesn't have a button and requires some work
to dismiss - either a giant hidden button catching touch events
outside the number pad or overlaying a small "Done" button or similar
on the pad itself.

Or use the Numbers & Punctuation keyboard and filter out the non-numerics.

Or, I suppose I could create a custom view with my own buttons.

Thanks for the input.

Brooke
___

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


Telling the Help menu Spotlight search to ignore certain items

2009-01-21 Thread Keith Blount
Hi,

I've looked in the docs but I can't find the answer to this; I've also searched 
the archives but I may be using the wrong search terms.

Under Leopard, when you click on the Help menu, before appearing it seems to 
search through all the menus of the app to see if any items match the term on 
the find pasteboard - indeed, even if there is nothing on the pasteboard, it 
seems to go through all the menu items in the app's menus regardless.

My app has two or three menus that get built dynamically from the contents of a 
source list. For long projects, each of these menus could take a couple of 
seconds to be constructed. This isn't a problem for the menus themselves, but 
the cumulative effect on the Help menu search means that if you have a large 
project open and click on the Help menu, it can take a long time to appear - 
the spinning beachball appears and the app can seem unresponsive for ten 
seconds or so. Not good.

The menus that get built dynamically in this way really don't need to be found 
by the Help menu at all, though. They list the names of items in the source 
list for such things as navigation, or appending some selected text to a 
document in the source list by selecting in the menu.

So, my question is: is there a way of telling the Help menu to ignore certain 
menus when it does this search each time it is clicked on?

Many thanks in advance and all the best,
Keith


  
___

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


Distributed Objects

2009-01-21 Thread David Blanton

Are distributed objects analogous to OCX in Windows?

David Blanton





___

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: Log4Cocoa

2009-01-21 Thread Robert Kukuchka
Apparently this Log4Cocoa project is based off of a Java project which  
is highly configurable. I'm trying to do an evaluation on the code  
from SF: http://sourceforge.net/projects/log4cocoa/
Files were updated in 08, but mailing list last updated in 06. Not  
sure if it's dead or what...



On 21-Jan-09, at 1:48 PM, jonat...@mugginsoft.com wrote:



On 21 Jan 2009, at 21:40, Robert Kukuchka wrote:

I was hoping to find something with built in log level support and  
non-recompile options to turn logging modules on / off


On .NET you can accomplish this with the Enterprise Library Logging  
Application Block, which is very highly configurable.
I looked around for similar functionality in Cocoa frameworks about  
a year ago and did not find anything remotely similar.


But maybe it is hiding out there in the bushes somewhere...



On 21-Jan-09, at 1:15 PM, Kyle Sluder wrote:

On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka > wrote:

I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html

--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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.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/rkukuchka%40gmail.com

This email sent to rkukuc...@gmail.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: Setting the result of a javascript function to NSString

2009-01-21 Thread Alex Mills
Hey

Thanks Jean-Daniel Dupas, your 'untested' code works brilliantly!

Really appreciate it man. Thanks to everyone else who helped with this topic.

Cheers
Alex Mills
___

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: Log4Cocoa

2009-01-21 Thread Barry Wark
On Wed, Jan 21, 2009 at 1:15 PM, Kyle Sluder  wrote:
> On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  wrote:
>>I'm looking into logging frameworks and see references to this
>> project. Does anyone know if this project is still running? I was hoping to
>> find some examples of how to get things setup. Anyone here use it within a
>> commercial application? Our Mac team is small, so if I don't have to "roll
>> my own", I'd rather not.
>
> Why not use ASL, since it's built into the OS?
> http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html

+1
ASL supports logging level filtering and redirection to one or more
URLs. It's a C library, but it's quite trivial to write an ObjC
wrapper on top (email me offline, if you'd like to take a look a my
code; I'm not quite ready to release it publically).

Barry

>
> --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/barrywark%40gmail.com
>
> This email sent to barryw...@gmail.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


CAAnimation while modalForApp

2009-01-21 Thread David LeBer
I have a sign in window that implements a simple CAKeyframeAnimation  
to perform a shake if the sign in fails using the NSWindow's animator  
proxy object.


i.e.

	[self setAnimations:[NSDictionary dictionaryWithObject:[self  
shakeAnimationWithNumber:4 duration:0.5f vigour:0.03f]  
forKey:@"frameOrigin"]];

[[self animator] setFrameOrigin:[self frame].origin];

However, I need to make the app modal for that window, and when I do  
the animation doesn't fire (or isn't visible).


Anyone have any idea of what I should be looking for in the  
documentation to explain this? Is there some kind of run-loop mode  
dependency I am not aware of?



;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.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


Re: Distributed Objects

2009-01-21 Thread David Blanton

Of couse they are you idiot!

In fact, since the Objective-c runtime is what supports distributed  
objects and since Objective-c runtime was around before OCX it is  
actually true that OCX is analogous to distributed objects!


Voila! Another smash for NeXT / Apple against Windows!


On Jan 21, 2009, at 3:15 PM, David Blanton wrote:


Are distributed objects analogous to OCX in Windows?

David Blanton





___

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/airedale% 
40tularosa.net


This email sent to aired...@tularosa.net




David Blanton





___

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


  1   2   >