delegate dealloc in NSToolbar customItem

2009-06-04 Thread Alejandro Rodriguez

Hello all,

	I have an issue that is giving me some serious trouble. I have a  
NSPopupButton in a NSToolbar, this button has a menu which has the  
windowController as its delegate. everything works fine until I try to  
edit the toolbar, when I do that the items encode with an NSArchiver  
and the the original object is  dealloced. The problem is that my  
delegate is also getting dealloced for some reason.


Has anyone had this problem before? did you find a way around it?

Thanks and regards,

Alejandro 
___


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: QTCaptureSession class reference

2009-06-04 Thread M Pulis

On Jun 3, 2009, at 9:33 PM, Andy Lee wrote:


On Jun 3, 2009, at 11:41 PM, Fritz Anderson wrote:


On 3 Jun 2009, at 7:56 PM, Cain John wrote:

I cannot find this documentation. Searching the Mac Dev Center  
gives over 60 references to the class but no documentation of  
it's properties and methods.
Hope that this is an appropriate list for this question. There  
doesn't seem to be an Apple sponsored QT list.


Look for the quicktime-api mailing list, http://lists.apple.com/ 
mailman/listinfo/quicktime-api. It and three other QuickTime  
lists are right there on the lists.apple.com site. I'm surprised  
they didn't turn up when you looked there.


As has been pointed out, there is a lot of reference _to_ the  
class, and open -h QTCaptureSession.h opens the header. But  
there ought to be a Class Reference for it. Google even turns up a  
page for it, but the link is broken.


If you mean the first result for QTCaptureSession  
site:developer.apple.com, which is a link to a PDF, you can still  
view it by clicking the View as HTML link.


Links to the class in the current docset have been pulled (that  
is, unlike other QTKit classes, QTCaptureSession isn't shown in as  
a link).


It doesn't look like a large or complex API, and you can infer  
most of how it works from the supporting documentation, but jeez...


Ask on the mailing list, and consider filing a bug on  
bugreport.apple.com.


I second both suggestions.

--Andy




In Xcode 3.1.2, when I Option-Click QTCaptureSession in my source  
code, select Find Selected Text in API Reference it takes me to the  
QTCaptureSession Class Reference


Works for me.

Gary
___

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: NSAppleScript's compileAndReturnError always succeeds

2009-06-04 Thread Andrew Farmer

On 3 Jun 2009, at 19:47, Paul J. Lucas wrote:
Given that NSAppleScript objects are always supposed to run on the  
main thread, I created a small proxy object to use:

snip


If I compile a valid script, it works as expected; however, if I  
compile a gibberish script, e.g., foo, compileAndReturnError  
doesn't fail, i.e., it returns YES and errorDict is still nil.


Why?


Have you tried it with any other gibberish scripts? foo is a  
syntactically valid script which returns the value of the variable foo  
- it just happens to error out at runtime because the variable isn't  
defined.


A better choice would be something like $ which actually fails to  
parse.

___

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


Touchscreens and control scaling

2009-06-04 Thread Ben

Hi list,

I've been sketching out an application and could do with a little  
advice on which cocoa-direction to take. It's a full-screen (kiosk)  
type app, running in a very controlled environment (not for wide  
release) but which would run on an external touchscreen monitor.


While I can make buttons and labels big enough for fingers to poke,  
I'm concerned about controls like table headers and scrollers being  
large enough to make finger-size targets. I'm asking sooner rather  
than after testing the usability in case there are special  
considerations I should take before writing the first lines of code.


The only options I can think of are:

1. Make a normal app and use quartz debug to scale *everything* up
2. Subclass and/or redraw any controls too small for finger taps
3. Shut up and try it out first

In the absence of UIKit for desktop macs, does anyone have any  
suggestions as to the direction an app like this should take?


Thanks,

Ben
___

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: Touchscreens and control scaling

2009-06-04 Thread Joe Ranieri


On Jun 4, 2009, at 03:44, Ben wrote:


Hi list,

I've been sketching out an application and could do with a little  
advice on which cocoa-direction to take. It's a full-screen (kiosk)  
type app, running in a very controlled environment (not for wide  
release) but which would run on an external touchscreen monitor.


While I can make buttons and labels big enough for fingers to poke,  
I'm concerned about controls like table headers and scrollers being  
large enough to make finger-size targets. I'm asking sooner rather  
than after testing the usability in case there are special  
considerations I should take before writing the first lines of code.


The only options I can think of are:

1. Make a normal app and use quartz debug to scale *everything* up
2. Subclass and/or redraw any controls too small for finger taps
3. Shut up and try it out first


I don't think option 1 will work well. Apple hasn't done too much to  
make anything resolution independent. Try running stuff on a non-1.0  
scale factor to see. We ended up going with option 2, partially for  
usability, and partially because we wanted an entirely themed kiosk  
environment anyways.


From my limited testing, some small controls are a problem with a  
touch screen, but it depends on the accuracy of the touch screen and  
the ability of your user.


-- Joe Ranieri

___

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: Disc recording framework estimatedLength

2009-06-04 Thread Alexander Spohr

try http://lists.apple.com/mailman/listinfo/discrecording

This list is for technical discussions by programmers adding CD/DVD  
burning support to their applications through the Disc Recording  
frameworks.


atze


Am 03.06.2009 um 21:31 schrieb David Melgar:


Where can I ask a question about the Disc Recording Framework?

In particular, how can I figure out how much will fit onto a data  
disc as I populate a track?


I've tried to guess how much space it will consume based on the size  
of files, but the actual amount reported by [Track estimateLength]  
varies wildly with overhead from a few hundred to 20 thousand blocks  
or more.


How can I figure this out as I create the track without having to  
invoke the estimateLength which can consume 30 seconds or more on  
each invocation?


Could forks be causing me an issue? How do you find out the size of  
forks? Are they supposed in the disc recording framework?


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: Detecting when fetch: finishes

2009-06-04 Thread Ulai Beekam

Let me explain what I'm trying to do by referring to iTunes.


Imagine that iTunes has only one underlying NSArrayController and only one 
table view in the UI.


And image that when you click on a smart playlist, all that happens is that new 
fetch predicate is set for the underlying array controller (and column layout  
sorting of the table view changes).


This results in the problem of the table displaying BEFORE the fetch predicate 
actually executes (in the next runloop iteration). This results in the user 
visually seeing on screen the fetch results changing (which I don't want). What 
I would have wanted to do is to, perhaps, hide the table view for a brief 
moment while the fetching completes. I can easily hide it within the 
outlineViewSelectionIsChanging: delegate method. But, as we know by now, there 
is no way to know when to unhide the table view again; in other words, no way 
to know when the fetching with the new fetch predicate completes.


How would you get around this problem?




 From: mmalc_li...@me.com
 Date: Wed, 3 Jun 2009 22:41:48 -0700
 To: cocoa-dev@lists.apple.com
 Subject: Re: Detecting when fetch: finishes


 On Jun 3, 2009, at 4:12 PM, Ulai Beekam wrote:

 I have an NSArrayController that, at the request of the user, can be
 given a new fetch predicate. To do that I use the setFetchPredicate:
 method. How can I detect when this predicate has been applied and
 the appropriate fetching is done? I have not come across any
 delegate method for it.

 What are you trying to achieve?
 See 


 mmal

_
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx___

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: Find default application for file of particular extension

2009-06-04 Thread Nikhil Khandelwal
It was really of great help to find the default application.
I am having one issue with setting the default application.
I tried these two function

OSStatus LSSetHandlerOptionsForContentType (
   CFStringRef inContentType,
   LSHandlerOptions inOptions
);

Or

OSStatus LSSetDefaultRoleHandlerForContentType (
   CFStringRef inContentType,
   LSRolesMask inRole,
   CFStringRef inHandlerBundleID
);

But in both first argument is CFStringRef inContentType and I am not able to 
figure out what will be the value of this for my application.
Can you help me on how to find it or to set it.

Thanks,
Nikhil

-Original Message-
From: Filip van der Meeren [mailto:fi...@code2develop.com]
Sent: Thursday, May 28, 2009 8:32 PM
To: Nikhil Khandelwal
Cc: Cocoa-dev@lists.apple.com
Subject: Re: Find default application for file of particular extension


On 28 May 2009, at 16:36, Nikhil Khandelwal wrote:

 Hi all,

 I want to find out which application is the default one for .x
 extension file in my application and to make my application the
 default one for that extension.

For finding out who is owning an extention you should use the Launch
Services 
(http://developer.apple.com/documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html#/
/apple_ref/c/func/LSGetApplicationForInfo). And to make your
application the default for that extention, it is the same service...
but another method 
(http://developer.apple.com/documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html#/
/apple_ref/c/func/LSSetHandlerOptionsForContentType)


 Its an urgent project requirement, so please reply as soon as
 possible.

 Thanks,
 NIKHIL


Filip van der Meeren
fi...@code2develop.com


 DISCLAIMER
 ==
 This e-mail may contain privileged and confidential information
 which is the property of Persistent Systems Ltd. It is intended only
 for the use of the individual or entity to which it is addressed. If
 you are not the intended recipient, you are not authorized to read,
 retain, copy, print, distribute or use this message. If you have
 received this communication in error, please notify the sender and
 delete all copies of this message. Persistent Systems Ltd. does not
 accept any liability for virus infected mails.
 ___

 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/filip%40code2develop.com

 This email sent to fi...@code2develop.com


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.
___

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


KVO and master-detail NSTableViews

2009-06-04 Thread Stefan Reitshamer
I'm getting flaky behavior from my KVO code and I'm wondering what I'm  
doing wrong. I can't find any similar examples.


I have a pop-up button and 2 NSTableViews.
The pop-up button selection controls the content of the left  
NSTableView. The left NSTableView's selection controls the content of  
the right NSTableView.


The pop-up button and NSTableViews are bound to separate  
NSArrayControllers.
Each NSArrayController is bound to a separate NSMutableArray property  
in my app controller.
My app controller observes selectionIndex in the pop-up button's  
NSArrayController and selectedObjects in the left NSArrayController.


On startup, the pop-up button is populated, which causes a call to  
observeValueForKeyPath:ofObject:change:context:. This sets the left  
NSMutableArray, which in turn causes another (nested) call to  
observeValueForKeyPath:ofObject:change:context:, which sets the right  
NSMutableArray.


There seems to be a race condition -- sometimes the left table view is  
populated, sometimes the right, sometimes none. Each time I edit the  
nib, the behavior changes.


Is this a bogus way to implement the dependent NSTableViews?
What's the right way?

Thanks in advance,
- Stefan

___

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: QTCaptureSession class reference

2009-06-04 Thread Andy Lee

On Jun 4, 2009, at 3:34 AM, M Pulis wrote:
In Xcode 3.1.2, when I Option-Click QTCaptureSession in my source  
code, select Find Selected Text in API Reference it takes me to  
the QTCaptureSession Class Reference


I have the same version of Xcode, with the latest docset updates, and  
when I do that I get no search results.


However, I tried the same thing on another machine where the docset is  
*not* up to date, and the class reference *is* there.  So it seems the  
file was removed.


--Andy

___

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


NSNull and distinct objective-C type

2009-06-04 Thread Steven Hamilton

Hi folks,
I need some advice on how best to handle an itchy problem. In order to  
tighten up my coding I'm compiling with warnings as errors which has  
showed up a big problem with my code.


I have a tableView using a datasource array of dictionaries. Fairly  
standard stuff. 2 of the keys in this dictionary are credit and  
debit. When I process the data only one of these can be set, the  
other has to be nil or NSNull. I test against this later on when  
manipulating the data. My problem appeared when I I turned on warning  
as errors. I kept getting the following;


if ([amount floatValue]  0){
NSString *amountString = [[amount stringValue] substringFromIndex:1];
debit = [NSDecimalNumber decimalNumberWithString:amountString];
credit = [NSNull null];
warning: assignment from distinct Objective-C type
} else {
credit = amount;
debit = [NSNull null];
warning: assignment from distinct Objective-C 
type
}
}

I thought I'd be smart and change the NSNull to nil instead but of  
course that terminates the dictionary early when I come to create it.


NSMutableDictionary *transdic = [NSMutableDictionary  
dictionaryWithObjectsAndKeys:date, @date, memo, @memo,  
transferIndex, @transferIndex, credit, @credit, debit, @debit,  
nil];


I'm getting the error because I initially declared my credit and debit  
objects as NSNumbers. Can I recast them without them losing scope?

___

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: NSNull and distinct objective-C type

2009-06-04 Thread Graham Cox


On 04/06/2009, at 10:31 PM, Steven Hamilton wrote:

I'm getting the error because I initially declared my credit and  
debit objects as NSNumbers. Can I recast them without them losing  
scope?



Yes, just do this: credit = (id)[NSNull null];

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: NSNull and distinct objective-C type

2009-06-04 Thread Steven Hamilton


On 04/06/2009, at 10:36 PM, Graham Cox wrote:



On 04/06/2009, at 10:31 PM, Steven Hamilton wrote:

I'm getting the error because I initially declared my credit and  
debit objects as NSNumbers. Can I recast them without them losing  
scope?



Yes, just do this: credit = (id)[NSNull null];

--Graham



Genius! I can now go to bed happy. Thanks a lot.

___

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: NSNull and distinct objective-C type

2009-06-04 Thread Filip van der Meeren


On 04 Jun 2009, at 14:31, Steven Hamilton wrote:


Hi folks,
I need some advice on how best to handle an itchy problem. In order  
to tighten up my coding I'm compiling with warnings as errors which  
has showed up a big problem with my code.


I have a tableView using a datasource array of dictionaries. Fairly  
standard stuff. 2 of the keys in this dictionary are credit and  
debit. When I process the data only one of these can be set, the  
other has to be nil or NSNull. I test against this later on when  
manipulating the data. My problem appeared when I I turned on  
warning as errors. I kept getting the following;


if ([amount floatValue]  0){
NSString *amountString = [[amount stringValue] substringFromIndex:1];
debit = [NSDecimalNumber decimalNumberWithString:amountString];
credit = [NSNull null];
warning: assignment from distinct Objective-C type


You can not assign null to an NSNumber, NSNull is of another type.
You could of course change the variabletype of credit to id instead  
of NSNumber, then the NSNull would work. It doesn't change much at  
all, the compiler replaces your NSNumber with id anyway. It just  
allows you to use NSNumber for static type checking.




} else {
credit = amount;
debit = [NSNull null];
warning: assignment from distinct Objective-C 
type
}
}

I thought I'd be smart and change the NSNull to nil instead but of  
course that terminates the dictionary early when I come to create it.


NSMutableDictionary *transdic = [NSMutableDictionary  
dictionaryWithObjectsAndKeys:date, @date, memo, @memo,  
transferIndex, @transferIndex, credit, @credit, debit, @debit,  
nil];


I'm getting the error because I initially declared my credit and  
debit objects as NSNumbers. Can I recast them without them losing  
scope?



Filip van der Meeren
fi...@code2develop.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/filip%40code2develop.com

This email sent to fi...@code2develop.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


XIB and AppleGlot

2009-06-04 Thread Eric Slosser

(Sorry if this is OT, I couldn't find a better apple-hosted list...)

How does one use AppleGlot and XIBs?

I have an app, My.app, that was previously localized.  I'm working  
on version 2.0.


My app is starting to use XIB files.  These get compiled into NIBs in  
My.app.


The AppleGlot docs seem to say I should put My.app 2.0 into _NewBase,  
and My.app 1.0 into _OldLoc.


When I do that, the nibs that came from xibs are ignored (my.app.wg  
doesn't contain any of the strings from those nibs).  If I put  
NewDialog.xib into my.app, I see its strings in the .wg.


It seems like I be putting the source code form of the  
language.lproj folders into _OldBase, but none of the docs say that.


Can someone point me at a discussion of how to use AppleGlot in the  
presence of XIB files?


And (if it's not covered by default): What to do when the previous  
shipped app had a non-compiled Foo.nib, and the about-to-ship app has  
Foo.xib in the souces, and thus a compiled Foo.nib in the built app.


___

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: KVO and master-detail NSTableViews

2009-06-04 Thread Keary Suska

On Jun 4, 2009, at 4:24 AM, Stefan Reitshamer wrote:

I'm getting flaky behavior from my KVO code and I'm wondering what  
I'm doing wrong. I can't find any similar examples.


I have a pop-up button and 2 NSTableViews.
The pop-up button selection controls the content of the left  
NSTableView. The left NSTableView's selection controls the content  
of the right NSTableView.


The pop-up button and NSTableViews are bound to separate  
NSArrayControllers.
Each NSArrayController is bound to a separate NSMutableArray  
property in my app controller.
My app controller observes selectionIndex in the pop-up button's  
NSArrayController and selectedObjects in the left NSArrayController.


On startup, the pop-up button is populated, which causes a call to  
observeValueForKeyPath:ofObject:change:context:. This sets the left  
NSMutableArray, which in turn causes another (nested) call to  
observeValueForKeyPath:ofObject:change:context:, which sets the  
right NSMutableArray.


There seems to be a race condition -- sometimes the left table view  
is populated, sometimes the right, sometimes none. Each time I edit  
the nib, the behavior changes.


If your code depends on the order that objects in the nib are  
initialized, this may be the reason for unexpected behavior. Some  
changes to a nib might effect this loading order, which should be  
considered non-deterministic anyway.



Is this a bogus way to implement the dependent NSTableViews?
What's the right way?



If it is not necessary to route all the controller's content through  
the app controller, you may have better luck hooking the controllers  
together. Refer to this: http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSArrayController.html#//apple_ref/doc/uid/NSArrayController-DontLinkElementID_24 


in particular the contentObject binding.

RightTVController contentObject --  
LeftTVController.selection.array_key_path
LeftTVController contentObject ---  
PopUpController.selection.array_key_path


Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


How to lock an object?

2009-06-04 Thread cocoa learner
Hi All,
I want one of my object, not to be paged out unless and until I am done with
my object. The way mlock() behave.

Is there any way to do this in cocoa?

Regards
Cocoa.learner.
___

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: Detecting when fetch: finishes

2009-06-04 Thread mmalc Crawford


On Jun 4, 2009, at 2:45 AM, Ulai Beekam wrote:


How would you get around this problem?





I would do what the Programming Guide suggests in the link I gave.
(Execute the fetch manually.)

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: How to lock an object?

2009-06-04 Thread David Duncan

On Jun 4, 2009, at 7:25 AM, cocoa learner wrote:


Hi All,
I want one of my object, not to be paged out unless and until I am  
done with

my object. The way mlock() behave.

Is there any way to do this in cocoa?



Is there a particular reason why you need to do this? There is almost  
certainly something better that you can do here...

--
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: launchd detecting when an application is running

2009-06-04 Thread Todd Heberlein
I have written an application that I would like to launch whenever a  
certain app is launched.  I have used LaunchAgents in the past to  
detect events such as USB insertion and volume mounting to perform  
certain actions.  I was wondering if there was a launchd.plist key  
that allowed for launchd to detect an application startup.


One approach is to have an agent monitor the audit trail to look for  
the application starting. The agent can then do something that can  
cause your app to launch, but now you are introducing a third program  
into the mix.


Todd

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: launchd detecting when an application is running

2009-06-04 Thread Jerry Krinock


On 2009 Jun 04, at 08:40, Todd Heberlein wrote:

I have written an application that I would like to launch whenever  
a certain app is launched.  I have used LaunchAgents in the past to  
detect events such as USB insertion and volume mounting to perform  
certain actions.  I was wondering if there was a launchd.plist key  
that allowed for launchd to detect an application startup.


One approach is to have an agent monitor the audit trail to look for  
the application starting. The agent can then do something that can  
cause your app to launch, but now you are introducing a third  
program into the mix.


Yup.  I have an app which needs to know when other apps (not mine)  
quit.  So, I wrote a silly little agent, kept alive by launchd, that  
registers for NSWorkspaceDidTerminateApplicationNotification, starts a  
run loop, then sits and waits.  Haven't field-tested yet, but seems to  
work.  It's confusing, though!


What do you mean by audit trail?

It would be nice if launchd had this capability, but as Kyle said,  
that is by design not one of the things that it does.


___

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: launchd detecting when an application is running

2009-06-04 Thread Jerry Krinock
One other thing I should have mentioned is that if this certain app  
that you're watching to launch happens to write a file somewhere when  
it launches, then you could use the directory-watching capability of  
launchd.


I wonder if the system writes a file somewhere, when ^any^ app launches?

___

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: Help with SHA class

2009-06-04 Thread KK
I ran into a similar problem - but I decided to use libcrypto:
man 3 sha1
or
man 3 EVP_DigestInit

Keita

On Thu, Jun 4, 2009 at 9:29 AM, Ken Tozier kentoz...@comcast.net wrote:

 Hi

 I wrote a SHA class using the algorithm at
 http://en.wikipedia.org/wiki/SHA1#SHA-1_pseudocode and while it runs
 without crashing, the hashes it produces are not the same as those from
 numerous online SHA-1 hashing converters. Of particular confusion is the
 issue of byte swapping and how that might affect the rotation/addition
 operations within the block hashing method. I'm clearly doing something
 wrong, but after several days of trying, I haven't been able to get the
 hashes to match online examples.

 Could someone with knowledge of SHA take a look at the class and point out
 where I'm messing up?

 Any help 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/kthemank%40gmail.com

 This email sent to kthem...@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: Help with SHA class

2009-06-04 Thread Jean-Daniel Dupas
An other alternative is using the CommonCrypto API (which does not  
require to link on other library like OpenSSL).


man Common Crypto

Le 4 juin 09 à 18:23, KK a écrit :


I ran into a similar problem - but I decided to use libcrypto:
man 3 sha1
or
man 3 EVP_DigestInit

Keita

On Thu, Jun 4, 2009 at 9:29 AM, Ken Tozier kentoz...@comcast.net  
wrote:



Hi

I wrote a SHA class using the algorithm at
http://en.wikipedia.org/wiki/SHA1#SHA-1_pseudocode and while it runs
without crashing, the hashes it produces are not the same as those  
from
numerous online SHA-1 hashing converters. Of particular confusion  
is the
issue of byte swapping and how that might affect the rotation/ 
addition
operations within the block hashing method. I'm clearly doing  
something
wrong, but after several days of trying, I haven't been able to get  
the

hashes to match online examples.

Could someone with knowledge of SHA take a look at the class and  
point out

where I'm messing up?

Any help 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/kthemank%40gmail.com

This email sent to kthem...@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/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: launchd detecting when an application is running

2009-06-04 Thread Greg Guerin

Tom Hohensee wrote:

I have written an application that I would like to launch whenever  
a certain app is launched. I have used LaunchAgents in the past to  
detect events such as USB insertion and volume mounting to perform  
certain actions. I was wondering if there was a launchd.plist key  
that allowed for launchd to detect an application startup.


Is this for distribution, or only for your personal use?

How soon after the original app launches do you need to start the  
secondary app?


How much control do you have over the original app?

Can you replace the original app's existing executable with another  
one that triggers your secondary app, then goes on to exec the  
original executable?  The trigger could be many things, including  
something that launchd monitors (see 'man launchd.plist' for on- 
demand conditions).


Maybe run a daemon that monitors FSEvents for creation of a temp-file  
you know the original app will create.


Maybe on-demand monitor the original app's user-defaults, so launchd  
triggers that way.


Those are just some random ideas.  It might help if you described  
exactly what you're trying to accomplish, including what the original  
app is.  Describe the problem; don't propose a solution.  If you've  
already tried something, tell us what you've tried and exactly why it  
didn't work.  Be specific.


  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Touchscreens and control scaling

2009-06-04 Thread Michael Ash
On Thu, Jun 4, 2009 at 3:44 AM, Ben ben_cocoa_dev_l...@yahoo.co.uk wrote:
 Hi list,

 I've been sketching out an application and could do with a little advice on
 which cocoa-direction to take. It's a full-screen (kiosk) type app, running
 in a very controlled environment (not for wide release) but which would run
 on an external touchscreen monitor.

 While I can make buttons and labels big enough for fingers to poke, I'm
 concerned about controls like table headers and scrollers being large enough
 to make finger-size targets. I'm asking sooner rather than after testing the
 usability in case there are special considerations I should take before
 writing the first lines of code.

 The only options I can think of are:

 1. Make a normal app and use quartz debug to scale *everything* up
 2. Subclass and/or redraw any controls too small for finger taps
 3. Shut up and try it out first

There is also option 3: set the scaling of your window's content view
(or some other convenient superview) to scale everything it contains
up.

This is capability has been around forever and so is probably better
supported than the quartz debug option.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: KVO and master-detail NSTableViews

2009-06-04 Thread Ken Thomases

On Jun 4, 2009, at 5:24 AM, Stefan Reitshamer wrote:


I'm getting flaky behavior from my KVO code and I'm wondering what  
I'm doing wrong. I can't find any similar examples.


I have a pop-up button and 2 NSTableViews.
The pop-up button selection controls the content of the left  
NSTableView. The left NSTableView's selection controls the content  
of the right NSTableView.


The pop-up button and NSTableViews are bound to separate  
NSArrayControllers.
Each NSArrayController is bound to a separate NSMutableArray  
property in my app controller.
My app controller observes selectionIndex in the pop-up button's  
NSArrayController and selectedObjects in the left NSArrayController.


I think you're manually using KVO when you could (and perhaps should)  
be using bindings.  I also think you're setting up the observations in  
the wrong direction.  I wouldn't have the app controller observe  
properties of the array controller.  Mediating controllers should bind  
to (thus, implicitly observe and set) properties of the coordinating  
controller (or the model, reached through the coordinating controller).


First, I don't know if you need the array controller for the pop-up to  
manage the selection.  I think you should bind the pop-up's  
selectedObject to a (possibly new) property on the app controller.   
This may require use of both the content and contentObjects bindings  
of the pop-up to get selectedObject to be an appropriate object.


Second, I think the array controller for the left table would bind to  
or through this property (the one bound to the pop-up's selection) on  
the app controller.


Lastly, the array controller for the right table would bind through  
the selection property of the array controller for the left table.


Put another way, bindings are meant to reduce or eliminate glue code.   
You seem to be reproducing the sort of glue code that one would  
typically have in the pre-bindings days, just using KVO (and maybe  
bindings themselves) to trigger the glue code.


Regards,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Help with SHA class

2009-06-04 Thread Greg Guerin


I wrote a SHA class using the algorithm at http://en.wikipedia.org/ 
wiki/SHA1#SHA-1_pseudocode and while it runs without crashing, the  
hashes it produces are not the same as those from numerous online  
SHA-1 hashing converters. Of particular confusion is the issue of  
byte swapping and how that might affect the rotation/addition  
operations within the block hashing method. I'm clearly doing  
something wrong, but after several days of trying, I haven't been  
able to get the hashes to match online examples.


Why are you writing this algorithm?

Googling these keywords:
  sha1 public domain

shows numerous hits.  Since public domain means no license, I  
don't see why you'd want to reinvent this wheel, especially given the  
known weaknesses of SHA1.


If you're writing it in order to learn about hash algorithms, then I  
think it makes more sense for you to debug your code yourself, as  
unhelpful as that may seem to be.  I also suggest reading sources  
other than Wikipedia, not necessarily because Wikipedia might be  
wrong or have a typo, but because there might be more detailed step- 
by-step explanations elsewhere on the web.  Or look at the public  
domain ones and see how they differ from yours.


You might also try running your code on a machine that's actually big- 
endian, to see what happens. Unless you already are.


Iff you're running it on an Intel CPU, simply compile the code for  
ppc and use the 'arch' command to run that slice instead of the  
native slice.  If it doesn't produce the same output, then you have  
an implied-endian bug.  If it does produce the same output, you still  
have a bug.


If you're using an Intel CPU, maybe try finding a little-endian  
implementation of the algorithm.


BTW, your code should probably be using the type names UInt32 and  
UInt64, instead of making assumptions about sizes.  There are also  
places where you use the constant 4 instead of sizeof(UInt32).   
Though these may not affect this implementation, they seem  
questionable to me.


  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Cocoa-dev Digest, Vol 6, Issue 831

2009-06-04 Thread Bruce Rubin

email or call me and I will come right out

614-302-4480

On Jun 4, 2009, at 3:02 PM, cocoa-dev-requ...@lists.apple.com wrote:


Send Cocoa-dev mailing list submissions to
cocoa-dev@lists.apple.com

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/cocoa-dev
or, via email, send a message with subject or body 'help' to
cocoa-dev-requ...@lists.apple.com

You can reach the person managing the list at
cocoa-dev-ow...@lists.apple.com

When replying, please edit your Subject line so it is more specific
than Re: Contents of Cocoa-dev digest...


Today's Topics:

  1. Re: launchd detecting when an application is running (Greg  
Guerin)

  2. Re: Touchscreens and control scaling (Michael Ash)
  3. Re: KVO and master-detail NSTableViews (Ken Thomases)
  4. Re: Help with SHA class (Greg Guerin)


--

Message: 1
Date: Thu, 4 Jun 2009 09:51:04 -0700
From: Greg Guerin glgue...@amug.org
Subject: Re: launchd detecting when an application is running
To: list-cocoa-dev cocoa-dev@lists.apple.com
Message-ID: a6a1bea1-cd37-42d7-9006-9cd4a6b68...@amug.org
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Tom Hohensee wrote:


I have written an application that I would like to launch whenever
a certain app is launched. I have used LaunchAgents in the past to
detect events such as USB insertion and volume mounting to perform
certain actions. I was wondering if there was a launchd.plist key
that allowed for launchd to detect an application startup.


Is this for distribution, or only for your personal use?

How soon after the original app launches do you need to start the
secondary app?

How much control do you have over the original app?

Can you replace the original app's existing executable with another
one that triggers your secondary app, then goes on to exec the
original executable?  The trigger could be many things, including
something that launchd monitors (see 'man launchd.plist' for on-
demand conditions).

Maybe run a daemon that monitors FSEvents for creation of a temp-file
you know the original app will create.

Maybe on-demand monitor the original app's user-defaults, so launchd
triggers that way.

Those are just some random ideas.  It might help if you described
exactly what you're trying to accomplish, including what the original
app is.  Describe the problem; don't propose a solution.  If you've
already tried something, tell us what you've tried and exactly why it
didn't work.  Be specific.

  -- GG



--

Message: 2
Date: Thu, 4 Jun 2009 13:01:58 -0400
From: Michael Ash michael@gmail.com
Subject: Re: Touchscreens and control scaling
To: cocoa-dev cocoa-dev@lists.apple.com
Message-ID:
da8fe1600906041001l6d0408ecqc4c8f22990463...@mail.gmail.com
Content-Type: text/plain; charset=UTF-8

On Thu, Jun 4, 2009 at 3:44 AM, Ben ben_cocoa_dev_l...@yahoo.co.uk  
wrote:

Hi list,

I've been sketching out an application and could do with a little  
advice on
which cocoa-direction to take. It's a full-screen (kiosk) type app,  
running
in a very controlled environment (not for wide release) but which  
would run

on an external touchscreen monitor.

While I can make buttons and labels big enough for fingers to poke,  
I'm
concerned about controls like table headers and scrollers being  
large enough
to make finger-size targets. I'm asking sooner rather than after  
testing the
usability in case there are special considerations I should take  
before

writing the first lines of code.

The only options I can think of are:

1. Make a normal app and use quartz debug to scale *everything* up
2. Subclass and/or redraw any controls too small for finger taps
3. Shut up and try it out first


There is also option 3: set the scaling of your window's content view
(or some other convenient superview) to scale everything it contains
up.

This is capability has been around forever and so is probably better
supported than the quartz debug option.

Mike


--

Message: 3
Date: Thu, 4 Jun 2009 12:07:37 -0500
From: Ken Thomases k...@codeweavers.com
Subject: Re: KVO and master-detail NSTableViews
To: Stefan Reitshamer ste...@reitshamer.com
Cc: cocoa-dev@lists.apple.com
Message-ID: 3e56895a-6efc-4b15-a2c7-b33afd4a8...@codeweavers.com
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes

On Jun 4, 2009, at 5:24 AM, Stefan Reitshamer wrote:



I'm getting flaky behavior from my KVO code and I'm wondering what
I'm doing wrong. I can't find any similar examples.

I have a pop-up button and 2 NSTableViews.
The pop-up button selection controls the content of the left
NSTableView. The left NSTableView's selection controls the content
of the right NSTableView.

The pop-up button and NSTableViews are bound to separate
NSArrayControllers.
Each NSArrayController is bound to a separate NSMutableArray
property 

Re: How to lock an object?

2009-06-04 Thread Greg Parker

On Jun 4, 2009, at 7:25 AM, cocoa learner wrote:
I want one of my object, not to be paged out unless and until I am  
done with

my object. The way mlock() behave.

Is there any way to do this in cocoa?


First answer: No. You can't lock all of the code and metadata  
associated with the object, so you could still get page faults when  
you try to call methods. Also, method dispatch sometimes takes locks,  
which is as bad as a page fault depending what you're trying to do.


Second answer: Use mlock().


--
Greg Parker gpar...@apple.com Runtime Wrangler


___

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: NSNull and distinct objective-C type

2009-06-04 Thread harpreet_singh
Hello All,

I am facing an issue in use of mach_absolute_time().

mach_absolute_time() gives drift even when NTP timing update is on.

Please see my code below:

#import Cocoa/Cocoa.h
#import mach/mach_time.h
nt main(int argc, char *argv[])
{
uint64_t nowTime = mach_absolute_time();
uint64_t drift = 0;
for (int i=0;i1000;i++)
{
sleep(5);
uint64_t current_Time = mach_absolute_time();
uint64_t differenceTime = (current_Time - nowTime)*1E-6;
drift = differenceTime - (i+1)*5000;
NSLog(@Elapsed Time =%lld,differenceTime);
NSLog(@drift =%lld,drift);
}
return 1;
//return NSApplicationMain(argc,  (const char **) argv);
}

Expected Results:
 I expected to see zero drift in the print. After several runs, the drift
kept on increasing

Actual Results:
Below are actual results
009-06-04 17:49:49.936 TestMachSleep[3275:10b] Elapsed Time =5000
2009-06-04 17:49:49.939 TestMachSleep[3275:10b] drift =0
2009-06-04 17:49:54.940 TestMachSleep[3275:10b] Elapsed Time =10004
2009-06-04 17:49:54.942 TestMachSleep[3275:10b] drift =4
2009-06-04 17:49:59.943 TestMachSleep[3275:10b] Elapsed Time =15007
2009-06-04 17:49:59.944 TestMachSleep[3275:10b] drift =7
2009-06-04 17:50:04.947 TestMachSleep[3275:10b] Elapsed Time =20011
2009-06-04 17:50:04.950 TestMachSleep[3275:10b] drift =11
2009-06-04 17:50:09.954 TestMachSleep[3275:10b] Elapsed Time =25018
2009-06-04 17:50:09.965 TestMachSleep[3275:10b] drift =18
2009-06-04 17:50:14.976 TestMachSleep[3275:10b] Elapsed Time =30040
2009-06-04 17:50:14.991 TestMachSleep[3275:10b] drift =40
2009-06-04 17:50:20.003 TestMachSleep[3275:10b] Elapsed Time =35068
2009-06-04 17:50:20.004 TestMachSleep[3275:10b] drift =68
2009-06-04 17:50:25.012 TestMachSleep[3275:10b] Elapsed Time =40076
2009-06-04 17:50:25.031 TestMachSleep[3275:10b] drift =76
2009-06-04 17:50:30.041 TestMachSleep[3275:10b] Elapsed Time =45105
2009-06-04 17:50:30.046 TestMachSleep[3275:10b] drift =105
2009-06-04 17:50:35.064 TestMachSleep[3275:10b] Elapsed Time =50129
2009-06-04 17:50:35.073 TestMachSleep[3275:10b] drift =129
2009-06-04 17:50:40.091 TestMachSleep[3275:10b] Elapsed Time =55156
2009-06-04 17:50:40.092 TestMachSleep[3275:10b] drift =156
2009-06-04 17:50:45.104 TestMachSleep[3275:10b] Elapsed Time =60169
2009-06-04 17:50:45.112 TestMachSleep[3275:10b] drift =169
2009-06-04 17:50:50.133 TestMachSleep[3275:10b] Elapsed Time =65198
2009-06-04 17:50:50.136 TestMachSleep[3275:10b] drift =198
2009-06-04 17:50:55.137 TestMachSleep[3275:10b] Elapsed Time =70202
2009-06-04 17:50:55.138 TestMachSleep[3275:10b] drift =202
2009-06-04 17:51:00.147 TestMachSleep[3275:10b] Elapsed Time =75212
2009-06-04 17:51:00.160 TestMachSleep[3275:10b] drift =212


I need millisecond accuracy to send time to server after certain activity
has been done. I understand that sleep is not millisecond accurate but I
was not expecting to see a progressively increasing drift.




___

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: Help with SHA class

2009-06-04 Thread Karan, Cem (Civ, ARL/CISD)
On Thu, 4 Jun 2009 09:29:43 -0400 Ken Tozier wrote
 
 I wrote a SHA class using the algorithm at 
 http://en.wikipedia.org/wiki/SHA1#SHA-1_pseudocode 

SNIP

When in doubt, go to the source!

http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf

It's pretty easy to implement from that, unlike AES.

Also look at
http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html

and the testing page at
http://csrc.nist.gov/groups/STM/cavp/index.html#03
for a complete list of testvectors. 

Good luck,
Cem Karan
___

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: including cocoa in cpp file

2009-06-04 Thread Kyle Sluder
On Thu, Jun 4, 2009 at 3:15 AM, MacUser S macos_u...@yahoo.com wrote:
 I', trying to  compile a cpp file.i just included includeCocoa/Cocoa.h.But 
 it shows so may errors.In build settings ,compiling the sources as its 
 type.Is it missed any project settings?

Objective-C++ files have a .mm suffix.

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


NSMutableURLRequest weirdness!

2009-06-04 Thread Ammar Ibrahim
Hello, I'm about to bang my head against the wall. Here's the situation, I'm
trying to send many requests using the same request object, I have a method
which I call frequently, which has  the following piece of code:


 NSMutableURLRequest *newReq = [[NSMutableURLRequest alloc] init];

[newReq setHTTPMethod:@GET];

[newReq setURL:[NSURL URLWithString:[@/media
stringByAppendingPathComponent:[currentTrack objectForKey:@Persistent ID]]
relativeToURL:[self serverBaseUrl]]];

 NSURLConnection *connection = [NSURLConnection connectionWithRequest:newReq
delegate:self];

 if (connection == nil) {

//connection couldn't be created!

NSLog(@Connection couldn't be created: %@, [newReq URL]);

 [self startSyncAfterTimeInterval];

}



The first request works, after that it seems to not even send the request,
although the server is still responsive! I get the following error:


*Connection failed with error: Error Domain=NSURLErrorDomain Code=-1001
UserInfo=0x1397a40 timed 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: including cocoa in cpp file

2009-06-04 Thread Nick Zitzmann


On Jun 4, 2009, at 4:15 AM, MacUser S wrote:

I', trying to  compile a cpp file.i just included includeCocoa/ 
Cocoa.h.But it shows so may errors.In build settings ,compiling the  
sources as its type.Is it missed any project settings?



No; you need to change the extension from 'cpp' to 'mm' in order to  
use ObjC in C++.


Nick Zitzmann
http://www.chronosnet.com/

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: NSNull and distinct objective-C type

2009-06-04 Thread I. Savant
On Thu, Jun 4, 2009 at 8:39 AM,  harpreet_si...@oxyent.com wrote:

 I am facing an issue in use of mach_absolute_time().

  Your post is off-topic in two ways: First, this has nothing to do
with the thread to which you replied (start a new thread for a new
question/topic). Second, this has nothing to do with Cocoa at all
(post to lists appropriate to your topic ... mach_absolute_time() is
not part of Cocoa - maybe the darwin-dev list would be a better place
to ask).

  Take a look at http://www.lists.apple.com/mailman/listinfo for a
list of lists hosted by Apple or use Google to find appropriate lists.

--
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: sleep() drift

2009-06-04 Thread Greg Parker

On Jun 4, 2009, at 5:39 AM, harpreet_si...@oxyent.com wrote:

I am facing an issue in use of mach_absolute_time().

mach_absolute_time() gives drift even when NTP timing update is on.

Please see my code below:

#import Cocoa/Cocoa.h
#import mach/mach_time.h
nt main(int argc, char *argv[])
{
uint64_t nowTime = mach_absolute_time();
uint64_t drift = 0;
for (int i=0;i1000;i++)
{
sleep(5);
uint64_t current_Time = mach_absolute_time();
uint64_t differenceTime = (current_Time - nowTime)*1E-6;
drift = differenceTime - (i+1)*5000;
NSLog(@Elapsed Time =%lld,differenceTime);
NSLog(@drift =%lld,drift);
}
return 1;
   //return NSApplicationMain(argc,  (const char **) argv);
}

Expected Results:
I expected to see zero drift in the print. After several runs, the  
drift

kept on increasing


Your expectation is wrong. sleep() will sleep for 5000 milliseconds.  
But (1) there's no guarantee that your thread gets to run at the  
5001st millisecond, and (2) your timing and printing code itself takes  
non-zero time.


If you really want to run every 5000 milliseconds with no drift,  
you'll need to use a more careful sleep mechanism (starting with  
nanosleep() plus accounting for the non-sleep time). A proper timer  
like NSTimer or CFRunLoopTimer might also work; they won't drift, but  
their jitter might be too high for your purposes.



--
Greg Parker gpar...@apple.com Runtime Wrangler


___

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: NSNull and distinct objective-C type

2009-06-04 Thread David Duncan

On Jun 4, 2009, at 5:39 AM, harpreet_si...@oxyent.com wrote:


Hello All,

I am facing an issue in use of mach_absolute_time().

mach_absolute_time() gives drift even when NTP timing update is on.

sleep(5);


Your assuming that sleep() provides drift free timing, which it does  
not - read the man page x-man-page://3/sleep for details.


If you want something closer to a drift free timer, then you need to  
determine when you want to wake up and use mach_wait_until() or a  
higher level API to wait until that time.

--
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: Touchscreens and control scaling

2009-06-04 Thread Ricky Sharp


On Jun 4, 2009, at 2:51 AM, Joe Ranieri wrote:



On Jun 4, 2009, at 03:44, Ben wrote:


Hi list,

I've been sketching out an application and could do with a little  
advice on which cocoa-direction to take. It's a full-screen (kiosk)  
type app, running in a very controlled environment (not for wide  
release) but which would run on an external touchscreen monitor.


While I can make buttons and labels big enough for fingers to poke,  
I'm concerned about controls like table headers and scrollers being  
large enough to make finger-size targets. I'm asking sooner rather  
than after testing the usability in case there are special  
considerations I should take before writing the first lines of code.


The only options I can think of are:

1. Make a normal app and use quartz debug to scale *everything* up
2. Subclass and/or redraw any controls too small for finger taps
3. Shut up and try it out first


I don't think option 1 will work well. Apple hasn't done too much to  
make anything resolution independent. Try running stuff on a non-1.0  
scale factor to see. We ended up going with option 2, partially for  
usability, and partially because we wanted an entirely themed kiosk  
environment anyways.



For a kiosk, you should definitely consider your own UI.  That's what  
I have done.  You'll also find that if your app will be exclusively  
used in touch environments, some of the Aqua controls may not fit well  
at all (since they were designed primarily for point-and-click).   
(Same thing goes for iPhone OS UI; totally different set of controls  
and behaviors).


In terms of resolution independence, note that while Apple's own Cocoa  
controls may not yet be RI-ready, the underlying frameworks are  
basically all there.  I actually submitted an app for the design  
awards back in Tiger days that was RI-savvy.  It not only worked with  
integral scale factors, but the fractional values as well.


___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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: launchd detecting when an application is running

2009-06-04 Thread Tom Hohensee

Thanks for the replies.

I am actually quite familiar with launchd but was thinking that maybe  
I had missed something.  I vaguely remember reading a blog where  
someone had used launchd to detect the app launching event but for the  
life of me I cannot find it.   It probably had something to do with  
detecting file changes of the launching app.  Unfortunately, the app I  
want to monitor is a commercial app which is not mine and I am not  
aware of any temp files it creates or files it alters.  For the time  
being I have written a small background app using NSWorkspace to  
detect the event, but I find it a waste of resources especially since  
the program it starts is only used for a brief period of time.  I  
probably will not incorporate it into the final release.


Also,  thanks to Kyle for pointing out the launchd IPC reading on the  
launchd man page.  I have must have scanned that page several times  
but never really paid much attention to that statement.


Tom

On Jun 4, 2009, at 11:51 AM, Greg Guerin wrote:


Tom Hohensee wrote:

I have written an application that I would like to launch whenever  
a certain app is launched. I have used LaunchAgents in the past to  
detect events such as USB insertion and volume mounting to perform  
certain actions. I was wondering if there was a launchd.plist key  
that allowed for launchd to detect an application startup.


Is this for distribution, or only for your personal use?

How soon after the original app launches do you need to start the  
secondary app?


How much control do you have over the original app?

Can you replace the original app's existing executable with another  
one that triggers your secondary app, then goes on to exec the  
original executable?  The trigger could be many things, including  
something that launchd monitors (see 'man launchd.plist' for on- 
demand conditions).


Maybe run a daemon that monitors FSEvents for creation of a temp- 
file you know the original app will create.


Maybe on-demand monitor the original app's user-defaults, so launchd  
triggers that way.


Those are just some random ideas.  It might help if you described  
exactly what you're trying to accomplish, including what the  
original app is.  Describe the problem; don't propose a solution.   
If you've already tried something, tell us what you've tried and  
exactly why it didn't work.  Be specific.


 -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

This email sent to tom...@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: Touchscreens and control scaling

2009-06-04 Thread Benjamin Dobson


On 4 Jun 2009, at 21:47:47, Ricky Sharp wrote:

For a kiosk, you should definitely consider your own UI.  That's  
what I have done.  You'll also find that if your app will be  
exclusively used in touch environments, some of the Aqua controls  
may not fit well at all (since they were designed primarily for  
point-and-click).  (Same thing goes for iPhone OS UI; totally  
different set of controls and behaviors).


Design point: I wouldn't click an iPhone control and I wouldn't tap an  
Aqua control. It doesn't look right for the purpose, therefore it  
doesn't feel right for the purpose. For a touch interface on the Mac,  
roll your own UI style.

___

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


NSToolbarItem bindings crash

2009-06-04 Thread Franklin Marmon


I have an NSToolbarItem with its Enabled binding set to a property  
in a controller object. For some reason after customizing the toolbar  
the next time the property is updated a notification is sent to a  
deallocated instance of the NSToolbarItem. It does not matter if I  
change the item at hand or another toolbar item. The crash takes place  
the very next time the bound item's property is updated.


Is there something I am supposed to do to maintain the bindings of  
toolbar items created in IB? Have I made a bad assumption, that the  
bindings would be maintained for me?


Thank you,

frm

Franklin Marmon
agathe...@agasupport.com
GTalk: agathe...@gmail.com





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: Help with SHA class

2009-06-04 Thread Ken Tozier


On Jun 4, 2009, at 1:35 PM, Greg Guerin wrote:


Why are you writing this algorithm?


Practice mostly. I wrote a MySQL connector class in Cocoa, but had to  
copy the SHA and password scrambling code from the MySQL source. It  
works, but it's really ugly and I wanted to take a crack at that part  
of the code to make it more Cocoa native.


If you're writing it in order to learn about hash algorithms, then I  
think it makes more sense for you to debug your code yourself, as  
unhelpful as that may seem to be.  I also suggest reading sources  
other than Wikipedia, not necessarily because Wikipedia might be  
wrong or have a typo, but because there might be more detailed step- 
by-step explanations elsewhere on the web.  Or look at the public  
domain ones and see how they differ from yours.


My algorithm seem pretty much like those I've looked at (and the one  
at Wikipedia) I made a few minor adjustments (using a switch rather  
than 4 separate loops etc...) but it seems like it should be pretty  
easy.


You might also try running your code on a machine that's actually  
big-endian, to see what happens. Unless you already are.


No access to a big endian machine


Iff you're running it on an Intel CPU, simply compile the code for  
ppc and use the 'arch' command to run that slice instead of the  
native slice.  If it doesn't produce the same output, then you have  
an implied-endian bug.  If it does produce the same output, you  
still have a bug.


Is it possible to compile a single class in a project to PPC while  
everything else in the project compiles to Intel?


If you're using an Intel CPU, maybe try finding a little-endian  
implementation of the algorithm.


No luck on that front.


BTW, your code should probably be using the type names UInt32 and  
UInt64, instead of making assumptions about sizes.  There are also  
places where you use the constant 4 instead of sizeof(UInt32).   
Though these may not affect this implementation, they seem  
questionable to me.


I generally go back and clean stuff like that up once I get the basic  
functionality working.


-Ken
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Help with SHA class

2009-06-04 Thread Michael Ash
On Thu, Jun 4, 2009 at 6:03 PM, Ken Tozier kentoz...@comcast.net wrote:
 Iff you're running it on an Intel CPU, simply compile the code for ppc and
 use the 'arch' command to run that slice instead of the native slice.  If it
 doesn't produce the same output, then you have an implied-endian bug.  If it
 does produce the same output, you still have a bug.

 Is it possible to compile a single class in a project to PPC while
 everything else in the project compiles to Intel?

Nope. Rosetta does not support mixed mode operation. Either everything
in a process must be PPC, or none of it.

 If you're using an Intel CPU, maybe try finding a little-endian
 implementation of the algorithm.

 No luck on that front.

Huh? You said you have a working version from the MySQL source.

You have some broken code intending to execute a certain algorithm.
You also have some working code which executes that same algorithm.
(And if you don't, there are probably literally hundreds of open
source examples available on the internet.) Set them both up in
parallel to run on identical data, then step through them both in the
debugger line by line until the internal states diverge. Now that you
know where things go wrong, look at the code and see what's different.
This is elementary debugging, in one of the easiest imaginable
scenarios.

And once you've found and fixed the problem and hopefully learned
something in the process, please delete all of your code and use one
of the SHA-1 functions provided by the OS. There is no excuse for
writing your own crypto code for production use in this day and age.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Should touch events related to a given view be implemented in the view or the view controller?

2009-06-04 Thread Michael A. Crawford
Previously, I would have said the view-controller.  But I just  
finished looking at the Metronome sample, which is included in the  
iPhone SDK.  The touch handling code as well as some of the view  
initialization code (requiring a completely loaded view) is  
implemented in the UIView-derived class.  Is this a bad example of how  
things should be partitioned or do I have the wrong idea about what  
the view-controller is for?


Here are some related follow-up questions:

1) What should be implemented in the view-controller?

2) Should all of the view properties be completely setup and  
configured within the view's own init and awakeFromNib methods or is  
the intent of viewDidLoad to allow for configuring view properties  
before proceeding?


Yeah, I'm confused.  Please discuss.  I will watch and learn.

-Michael
--
The difference between genius and stupidity...
...is that genius has its limits.

-- Albert Einstein





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: NSMutableURLRequest weirdness!

2009-06-04 Thread Keary Suska

On Jun 4, 2009, at 2:11 PM, Ammar Ibrahim wrote:

Hello, I'm about to bang my head against the wall. Here's the  
situation, I'm
trying to send many requests using the same request object, I have a  
method

which I call frequently, which has  the following piece of code:


This is not all the relevant code, and is insufficient to help. All I  
can say is, are you re-using the same NSURLConnection, just changing  
the request? If so, that wouldn't work. NSURLConnection copies the  
request on initialization.



NSMutableURLRequest *newReq = [[NSMutableURLRequest alloc] init];

[newReq setHTTPMethod:@GET];

[newReq setURL:[NSURL URLWithString:[@/media
stringByAppendingPathComponent:[currentTrack  
objectForKey:@Persistent ID]]

relativeToURL:[self serverBaseUrl]]];

NSURLConnection *connection = [NSURLConnection  
connectionWithRequest:newReq

delegate:self];

if (connection == nil) {

//connection couldn't be created!

NSLog(@Connection couldn't be created: %@, [newReq URL]);

[self startSyncAfterTimeInterval];

}



The first request works, after that it seems to not even send the  
request,

although the server is still responsive! I get the following error:


*Connection failed with error: Error Domain=NSURLErrorDomain  
Code=-1001

UserInfo=0x1397a40 timed 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/cocoa-dev%40esoteritech.com

This email sent to cocoa-...@esoteritech.com




Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business

___

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: NSMutableURLRequest weirdness!

2009-06-04 Thread Ammar Ibrahim
On Fri, Jun 5, 2009 at 1:55 AM, Keary Suska cocoa-...@esoteritech.comwrote:

 On Jun 4, 2009, at 2:11 PM, Ammar Ibrahim wrote:

  Hello, I'm about to bang my head against the wall. Here's the situation,
 I'm
 trying to send many requests using the same request object, I have a
 method
 which I call frequently, which has  the following piece of code:


 This is not all the relevant code, and is insufficient to help. All I can
 say is, are you re-using the same NSURLConnection, just changing the
 request? If so, that wouldn't work. NSURLConnection copies the request on
 initialization.


Yes, I'm reusing the same NSURLConnection and just changing the request, and
I can see a lot of weirdness and messed up calls. What's the right way to do
it? And I have my connection object as a class variable. Do I need to retain
it?
___

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


No Title Bar on NSPanel

2009-06-04 Thread John Ku
Hello all! Is there a way to subclass NSPanel and turn off the title bar on
it? I've check NSPanel and NSWindow. The only thing I found was
setShowsToolbarButton in the 'Managing Title Bars' section which is not it.
Im doing this for a pop up menu of a menu bar application. I want to see if
I can utilize NSPanel and its capabilities before I go create a custom
NSWindow from scratch. I really just need the simple looking NSPanel with
drop shadows, resizing, etc..
Thanks,
John
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: NSMutableURLRequest weirdness!

2009-06-04 Thread Mike Abdullah


On 5 Jun 2009, at 00:10, Ammar Ibrahim wrote:

On Fri, Jun 5, 2009 at 1:55 AM, Keary Suska cocoa- 
d...@esoteritech.comwrote:



On Jun 4, 2009, at 2:11 PM, Ammar Ibrahim wrote:

Hello, I'm about to bang my head against the wall. Here's the  
situation,

I'm
trying to send many requests using the same request object, I have a
method
which I call frequently, which has  the following piece of code:



This is not all the relevant code, and is insufficient to help. All  
I can

say is, are you re-using the same NSURLConnection, just changing the
request? If so, that wouldn't work. NSURLConnection copies the  
request on

initialization.



Yes, I'm reusing the same NSURLConnection and just changing the  
request, and
I can see a lot of weirdness and messed up calls. What's the right  
way to do
it? And I have my connection object as a class variable. Do I need  
to retain

it?


Changing the request will make no difference to the existing  
connection. As the docs state, the request used to create the  
connection is copied so it cannot be further modified. You should  
create 1 NSURLConnection per operation.


___

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: NSMutableURLRequest weirdness!

2009-06-04 Thread Ammar Ibrahim
On Fri, Jun 5, 2009 at 2:37 AM, Mike Abdullah cocoa...@mikeabdullah.netwrote:


 On 5 Jun 2009, at 00:10, Ammar Ibrahim wrote:

  On Fri, Jun 5, 2009 at 1:55 AM, Keary Suska cocoa-...@esoteritech.com
 wrote:

  On Jun 4, 2009, at 2:11 PM, Ammar Ibrahim wrote:

 Hello, I'm about to bang my head against the wall. Here's the situation,

 I'm
 trying to send many requests using the same request object, I have a
 method
 which I call frequently, which has  the following piece of code:


 This is not all the relevant code, and is insufficient to help. All I can
 say is, are you re-using the same NSURLConnection, just changing the
 request? If so, that wouldn't work. NSURLConnection copies the request on
 initialization.



 Yes, I'm reusing the same NSURLConnection and just changing the request,
 and
 I can see a lot of weirdness and messed up calls. What's the right way to
 do
 it? And I have my connection object as a class variable. Do I need to
 retain
 it?


 Changing the request will make no difference to the existing connection. As
 the docs state, the request used to create the connection is copied so it
 cannot be further modified. You should create 1 NSURLConnection per
 operation.


Excuse me for the silly question. But I'm going to be doing hundreds of
requests, and I have GC ON, how do I create these connections and retain
them?
___

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: NSMutableURLRequest weirdness!

2009-06-04 Thread Shawn Erickson
On Thu, Jun 4, 2009 at 4:44 PM, Ammar Ibrahim ammar.ibra...@gmail.com wrote:

 Excuse me for the silly question. But I'm going to be doing hundreds of
 requests, and I have GC ON, how do I create these connections and retain
 them?

Not sure I understand the question but as a guess...

Put them in an NSMutableArray or NSMutableSet if you need to keep
track of them? Also don't forget that the delegate methods get passed
a pointer to the connection sending the delegate message.

-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: NSMutableURLRequest weirdness!

2009-06-04 Thread Ammar Ibrahim
On Fri, Jun 5, 2009 at 2:44 AM, Ammar Ibrahim ammar.ibra...@gmail.comwrote:



 On Fri, Jun 5, 2009 at 2:37 AM, Mike Abdullah 
 cocoa...@mikeabdullah.netwrote:


 On 5 Jun 2009, at 00:10, Ammar Ibrahim wrote:

  On Fri, Jun 5, 2009 at 1:55 AM, Keary Suska cocoa-...@esoteritech.com
 wrote:

  On Jun 4, 2009, at 2:11 PM, Ammar Ibrahim wrote:

 Hello, I'm about to bang my head against the wall. Here's the situation,

 I'm
 trying to send many requests using the same request object, I have a
 method
 which I call frequently, which has  the following piece of code:


 This is not all the relevant code, and is insufficient to help. All I
 can
 say is, are you re-using the same NSURLConnection, just changing the
 request? If so, that wouldn't work. NSURLConnection copies the request
 on
 initialization.



 Yes, I'm reusing the same NSURLConnection and just changing the request,
 and
 I can see a lot of weirdness and messed up calls. What's the right way to
 do
 it? And I have my connection object as a class variable. Do I need to
 retain
 it?


 Changing the request will make no difference to the existing connection.
 As the docs state, the request used to create the connection is copied so it
 cannot be further modified. You should create 1 NSURLConnection per
 operation.


 Excuse me for the silly question. But I'm going to be doing hundreds of
 requests, and I have GC ON, how do I create these connections and retain
 them?


I mean, do I need to retain the connections?
___

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: NSMutableURLRequest weirdness!

2009-06-04 Thread Greg Guerin

Ammar Ibrahim wrote:

Excuse me for the silly question. But I'm going to be doing  
hundreds of
requests, and I have GC ON, how do I create these connections and  
retain

them?


Make an NSArray ivar, which you add the connections to.

This will work under GC or retain/release.  GC works because there's  
a reachable reference to the NSArray, which contains reachable  
references to the NSURLConnections.  R/R works because adding any  
object to NSArray calls retain() on the object.


If you don't want the NSURLConnections to live indefinitely, you'll  
have to occasionally cull the dead ones from the NSArray.


  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: NSMutableURLRequest weirdness!

2009-06-04 Thread Ammar Ibrahim
On Fri, Jun 5, 2009 at 3:16 AM, Shawn Erickson shaw...@gmail.com wrote:

 On Thu, Jun 4, 2009 at 4:44 PM, Ammar Ibrahim ammar.ibra...@gmail.com
 wrote:

  Excuse me for the silly question. But I'm going to be doing hundreds of
  requests, and I have GC ON, how do I create these connections and retain
  them?

 Not sure I understand the question but as a guess...

 Put them in an NSMutableArray or NSMutableSet if you need to keep
 track of them? Also don't forget that the delegate methods get passed
 a pointer to the connection sending the delegate message.


This is exactly what I did as shown in the code snippets below.
connections is a class instance of an NSMutableArray. Does this seems
correct? What's so weird is that I get a log on my HTTP server that the same
URL is being called twice!


NSMutableURLRequest *newReqGet = [[NSMutableURLRequest alloc] init];

[newReqGet setHTTPMethod:@GET];

[newReqGet setURL:[NSURL URLWithString:[@/media
stringByAppendingPathComponent:[currentTrack objectForKey:@Persistent ID]]
relativeToURL:[self serverBaseUrl]]];

 NSURLConnection *getConnection = [[NSURLConnection alloc]
initWithRequest:newReqGet
delegate:self startImmediately:YES];

 if (getConnection == nil) {

//connection couldn't be created!

NSLog(@Connection couldn't be created: %@, [newReqGet URL]);

 [self startSyncAfterTimeInterval];

} else {

[connections addObject:getConnection];

}
___

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


Help Book: Ask a Question Fails

2009-06-04 Thread K . Darcy Otto
I have created a Help Book that is indexed and recognised as part of  
the Help function, running under Leopard.  The Spotlight search works  
fine (when the user types search terms directly into the help menu).   
However, when the Help application has started, and the user types a  
search term into the Ask a question search field, the progress  
indicator to the left of the search field comes up, and nothing else  
happens.  That is, the progress indicator spins as if its working, but  
no search terms ever come up.  I have abstracts, titles and keywords  
as part of my help files.  Has anyone else encountered this problem?

___

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: XIB and AppleGlot

2009-06-04 Thread Jonathan Hess


On Jun 4, 2009, at 6:28 AM, Eric Slosser wrote:


(Sorry if this is OT, I couldn't find a better apple-hosted list...)

How does one use AppleGlot and XIBs?

I have an app, My.app, that was previously localized.  I'm working  
on version 2.0.


My app is starting to use XIB files.  These get compiled into NIBs  
in My.app.


The AppleGlot docs seem to say I should put My.app 2.0 into  
_NewBase, and My.app 1.0 into _OldLoc.


When I do that, the nibs that came from xibs are ignored (my.app.wg  
doesn't contain any of the strings from those nibs).  If I put  
NewDialog.xib into my.app, I see its strings in the .wg.


It seems like I be putting the source code form of the  
language.lproj folders into _OldBase, but none of the docs say  
that.


Can someone point me at a discussion of how to use AppleGlot in the  
presence of XIB files?


And (if it's not covered by default): What to do when the previous  
shipped app had a non-compiled Foo.nib, and the about-to-ship app  
has Foo.xib in the souces, and thus a compiled Foo.nib in the built  
app.


Hey Eric -

I believe the file names in _OldBase, _NewBase, and _OldLoc need to  
match. It sounds like your files in _OldBase and _OldLoc are  
probably .nib files, but you're files in _NewBase are .xib files.


You can upgrade the files in _OldBase and _OldLoc to .xib files with  
something like this:


cd _OldLoc
find . -name *.nib -type d -exec ibtool --upgrade {} \;
cd _OldBase
find . -name *.nib -type d -exec ibtool --upgrade {} \;

Hopefully that addresses you're problem -
Jon Hess




___

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: Should touch events related to a given view be implemented in the view or the view controller?

2009-06-04 Thread Jonathan Hess

Hey Michael -

It might help to approach this problem with the idea of If I had  
multiple view controllers using this view, how would I make that work  
best.


Event handling is something you would normally manage at the UIView  
layer. After those events are handled, they're typically translated  
them into some sort of action, or delegate callback. The delegate call  
back that builds further meaning belongs in the view controller, but  
the event capturing and translation into some meaningful gesture  
should go in the view. UIButton for example tracks a touch and  
delivers an action. It's up to the button to track the touches, and a  
controller to receive the action and ascribe some meaning to it.


If you're view is completely generic, and you want to customize a  
specific instance of it for one view controller, then you should place  
your view customizing code in you're -[UIViewController viewDidLoad]  
override. If your view would want these customizations no matter what  
controller it was working with, you should place them in the view's  
awakeFromNib method.


Good Luck -
Jon Hess

On Jun 4, 2009, at 3:45 PM, Michael A. Crawford wrote:

Previously, I would have said the view-controller.  But I just  
finished looking at the Metronome sample, which is included in the  
iPhone SDK.  The touch handling code as well as some of the view  
initialization code (requiring a completely loaded view) is  
implemented in the UIView-derived class.  Is this a bad example of  
how things should be partitioned or do I have the wrong idea about  
what the view-controller is for?


Here are some related follow-up questions:

1) What should be implemented in the view-controller?

2) Should all of the view properties be completely setup and  
configured within the view's own init and awakeFromNib methods or is  
the intent of viewDidLoad to allow for configuring view properties  
before proceeding?


Yeah, I'm confused.  Please discuss.  I will watch and learn.

-Michael
--
The difference between genius and stupidity...
...is that genius has its limits.

-- Albert Einstein



___

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/jhess%40apple.com

This email sent to jh...@apple.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Validating a NSSegmentedControl in a toolbar

2009-06-04 Thread Graham Cox

I'm having problems validating an NSSegmentedControl in a toolbar.

I have tried implementing both -validateUserInterfaceItem: and - 
validateToolbarItem: but neither is called for the segmented control.  
They are called for other simple buttons in the toolbar.


There's a note in the documentation for -validateToolbarItem: that  
NSToolbar only calls this method for image items, which might  
explain it. So what do I need to do to make this work for the  
segmented control? I've read all the toolbar and validation  
documentation I can find but I'm none the wiser - nothing so far  
stands out as the obvious right way to proceed.


My toolbar is currently wholly set up in IB, with no code in my app at  
all.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: No Title Bar on NSPanel

2009-06-04 Thread Kyle Sluder
You want to create a borderless NSWindow.  Override
-initWithContentRect:styleMask:backing:defer: to add
NSBorderlessWindowMask to the style mask you pass to super's
implementation.

--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: Validating a NSSegmentedControl in a toolbar

2009-06-04 Thread Joar Wingfors


On 4 jun 2009, at 18.10, Graham Cox wrote:

There's a note in the documentation for -validateToolbarItem: that  
NSToolbar only calls this method for image items, which might  
explain it. So what do I need to do to make this work for the  
segmented control? I've read all the toolbar and validation  
documentation I can find but I'm none the wiser - nothing so far  
stands out as the obvious right way to proceed.



I like to back all of my view-type toolbar items by separate view  
controllers. In this design it is the job of these view controllers to  
monitor the state of your application that affects their views, and  
update the enabled / selected state appropriately. Your views, or view  
controllers, can often times use bindings to achieve this with minimal  
fuss and overhead. There is no built in support in NSToolbar for  
managing view controllers for your view-type toolbar items, so you  
would have to manage that part for yourself.


j o a r


___

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: No Title Bar on NSPanel

2009-06-04 Thread Gregory Weston

John Ku wrote:

Hello all! Is there a way to subclass NSPanel and turn off the title  
bar on

it? I've check NSPanel and NSWindow. The only thing I found was
setShowsToolbarButton in the 'Managing Title Bars' section which is  
not it.
Im doing this for a pop up menu of a menu bar application. I want to  
see if

I can utilize NSPanel and its capabilities before I go create a custom
NSWindow from scratch. I really just need the simple looking NSPanel  
with

drop shadows, resizing, etc..


Resizing?

A resizable window without a title bar is pretty well outside the  
standard Mac OS X (or traditional Mac OS) user experience. What are  
you actually trying to present for which is this your solution?


G
___

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: No Title Bar on NSPanel

2009-06-04 Thread John Ku
Im going for a window that attaches to a menu bar item. Im going for
something like Cover Sutra's pop up Window:
http://sophiestication.s3.amazonaws.com/images/coversutra/screenshot1.png

Cover sutra's isn't resizable by the user, but the program resizes itself
depending on the search result.



On Thu, Jun 4, 2009 at 6:40 PM, Gregory Weston gwes...@mac.com wrote:

 John Ku wrote:

  Hello all! Is there a way to subclass NSPanel and turn off the title bar
 on
 it? I've check NSPanel and NSWindow. The only thing I found was
 setShowsToolbarButton in the 'Managing Title Bars' section which is not
 it.
 Im doing this for a pop up menu of a menu bar application. I want to see
 if
 I can utilize NSPanel and its capabilities before I go create a custom
 NSWindow from scratch. I really just need the simple looking NSPanel with
 drop shadows, resizing, etc..


 Resizing?

 A resizable window without a title bar is pretty well outside the standard
 Mac OS X (or traditional Mac OS) user experience. What are you actually
 trying to present for which is this your solution?

 G
 ___

 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/john.cmyk%40gmail.com

 This email sent to john.c...@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: Validating a NSSegmentedControl in a toolbar

2009-06-04 Thread Nick Zitzmann


On Jun 4, 2009, at 7:10 PM, Graham Cox wrote:

There's a note in the documentation for -validateToolbarItem: that  
NSToolbar only calls this method for image items, which might  
explain it. So what do I need to do to make this work for the  
segmented control?



In addition to what Joar suggested, you can also subclass  
NSToolbarItem, use the subclass for the view item, and override - 
validate and put your validation code there. I've done this before,  
and it works fine, even for view toolbar items.


Nick Zitzmann
http://www.chronosnet.com/



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: No Title Bar on NSPanel

2009-06-04 Thread vinai

If you force your panel's setTitle method to an empty NSString, does that get 
you a panel with a bar without a title ?

vinai

--- On Thu, 6/4/09, John Ku john.c...@gmail.com wrote:

 From: John Ku john.c...@gmail.com
 Subject: Re: No Title Bar on NSPanel
 To: Gregory Weston gwes...@mac.com
 Cc: cocoa-dev@lists.apple.com
 Date: Thursday, June 4, 2009, 8:57 PM
 Im going for a window that attaches
 to a menu bar item. Im going for
 something like Cover Sutra's pop up Window:
 http://sophiestication.s3.amazonaws.com/images/coversutra/screenshot1.png
 
 Cover sutra's isn't resizable by the user, but the program
 resizes itself depending on the search result.
 
 
 
 On Thu, Jun 4, 2009 at 6:40 PM, Gregory Weston gwes...@mac.com
 wrote:
 
  John Ku wrote:
 
   Hello all! Is there a way to subclass NSPanel
 and turn off the title bar
  on
  it? I've check NSPanel and NSWindow. The only
 thing I found was
  setShowsToolbarButton in the 'Managing Title Bars'
 section which is not
  it.
  Im doing this for a pop up menu of a menu bar
 application. I want to see
  if
  I can utilize NSPanel and its capabilities before
 I go create a custom
  NSWindow from scratch. I really just need the
 simple looking NSPanel with
  drop shadows, resizing, etc..
 
 
  Resizing?
 
  A resizable window without a title bar is pretty well
 outside the standard
  Mac OS X (or traditional Mac OS) user experience. What
 are you actually
  trying to present for which is this your solution?
 
  G
  ___
 
  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/john.cmyk%40gmail.com
 
  This email sent to john.c...@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/for_usenet%40yahoo.com
 
 This email sent to for_use...@yahoo.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: No Title Bar on NSPanel

2009-06-04 Thread John Ku
Yeah, the bar is still there but without a title.
john

On Thu, Jun 4, 2009 at 7:11 PM, vinai for_use...@yahoo.com wrote:


 If you force your panel's setTitle method to an empty NSString, does that
 get you a panel with a bar without a title ?

 vinai

 --- On Thu, 6/4/09, John Ku john.c...@gmail.com wrote:

  From: John Ku john.c...@gmail.com
  Subject: Re: No Title Bar on NSPanel
  To: Gregory Weston gwes...@mac.com
  Cc: cocoa-dev@lists.apple.com
  Date: Thursday, June 4, 2009, 8:57 PM
  Im going for a window that attaches
  to a menu bar item. Im going for
  something like Cover Sutra's pop up Window:
 
 http://sophiestication.s3.amazonaws.com/images/coversutra/screenshot1.png
 
  Cover sutra's isn't resizable by the user, but the program
  resizes itself depending on the search result.
 
 
 
  On Thu, Jun 4, 2009 at 6:40 PM, Gregory Weston gwes...@mac.com
  wrote:
 
   John Ku wrote:
  
Hello all! Is there a way to subclass NSPanel
  and turn off the title bar
   on
   it? I've check NSPanel and NSWindow. The only
  thing I found was
   setShowsToolbarButton in the 'Managing Title Bars'
  section which is not
   it.
   Im doing this for a pop up menu of a menu bar
  application. I want to see
   if
   I can utilize NSPanel and its capabilities before
  I go create a custom
   NSWindow from scratch. I really just need the
  simple looking NSPanel with
   drop shadows, resizing, etc..
  
  
   Resizing?
  
   A resizable window without a title bar is pretty well
  outside the standard
   Mac OS X (or traditional Mac OS) user experience. What
  are you actually
   trying to present for which is this your solution?
  
   G
   ___
  
   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/john.cmyk%40gmail.com
  
   This email sent to john.c...@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/for_usenet%40yahoo.com
 
  This email sent to for_use...@yahoo.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/john.cmyk%40gmail.com

 This email sent to john.c...@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: Validating a NSSegmentedControl in a toolbar

2009-06-04 Thread Graham Cox


On 05/06/2009, at 11:29 AM, Joar Wingfors wrote:



On 4 jun 2009, at 18.10, Graham Cox wrote:

There's a note in the documentation for -validateToolbarItem: that  
NSToolbar only calls this method for image items, which might  
explain it. So what do I need to do to make this work for the  
segmented control? I've read all the toolbar and validation  
documentation I can find but I'm none the wiser - nothing so far  
stands out as the obvious right way to proceed.



I like to back all of my view-type toolbar items by separate view  
controllers. In this design it is the job of these view controllers  
to monitor the state of your application that affects their views,  
and update the enabled / selected state appropriately. Your views,  
or view controllers, can often times use bindings to achieve this  
with minimal fuss and overhead. There is no built in support in  
NSToolbar for managing view controllers for your view-type toolbar  
items, so you would have to manage that part for yourself.



Thanks a lot - this is working out well so far.

Follow-up question: how can I turn OFF a segment in a segmented  
control? The situation is this:


The segmented control represents text alignment - left, center, right,  
justified. Only one can be on at a time normally, but if I select a  
non-text object that doesn't respond to the alignment settings, I want  
to disable the control and turn off all the segments. I can disable it  
alright, but there doesn't seem to be a way to turn all segments off -  
passing -1 to selectSegmentWithTag: doesn't do anything, - 
setSelectedSegment: with -1 produces an out of range exception, even  
though its counterpart -selectedSegment, returns -1 for no selection.


Any ideas?

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: No Title Bar on NSPanel

2009-06-04 Thread vinai

Sorry,

My error - I thought you were looking for a way to just have a window with an 
empty title bar (I thought the resizing capability you mentioned was in the 
title bar).  I hadn't realized you wanted a window completely without a bar at 
all ...

vinai

--- On Thu, 6/4/09, John Ku john.c...@gmail.com wrote:

 From: John Ku john.c...@gmail.com
 Subject: Re: No Title Bar on NSPanel
 To: vinai for_use...@yahoo.com
 Cc: cocoa-dev@lists.apple.com
 Date: Thursday, June 4, 2009, 9:19 PM
 Yeah, the bar is still there but
 without a title.
 john
 
 On Thu, Jun 4, 2009 at 7:11 PM,
 vinai for_use...@yahoo.com
 wrote:
 
 
 
 
 If you force your panel's setTitle method
 to an empty NSString, does that get you a panel with a bar
 without a title ?
 
 
 
 vinai
 
 
 
 --- On Thu, 6/4/09, John Ku john.c...@gmail.com
 wrote:
 
 
 
  From: John Ku john.c...@gmail.com
 
  Subject: Re: No Title Bar on NSPanel
 
  To: Gregory Weston gwes...@mac.com
 
  Cc: cocoa-dev@lists.apple.com
 
  Date: Thursday, June 4, 2009, 8:57 PM
 
  Im going for a window
 that attaches
 
  to a menu bar item. Im going for
 
  something like Cover Sutra's pop up Window:
 
  http://sophiestication.s3.amazonaws.com/images/coversutra/screenshot1.png
 
 
 
  Cover sutra's isn't resizable by the user, but
 the program
 
  resizes itself depending on the search result.
 
 
 
 
 
 
 
  On Thu, Jun 4, 2009 at 6:40 PM, Gregory Weston gwes...@mac.com
 
  wrote:
 
 
 
   John Ku wrote:
 
  
 
Hello all! Is there a way to subclass NSPanel
 
  and turn off the title bar
 
   on
 
   it? I've check NSPanel and NSWindow. The
 only
 
  thing I found was
 
   setShowsToolbarButton in the 'Managing
 Title Bars'
 
  section which is not
 
   it.
 
   Im doing this for a pop up menu of a menu
 bar
 
  application. I want to see
 
   if
 
   I can utilize NSPanel and its capabilities
 before
 
  I go create a custom
 
   NSWindow from scratch. I really just need
 the
 
  simple looking NSPanel with
 
   drop shadows, resizing, etc..
 
  
 
  
 
   Resizing?
 
  
 
   A resizable window without a title bar is pretty
 well
 
  outside the standard
 
   Mac OS X (or traditional Mac OS) user experience.
 What
 
  are you actually
 
   trying to present for which is this your
 solution?
 
  
 
   G
 
   ___
 
  
 
   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/john.cmyk%40gmail.com
 
  
 
   This email sent to john.c...@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/for_usenet%40yahoo.com
 
 
 
  This email sent to for_use...@yahoo.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/john.cmyk%40gmail.com
 
 
 
 This email sent to john.c...@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: No Title Bar on NSPanel

2009-06-04 Thread John Ku
Ahh, thanks for helping though. :)

On Thu, Jun 4, 2009 at 7:29 PM, vinai for_use...@yahoo.com wrote:


 Sorry,

 My error - I thought you were looking for a way to just have a window with
 an empty title bar (I thought the resizing capability you mentioned was in
 the title bar).  I hadn't realized you wanted a window completely without a
 bar at all ...

 vinai

 --- On Thu, 6/4/09, John Ku john.c...@gmail.com wrote:

  From: John Ku john.c...@gmail.com
  Subject: Re: No Title Bar on NSPanel
  To: vinai for_use...@yahoo.com
  Cc: cocoa-dev@lists.apple.com
  Date: Thursday, June 4, 2009, 9:19 PM
  Yeah, the bar is still there but
  without a title.
  john
 
  On Thu, Jun 4, 2009 at 7:11 PM,
  vinai for_use...@yahoo.com
  wrote:
 
 
 
 
  If you force your panel's setTitle method
  to an empty NSString, does that get you a panel with a bar
  without a title ?
 
 
 
  vinai
 
 
 
  --- On Thu, 6/4/09, John Ku john.c...@gmail.com
  wrote:
 
 
 
   From: John Ku john.c...@gmail.com
 
   Subject: Re: No Title Bar on NSPanel
 
   To: Gregory Weston gwes...@mac.com
 
   Cc: cocoa-dev@lists.apple.com
 
   Date: Thursday, June 4, 2009, 8:57 PM
 
   Im going for a window
  that attaches
 
   to a menu bar item. Im going for
 
   something like Cover Sutra's pop up Window:
 
  
 http://sophiestication.s3.amazonaws.com/images/coversutra/screenshot1.png
 
  
 
   Cover sutra's isn't resizable by the user, but
  the program
 
   resizes itself depending on the search result.
 
  
 
  
 
  
 
   On Thu, Jun 4, 2009 at 6:40 PM, Gregory Weston gwes...@mac.com
 
   wrote:
 
  
 
John Ku wrote:
 
   
 
 Hello all! Is there a way to subclass NSPanel
 
   and turn off the title bar
 
on
 
it? I've check NSPanel and NSWindow. The
  only
 
   thing I found was
 
setShowsToolbarButton in the 'Managing
  Title Bars'
 
   section which is not
 
it.
 
Im doing this for a pop up menu of a menu
  bar
 
   application. I want to see
 
if
 
I can utilize NSPanel and its capabilities
  before
 
   I go create a custom
 
NSWindow from scratch. I really just need
  the
 
   simple looking NSPanel with
 
drop shadows, resizing, etc..
 
   
 
   
 
Resizing?
 
   
 
A resizable window without a title bar is pretty
  well
 
   outside the standard
 
Mac OS X (or traditional Mac OS) user experience.
  What
 
   are you actually
 
trying to present for which is this your
  solution?
 
   
 
G
 
___
 
   
 
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/john.cmyk%40gmail.com
 
   
 
This email sent to john.c...@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/for_usenet%40yahoo.com
 
  
 
   This email sent to for_use...@yahoo.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/john.cmyk%40gmail.com
 
 
 
  This email sent to john.c...@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/john.cmyk%40gmail.com

 This email sent to john.c...@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: Validating a NSSegmentedControl in a toolbar

2009-06-04 Thread Graham Cox


On 05/06/2009, at 12:26 PM, Graham Cox wrote:

Follow-up question: how can I turn OFF a segment in a segmented  
control? The situation is this:



Iterating over the segments with -setSelected:NO forSegment:i does  
the trick for this.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: No Title Bar on NSPanel

2009-06-04 Thread Rob Keniger


On 05/06/2009, at 9:20 AM, John Ku wrote:

Hello all! Is there a way to subclass NSPanel and turn off the title  
bar on

it?



You can't do this. The only way to get a window without a title bar is  
to create an NSWindow using - 
initWithContentRect:styleMask:backing:defer: and passing in  
NSBorderlessWindowMask.


NSPanels use a private style mask which is not compatible with  
NSBorderlessWindowMask.


You will need to do some work in your own NSWindow subclass to get the  
behaviour you are looking for.


--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Miles
I am trying to figure out the easiest way to make an object animate around a
circle, but preserve it's orientation. Much in the way that a seat on a
ferris wheel would look as it goes 'round.
I assume there's a pretty simple solution, but I haven't thought of it yet.
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: How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Graham Cox


On 05/06/2009, at 1:34 PM, Miles wrote:

I am trying to figure out the easiest way to make an object animate  
around a
circle, but preserve it's orientation. Much in the way that a seat  
on a

ferris wheel would look as it goes 'round.
I assume there's a pretty simple solution, but I haven't thought of  
it yet.



Well, what have you tried so far?

This is simple on the face of it - you just compute the x, y  
coordinates of the object and increment the angle using a timer or  
something. Or did you mean specifically within an animation technology  
such as Core Animation? What is the object. It's all a bit vague...


position.x = origin.x + radius * cos( angle );
position.y = origin.y + radius * sin( angle );
[object setPosition:position];



--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Miles
Thanks for the quick response!

I've mostly been reading trying to see what would work. I did mess with
changing the anchorPoint to get the initial animation route, but that didn't
seem to suffice.

The object I'm animating is a simple UIView containing an image.

I thought about the timer approach like you mention, the reason I shy'd away
from it was that it needs to stay in sync with another animating object (in
my ferris wheel example this would be the wheel itself.)
But now that I think of it I might be able to use the timer to animate that
as well so they do stay in sync.

Does that seem like the best and/or easiest approach?




On Thu, Jun 4, 2009 at 8:40 PM, Graham Cox graham@bigpond.com wrote:


 On 05/06/2009, at 1:34 PM, Miles wrote:

  I am trying to figure out the easiest way to make an object animate around
 a
 circle, but preserve it's orientation. Much in the way that a seat on a
 ferris wheel would look as it goes 'round.
 I assume there's a pretty simple solution, but I haven't thought of it
 yet.



 Well, what have you tried so far?

 This is simple on the face of it - you just compute the x, y coordinates of
 the object and increment the angle using a timer or something. Or did you
 mean specifically within an animation technology such as Core Animation?
 What is the object. It's all a bit vague...

 position.x = origin.x + radius * cos( angle );
 position.y = origin.y + radius * sin( angle );
 [object setPosition:position];



 --Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: QTCaptureSession class reference

2009-06-04 Thread Cain John

Thanks for all that - now have the reference as html.
Will file a bug report.
Will join the quicktime-api list
Thanks again
John

On 04/06/2009, at 5:34 PM, M Pulis wrote:


On Jun 3, 2009, at 9:33 PM, Andy Lee wrote:


On Jun 3, 2009, at 11:41 PM, Fritz Anderson wrote:


On 3 Jun 2009, at 7:56 PM, Cain John wrote:

I cannot find this documentation. Searching the Mac Dev Center  
gives over 60 references to the class but no documentation of  
it's properties and methods.
Hope that this is an appropriate list for this question. There  
doesn't seem to be an Apple sponsored QT list.


Look for the quicktime-api mailing list, http://lists.apple.com/mailman/listinfo/quicktime-api 
. It and three other QuickTime lists are right there on the  
lists.apple.com site. I'm surprised they didn't turn up when you  
looked there.


As has been pointed out, there is a lot of reference _to_ the  
class, and open -h QTCaptureSession.h opens the header. But  
there ought to be a Class Reference for it. Google even turns up a  
page for it, but the link is broken.


If you mean the first result for QTCaptureSession  
site:developer.apple.com, which is a link to a PDF, you can still  
view it by clicking the View as HTML link.


Links to the class in the current docset have been pulled (that  
is, unlike other QTKit classes, QTCaptureSession isn't shown in as  
a link).


It doesn't look like a large or complex API, and you can infer  
most of how it works from the supporting documentation, but jeez...


Ask on the mailing list, and consider filing a bug on  
bugreport.apple.com.


I second both suggestions.

--Andy




In Xcode 3.1.2, when I Option-Click QTCaptureSession in my source  
code, select Find Selected Text in API Reference it takes me to  
the QTCaptureSession Class Reference


Works for me.

Gary


John
kergunyah...@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: How to animate an object in a circle, but preserve it's orientation

2009-06-04 Thread Graham Cox


On 05/06/2009, at 1:48 PM, Miles wrote:


Thanks for the quick response!

I've mostly been reading trying to see what would work. I did mess  
with changing the anchorPoint to get the initial animation route,  
but that didn't seem to suffice.


The object I'm animating is a simple UIView containing an image.

I thought about the timer approach like you mention, the reason I  
shy'd away from it was that it needs to stay in sync with another  
animating object (in my ferris wheel example this would be the wheel  
itself.)
But now that I think of it I might be able to use the timer to  
animate that as well so they do stay in sync.


Does that seem like the best and/or easiest approach?




Well, I'd say it can be made to work, but I personally wouldn't do it  
this way.


It's still a bit vague, but I'm visualising a Ferris Wheel with a  
number of (one or more) attached basket objects. To model this, I  
would define the angle and radius as properties of the wheel, and the  
position of the basket as a property in terms of its position relative  
to the wheel (a fixed angle, say). The basket objects could be owned  
by the wheel, which makes good sense to me.


To animate the rotation of the wheel, simply increment the angle of  
the wheel. This in turn directly or indirectly updates the positions  
of its attached baskets. The whole thing is then redrawn in the new  
position. The absolute location of a basket can be simply calculated  
as needed when the basket is drawn, based on the wheel's angle, radius  
and relative position of the basket on the wheel.


Any time I hear people talking about keeping things in sync alarm  
bells ring. Instead, make one property a derivative or dependency of  
the other, then there is nothing to 'sync', it's always in sync.


In terms of visualising the wheel/basket model in a view, I'd just use  
a custom view and drawn the entire content. The wheel object could  
draw itself, which in turn calls on each of its basket objects to draw  
themselves, and so on. Trying to make each basket a separate view will  
be inefficient and more complicated than this.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: How to lock an object?

2009-06-04 Thread Rob Keniger


On 05/06/2009, at 2:03 PM, cocoa learner wrote:

How can I use mlock() for NSString and NSTextField?As argument to  
mlock is

address of memory area and length.
I have address of memory area but I do not have the length (as these  
are

objects).



If you want to allow the user to edit a password or other sensitive  
data in the UI then you should use an NSSecureTextField.


--
Rob Keniger



___

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: QTCaptureSession class reference

2009-06-04 Thread M Pulis

Welcome to the group!

On Jun 4, 2009, at 8:56 PM, Cain John wrote:


Thanks for all that - now have the reference as html.
Will file a bug report.
Will join the quicktime-api list
Thanks again
John

On 04/06/2009, at 5:34 PM, M Pulis wrote:


On Jun 3, 2009, at 9:33 PM, Andy Lee wrote:


On Jun 3, 2009, at 11:41 PM, Fritz Anderson wrote:


On 3 Jun 2009, at 7:56 PM, Cain John wrote:

I cannot find this documentation. Searching the Mac Dev Center  
gives over 60 references to the class but no documentation of  
it's properties and methods.
Hope that this is an appropriate list for this question. There  
doesn't seem to be an Apple sponsored QT list.


Look for the quicktime-api mailing list, http://lists.apple.com/ 
mailman/listinfo/quicktime-api. It and three other QuickTime  
lists are right there on the lists.apple.com site. I'm surprised  
they didn't turn up when you looked there.


As has been pointed out, there is a lot of reference _to_ the  
class, and open -h QTCaptureSession.h opens the header. But  
there ought to be a Class Reference for it. Google even turns up  
a page for it, but the link is broken.


If you mean the first result for QTCaptureSession  
site:developer.apple.com, which is a link to a PDF, you can  
still view it by clicking the View as HTML link.


Links to the class in the current docset have been pulled (that  
is, unlike other QTKit classes, QTCaptureSession isn't shown in  
as a link).


It doesn't look like a large or complex API, and you can infer  
most of how it works from the supporting documentation, but jeez...


Ask on the mailing list, and consider filing a bug on  
bugreport.apple.com.


I second both suggestions.

--Andy




In Xcode 3.1.2, when I Option-Click QTCaptureSession in my source  
code, select Find Selected Text in API Reference it takes me to  
the QTCaptureSession Class Reference


Works for me.

Gary


John
kergunyah...@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/toothpic%40fastq.com

This email sent to tooth...@fastq.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: How to lock an object?

2009-06-04 Thread cocoa learner
It's not just password. It can be any thing which is secure. Like file data,
personal information, any thing user mark it as secure.
Regards
Cocoa.learner

On Fri, Jun 5, 2009 at 10:08 AM, Rob Keniger r...@menumachine.com wrote:


 On 05/06/2009, at 2:03 PM, cocoa learner wrote:

  How can I use mlock() for NSString and NSTextField?As argument to mlock is
 address of memory area and length.
 I have address of memory area but I do not have the length (as these are
 objects).



 If you want to allow the user to edit a password or other sensitive data in
 the UI then you should use an NSSecureTextField.

 --
 Rob Keniger



 ___

 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/cocoa.learner%40gmail.com

 This email sent to cocoa.lear...@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: How to lock an object?

2009-06-04 Thread Bill Bumgarner

On Jun 4, 2009, at 8:57 PM, cocoa learner wrote:
I am writing an application which read an encrypted data from disk,  
decrypt
it and display that in UI. Now the object that holds that decrypted  
data

should not page out to swap area (for security reason).
This is my need. Is there a better way to do this?


If an attacker can get to the swap files, that means one of two things:

(a) they have (or had) superuser on the machine

(b) the attacker has physical possession of the machine (which has  
been rebooted or powered down; see (a))


If (a), you've already lost.  With superuser, the attacker can capture  
events, inject code, commandeer the window server, and/or p0wnz3 your  
process just about anyway they want.


So, really, you are defending against (b).  In the case of (b), for  
defending the swapfile to even matter, there must be no other  
decrypted bits on disc anywhere else.Go that?


Assuming you do, then the easiest way to secure the swapfile is to  
turn on swapfile encryption.


Actually, it might be the only reasonable solution.

There is no way you are going to be able to mlock() all of the random  
allocations associated with any particular sub-graph of objects in  
your application.  The allocations are an implementation detail and  
may change at whim of update, architecture and/or OS release.


You might be able to lock down your entire process, but that would be  
exceptionally rude as it is going to take away significant resources  
from other applications and, on a particularly resource constrained  
system, could lead to exhaustion of memory resources entirely.


b.bum


___

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