Re: making the NSScrollView align its subview to the top-left corner

2009-10-31 Thread Gustavo Pizano
Kyle, sorry to have bother. :P. I was really tired and I decided just  
to ask before lookign, sorry my bad.


G.
On Oct 30, 2009, at 10:57 PM, Kyle Sluder wrote:


On Fri, Oct 30, 2009 at 2:53 PM, Gustavo Pizano
 wrote:

Any ideas what Im missing?


Did you perform a web search before asking the list?  Searching Google
for "NSScrollView top left" (without the quotes) yielded this as the
third hit for me:
http://www.omnigroup.com/mailman/archive/macosx-dev/2001-January/020837.html

The first hit was a message in response to someone else asking this
same question, telling them it was a "FAQ of all FAQs" and to perform
a web search before asking the list.  :-)

--Kyle Sluder


___

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

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

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

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


Re: making the NSScrollView align its subview to the top-left corner

2009-10-31 Thread Gustavo Pizano

Aha great, thanks

G.
On Oct 31, 2009, at 12:51 AM, Graham Cox wrote:



On 31/10/2009, at 8:53 AM, Gustavo Pizano wrote:


Any ideas what Im missing?



The view contained by the scrollview needs to be flipped. Return YES  
from an override of -isFlipped.


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


Double-clicking a screensaver

2009-10-31 Thread Gabriel Zachmann
I think I've seen screen savers that copy themselves to ~/Library/ 
Screensavers by double-clicking on the .saver file (that is still in  
the DMG).


Could someone tell me how I can make my screensaver have this  
capability as well?


Thanks a lot in advance.

Best regards,
Gabriel.



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: Double-clicking a screensaver

2009-10-31 Thread Sherm Pendley
On Sat, Oct 31, 2009 at 10:19 AM, Gabriel Zachmann  wrote:
> I think I've seen screen savers that copy themselves to
> ~/Library/Screensavers by double-clicking on the .saver file (that is still
> in the DMG).
>
> Could someone tell me how I can make my screensaver have this capability as
> well?

The system's screen saver app registered .saver as a document type, so
that behavior happens automagically. You don't need to do anything
besides create a normal .saver plugin from the standard template.

If you want similar behavior from a screen saver app of your own, you
can do the same thing - register a filename extension for your
plugins, and copy them to your ~/Library/Application Support folder
when the user tries to open them.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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

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

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

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


Re: Double-clicking a screensaver

2009-10-31 Thread Gabriel Zachmann

The system's screen saver app registered .saver as a document type, so
that behavior happens automagically. You don't need to do anything
besides create a normal .saver plugin from the standard template.



I think, I'm doing that, but when I double click the .saver file,  
System Preferences starts and I get the error message "Could not  
install ...".


My XCode project with which I am compiling my screensaver is pretty old.
I am running XCode 3.2, though.

So could there be some old "garbage" in the project file?
I looked through the project settings several times, but couldn't spot  
anything.


Regards,
Gabriel.



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: iPhone: How to show another view on UITableView

2009-10-31 Thread Fritz Anderson

On 30 Oct 2009, at 9:59 PM, Symadept wrote:


I wanna show another image view in the bottom of the UITableView.

Any pointers please.


Add a section with no rows. Return your view as the header or footer  
view for that section.


— F

___

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

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

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

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


Re: iPhone: How to show another view on UITableView

2009-10-31 Thread Luke the Hiesterman

No. Use the tableFooterView. That's what it's for.

Luke

On Oct 31, 2009, at 8:21 AM, Fritz Anderson wrote:


On 30 Oct 2009, at 9:59 PM, Symadept wrote:


I wanna show another image view in the bottom of the UITableView.

Any pointers please.


Add a section with no rows. Return your view as the header or footer  
view for that section.


— F

___

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

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

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

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


Re: iPhone: How to show another view on UITableView

2009-10-31 Thread Fritz Anderson

On 31 Oct 2009, at 10:26 AM, Luke the Hiesterman wrote:


No. Use the tableFooterView. That's what it's for.


Ouch. I'd been using the footer-in-void-section method for sections in  
the middle of tables. Was I wrong there as well?


— F

___

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

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

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

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


Re: Double-clicking a screensaver

2009-10-31 Thread Sherm Pendley
On Sat, Oct 31, 2009 at 11:21 AM, Gabriel Zachmann  wrote:
>> The system's screen saver app registered .saver as a document type, so
>> that behavior happens automagically. You don't need to do anything
>> besides create a normal .saver plugin from the standard template.
>
> I think, I'm doing that, but when I double click the .saver file, System
> Preferences starts and I get the error message "Could not install ...".
>
> My XCode project with which I am compiling my screensaver is pretty old.
> I am running XCode 3.2, though.

How old is "old"? Have you updated the project to create a universal
binary? Snow Leopard is Intel-only, so its screen saver app isn't
going to be able to load a PPC-only .saver plugin.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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

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

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

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


Re: iPhone: How to show another view on UITableView

2009-10-31 Thread Luke the Hiesterman
That's a little strange.why do that rather than using a footer  
view on an actual section?


Luke

On Oct 31, 2009, at 8:29 AM, Fritz Anderson wrote:


On 31 Oct 2009, at 10:26 AM, Luke the Hiesterman wrote:


No. Use the tableFooterView. That's what it's for.


Ouch. I'd been using the footer-in-void-section method for sections  
in the middle of tables. Was I wrong there as well?


— F



___

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

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

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

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


Re: iPhone: How to show another view on UITableView

2009-10-31 Thread Fritz Anderson
We may be talking at cross purposes. By "void section" I mean an  
actual section with no rows.


— F

On 31 Oct 2009, at 10:36 AM, Luke the Hiesterman wrote:

That's a little strange.why do that rather than using a footer  
view on an actual section?


Luke

On Oct 31, 2009, at 8:29 AM, Fritz Anderson wrote:


On 31 Oct 2009, at 10:26 AM, Luke the Hiesterman wrote:


No. Use the tableFooterView. That's what it's for.


Ouch. I'd been using the footer-in-void-section method for sections  
in the middle of tables. Was I wrong there as well?




___

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

Please do not post admin requests or moderator comments to the list.
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: iPhone: How to show another view on UITableView

2009-10-31 Thread Luke the Hiesterman
Yeah, I get thatI don't understand why you would create this void  
section just to display a footer view when you could simply display  
the footer view on a section that actually has rows. Since you said  
you're doing this in the middle of the table, I'm assuming there's a  
section with rows directly above where you're doing this, and that  
seems like a more logical place for the footer view.


Luke

On Oct 31, 2009, at 8:37 AM, Fritz Anderson wrote:

We may be talking at cross purposes. By "void section" I mean an  
actual section with no rows.


— F

On 31 Oct 2009, at 10:36 AM, Luke the Hiesterman wrote:

That's a little strange.why do that rather than using a footer  
view on an actual section?


Luke

On Oct 31, 2009, at 8:29 AM, Fritz Anderson wrote:


On 31 Oct 2009, at 10:26 AM, Luke the Hiesterman wrote:


No. Use the tableFooterView. That's what it's for.


Ouch. I'd been using the footer-in-void-section method for  
sections in the middle of tables. Was I wrong there as well?






___

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

Please do not post admin requests or moderator comments to the list.
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: iPhone: How to show another view on UITableView

2009-10-31 Thread Fritz Anderson
If you use a void section, you can reorder the sections and the custom  
(here footer) view with just a change in #defines. It seems cleaner to  
me. Am I just lazy? And does using an empty section produce any visual  
or functional difference?


— F

On 31 Oct 2009, at 10:39 AM, Luke the Hiesterman wrote:

Yeah, I get thatI don't understand why you would create this  
void section just to display a footer view when you could simply  
display the footer view on a section that actually has rows. Since  
you said you're doing this in the middle of the table, I'm assuming  
there's a section with rows directly above where you're doing this,  
and that seems like a more logical place for the footer view.


___

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

Please do not post admin requests or moderator comments to the list.
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: iPhone: How to show another view on UITableView

2009-10-31 Thread Luke the Hiesterman
I won't go so far as to say that it's wrong. It just seems a little  
strange. As for the original poster's question about putting a view at  
the bottom of the table, though, there's no doubt that the  
tableFooterView property is the way to go.


Luke

On Oct 31, 2009, at 8:42 AM, Fritz Anderson wrote:

If you use a void section, you can reorder the sections and the  
custom (here footer) view with just a change in #defines. It seems  
cleaner to me. Am I just lazy? And does using an empty section  
produce any visual or functional difference?


— F

On 31 Oct 2009, at 10:39 AM, Luke the Hiesterman wrote:

Yeah, I get thatI don't understand why you would create this  
void section just to display a footer view when you could simply  
display the footer view on a section that actually has rows. Since  
you said you're doing this in the middle of the table, I'm assuming  
there's a section with rows directly above where you're doing this,  
and that seems like a more logical place for the footer view.




___

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

Please do not post admin requests or moderator comments to the list.
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: iPhone: How to show another view on UITableView

2009-10-31 Thread Fritz Anderson

Absolutely. I'm glad (and chagrinned) it was drawn to my attention.

— F

On 31 Oct 2009, at 10:48 AM, Luke the Hiesterman wrote:

 As for the original poster's question about putting a view at the  
bottom of the table, though, there's no doubt that the  
tableFooterView property is the way to go.


___

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

Please do not post admin requests or moderator comments to the list.
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


ToolBar Item problem

2009-10-31 Thread Michael de Haan

Hi all,
I have reached a dead-end. A search as best I could of the archives  
and google does not throw light on this. (My favorite cocoabuilder  
seems to be on vacation :-)  )


According to the documentation: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/IB_UserGuide/EditingNibFileObjects/EditingNibFileObjects.html 
 under "Customizing the Contents of a Toolbar"


once a toolbar Item is added to the customization sheet  and  
highlighed, the inspector window's  Image Name, Label and Pal. Label  
are enabled. ( I do show one difference from the documentation, in  
that only "Autovalidates" is checked in my rendition). In my case,  
**none** of these attributes is enabled.  I have tried to see if  
adding the toolbar to the top-level of the nib-file and customizing it  
**before** adding the toolbar icon( in the nib)   to the window, but  
the same results occur.  ( I did this as there is a note that  
**could** possibly be interpreted this way).


I am hoping this is some checkmark somewhere that needs to be checked/ 
unchecked, but so far nothing has helped.


Thanks in advance.



___

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

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

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

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


Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Richard Somers

I have custom data caches associated with a managed object.

The documentation states didTurnIntoFault "method may be used to clear  
out custom data caches". So far so good.


I was creating custom data caches in awakeFromFetch (or  
awakeFromInsert) until I realized that awakeFromFetch does not  
participate in undo. The documentation confirms that "change  
processing is explicitly disabled around this method".


So Apple provides a way to remove custom data caches associated with a  
managed object but no way to create them.


Any thoughts on this?

Richard

___

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

Please do not post admin requests or moderator comments to the list.
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 bindings problem

2009-10-31 Thread Squ Aire

Thanks, why didn't I think of that? Sounds obvious once known :)
Thanks also for the transient property tip, will keep it at the back of my head 
for future use. In this case however I will go with the method as it is more 
suitable in my particular case.


> >Thanks for the tip. However, the value transformer idea did not work.
> >Even though it ended up showing exactly the same date (the value
> >transformer just strips the time from the date) for each row, selecting
> >multiple rows still leaves us with "Multiple values" in the text field.
> 
> Instead of a value transformer, in your NSManagedObject subclass add a
> new method called 'timelessDate' which returns a modified version of
> your 'date' attribute.  Then bind your table to 'timelessDate' instead
> of 'date'.  Also use keyPathsForValuesAffectingValueForKey to indicate
> that 'timelessDate' depends on 'date'.
  
_
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010___

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

Please do not post admin requests or moderator comments to the list.
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: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Dave Fernandes
You can create a custom accessor and re-create the cache if it is not  
present when the accessor is called.


On 2009-10-31, at 12:05 PM, Richard Somers wrote:


I have custom data caches associated with a managed object.

The documentation states didTurnIntoFault "method may be used to  
clear out custom data caches". So far so good.


I was creating custom data caches in awakeFromFetch (or  
awakeFromInsert) until I realized that awakeFromFetch does not  
participate in undo. The documentation confirms that "change  
processing is explicitly disabled around this method".


So Apple provides a way to remove custom data caches associated with  
a managed object but no way to create them.


Any thoughts on this?

Richard

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%40utoronto.ca

This email sent to dave.fernan...@utoronto.ca


___

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

Please do not post admin requests or moderator comments to the list.
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: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Jim Correia
On Sat, Oct 31, 2009 at 12:05 PM, Richard Somers
 wrote:

> The documentation states didTurnIntoFault "method may be used to clear out
> custom data caches". So far so good.
>
> I was creating custom data caches in awakeFromFetch (or awakeFromInsert)
> until I realized that awakeFromFetch does not participate in undo. The
> documentation confirms that "change processing is explicitly disabled
> around this method".
>
> So Apple provides a way to remove custom data caches associated with a
> managed object but no way to create them.

Typically you set up the baseline value in -awakeFromFetch.

Is there a specific reason you need this to be undoable?

Jim
___

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

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

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

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


Re: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Richard Somers

On Oct 31, 2009, at 10:12 AM, Jim Correia wrote:


Typically you set up the baseline value in -awakeFromFetch.

Is there a specific reason you need this to be undoable?


When the managed object is removed, didTurnIntoFault is called and the  
custom data caches are deleted. When the user does an undo on this  
action the managed object is fetched but awakeFromFetch is never  
called so the custom data caches are now missing.


Richard

___

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

Please do not post admin requests or moderator comments to the list.
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: Core Data Managed Object with Custom Data Caches

2009-10-31 Thread Jim Correia

On Oct 31, 2009, at 12:25 PM, Richard Somers wrote:


On Oct 31, 2009, at 10:12 AM, Jim Correia wrote:


Typically you set up the baseline value in -awakeFromFetch.

Is there a specific reason you need this to be undoable?


When the managed object is removed, didTurnIntoFault is called and  
the custom data caches are deleted. When the user does an undo on  
this action the managed object is fetched but awakeFromFetch is  
never called so the custom data caches are now missing.


On 10.5 and earlier, you’ll have to re-create your data caches in an  
on-demand accessor.


On 10.6 and later you can use -awakeFromSnapshotEvents: to re- 
establish them.


Ji



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: Double-clicking a screensaver

2009-10-31 Thread Gabriel Zachmann

How old is "old"? Have you updated the project to create a universal
binary? Snow Leopard is Intel-only, so its screen saver app isn't


Sorry, about not writing more details.

Well, the project is about 3-4 years old, and I have upgraded it with  
new XCode versions.


Currently, I am compiling for 10.6 (intel) and 10.5 (intel & ppc).

Here are my (relevant, I hope) project settings:

Cocoa.framework
ScreenSaver.framework
Foundation.framework
ScriptingBridge.framework
QuartzCore.framework
ApplicationServices.framework
OpenGL.framework

923089610858F7E70094E243 /* Executable */ = {
isa = PBXNativeTarget;
buildConfigurationList = 92B139FA08771E5E00D2A6D9 /*  
Build configuration list for PBXNativeTarget "Executable" */;

buildPhases = (
923089640858F7E70094E243 /* Resources */,
923089670858F7E70094E243 /* Sources */,
923089690858F7E70094E243 /* Frameworks */,
9230896C0858F7E70094E243 /* Rez */,
92C42D620B9D774F0054FE4B /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = Executable;
productInstallPath = "$(HOME)/Library/ScreenSavers";
productName = ArtSaver;
productReference = 9230896E0858F7E70094E243 /*  
ArtSaver.saver */;

productType = "com.apple.product-type.bundle";


92B139FC08771E5E00D2A6D9 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = "";
FRAMEWORK_SEARCH_PATHS = "";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LIBRARY_SEARCH_PATHS = "";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = ArtSaver;
SECTORDER_FLAGS = "";
VERSIONING_SYSTEM = "";
WARNING_CFLAGS = (
"-Wmost",
"-Wno-four-char-constants",
"-Wno-unknown-pragmas",
);
WRAPPER_EXTENSION = saver;
ZERO_LINK = NO;
};
name = Deployment;


92B13A0008771E5E00D2A6D9 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
"FRAMEWORK_SEARCH_PATHS[sdk=macosx10.5][arch=*]" = / 
Developer/SDKs/MacOSX10.5.sdk;
"FRAMEWORK_SEARCH_PATHS[sdk=macosx10.6][arch=*]" = / 
Developer/SDKs/MacOSX10.6.sdk;

GCC_C_LANGUAGE_STANDARD = c99;
"GCC_ENABLE_OBJC_GC[sdk=macosx10.6][arch=*]" =  
supported;

GCC_FAST_OBJC_DISPATCH = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = 3;
MACOSX_DEPLOYMENT_TARGET = 10.5;
"MACOSX_DEPLOYMENT_TARGET[sdk=macosx10.6][arch=*]" =  
10.6;

SDKROOT = macosx10.5;
"SDKROOT[arch=x86_64]" = macosx10.6;
};
name = Deployment;



Is there anything wrong?


Best regards,
Gabriel.





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

API for show event time as free/busy (iCal)

2009-10-31 Thread Nava Carmon

Hi,

A new feature was introduced in iCal for Snow Leopard - show time as  
free/busy. I CANNOT find the according API in CalendarStore framework.
DOES anybody know about the existence of such an API? Seems headers  
weren't updated from 10.5 to 10.6. If there another list, that might  
know the answer, please give a reference. Googling on this doesn't  
yield any results I'm lost on this.


Please help!

Thanks,

Nava
___

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

Please do not post admin requests or moderator comments to the list.
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: 64 bit cocoa version of HIViewFlashDirtyArea() ?

2009-10-31 Thread David M. Cotter
hmm, that seems to be what i'm looking for, except i want to flash  
only once, and i want to be able to turn it on and off during the time  
the app is already launched.  any ideas about that?
if not, perhaps i need to use the "-getRectsBeingDrawn:count:" method  
and do it myself


On Oct 30, 2009, at 7:41 PM, Ben Haller wrote:


On 30-Oct-09, at 9:17 PM, Sean McBride wrote:


David M. Cotter (m...@davecotter.com) on 2009-10-30 9:04 PM said:


anyone have some sample code for a function that does the equivalent
of HIViewFlashDirtyArea() ?

i'd like to have this i the debug version of my program to help  
flush

out inefficient invalidating.

or:

how do i fetch the invalid "region" of an NSWindow* ?


Never tried, but... if I search for "flash" in this doc:



I think NSShowAllDrawing might help you.


 I just tried "-NSShowAllDrawing YES" in "arguments to be passed on  
launch" and it worked quite nicely.  The only odd thing is that it  
seems to flash each view two times for every one time it gets  
drawn.  I verified by other means (let's hear it for NSLog!) that a  
given view was in fact getting called to draw only once, but was  
flashing twice.  I don't know if there's a good reason for that  
behavior or not.  :->  Apart from that issue, it worked quite nicely.

 Thanks for the tip, Sean.

Ben Haller
Stick Software



___

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

Please do not post admin requests or moderator comments to the list.
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: 64 bit cocoa version of HIViewFlashDirtyArea() ?

2009-10-31 Thread Kyle Sluder
On Sat, Oct 31, 2009 at 10:55 AM, David M. Cotter  wrote:
> hmm, that seems to be what i'm looking for, except i want to flash only
> once, and i want to be able to turn it on and off during the time the app is
> already launched.  any ideas about that?
> if not, perhaps i need to use the "-getRectsBeingDrawn:count:" method and do
> it myself

Have you tried using Quartz Debug?

--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: nonsense from cellFrameAtRow:column: on Leopard

2009-10-31 Thread Matt Neuburg
Solved my own problem, which had nothng to do with what I thought it had to
do with. The source of the difficulty is actually this: On Snow Leopard,
[self controlView] works - it points from the NSCell to the NSMatrix that
contains it. On Leopard, it doesn't work.

I don't know why it doesn't work on Leopard, but I don't really care; I have
another way to get a reference to the NSMatrix, and that's all I need, so
now my code works fine on both Leopard and Snow Leopard.

Sorry for the misstatement of the problem. m.

On Fri, 30 Oct 2009 22:06:09 -0700, Matt Neuburg  said:
>I'm building on Snow Leopard but I want to run on Leopard too. I'm calling
>NSMatrix's cellFrameAtRow:column: from an NSCell, like this:
>
>NSInteger row, col;
>[(CardMatrix*)[self controlView] getRow:&row column:&col ofCell:self];
>NSRect myFrame = [
>  (CardMatrix*)[self controlView] cellFrameAtRow:row column:col];
>
>I can see from logging that this gives the right answers on my SnowLeopard
>machine. For example, the NSRect of cell (0,0) is reported as
>
>{{0, 0}, {130.5, 167.25}}
>
>But on the Leopard machine it's reported as
>
>{{608, 0}, {20, 0}}
>
>I believe things really are going wrong (i.e. it isn't just the way I'm
>logging) because myFrame causes Bad Things to happen later on in the code on
>the Leopard machine. On Snow Leopard everything's fine.
>
>I have a vague feeling that all this is due to something about 64-bit, and
>maybe NSRect vs. CGRect, but what? Do I need to do some kind of tricky
>conditional compilation and cast somehow? Do I need to tweak my build
>settings? (I tried building 32-bit only but it made things worse.) Thx.


-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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

Please do not post admin requests or moderator comments to the list.
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: Double-clicking a screensaver

2009-10-31 Thread Nick Zitzmann


On Oct 31, 2009, at 10:37 AM, Gabriel Zachmann wrote:


Is there anything wrong?


Why do you have two different Deployment configurations with vastly  
different settings?


Nick Zitzmann




___

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

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

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

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


Re: Double-clicking a screensaver

2009-10-31 Thread Kyle Sluder
On Sat, Oct 31, 2009 at 11:46 AM, Nick Zitzmann  wrote:
> Why do you have two different Deployment configurations with vastly
> different settings?

One is probably the project, the other is the target.

--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: Double-clicking a screensaver

2009-10-31 Thread Gabriel Zachmann


One is probably the project, the other is the target.


You can see the whole project file at 
http://zach.in.tu-clausthal.de/tmp/project.pbxproj

Best regards,
Gabriel.




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: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)

2009-10-31 Thread Russell Finn
On Wed, Oct 28, 2009 at 8:27 PM, Graham Cox  wrote:
>
> On 29/10/2009, at 7:02 AM, Russell Finn wrote:
>
>> I'm pretty sure you got this backwards -- it's ObjectsAndKeys, not
>> KeysAndObjects:
>>
>> attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
>>      [NSFont fontWithName:@"Helvetica" size:75],  NSFontAttributeName,
>>      NSColor redColor], NSForegroundColorAttributeName,
>>      shadow, NSShadowAttributeName,
>>      nil];
>>
>
> No, the OP is right. Check again:
>
>> initWithObjectsAndKeys:
>> Initializes a newly allocated dictionary with entries constructed from the
>> specified set of values and keys.
>>
>> - (id)initWithObjectsAndKeys:(id)firstObject , ...
>>
>> Parameters
>> firstObject
>> The first value to add to the new dictionary.
>>
>> ...
>> First the key for firstObject, then a null-terminated list of alternating
>> values and keys. If any key is nil, an NSInvalidArgumentException is raised.

Right.  But Jens had had:

> attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
>NSFontAttributeName, [NSFont fontWithName:@"Helvetica" size:75],
>NSForegroundColorAttributeName, NSColor redColor],
>NSShadowAttributeName, shadow,
>nil];

-- i.e. key, object, key, object; this is what I tried to correct this
in my post, as shown above.  (I should have explicitly noted I was
posting a modified version of the original code fragment.)

> Usually when coming up with a method name, it should self-document as far as
> possible. These nil-terminated lists don't fully do that, but at least the
> order of words gives you a hint:
>
> initWithObjects(first)andKeys(second)
>
> Therefore the list is ordered object, key, object, key

Right.  But that's not what Jens had posted, which is why I jumped in.
 (Note that his $dict utility function does have object, key, object,
key.)

-- Russell
___

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

Please do not post admin requests or moderator comments to the list.
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: nonsense from cellFrameAtRow:column: on Leopard

2009-10-31 Thread Jim Correia

On Oct 31, 2009, at 2:34 PM, Matt Neuburg wrote:

Solved my own problem, which had nothng to do with what I thought it  
had to
do with. The source of the difficulty is actually this: On Snow  
Leopard,
[self controlView] works - it points from the NSCell to the NSMatrix  
that

contains it. On Leopard, it doesn't work.


See the section titled "NSCell controlView property changes” in the  
Snow Leopard AppKit release notes.


Jim

___

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

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

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

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


Re: nonsense from cellFrameAtRow:column: on Leopard

2009-10-31 Thread matt neuburg
On Sat, October 31, 2009 12:49 pm, Jim Correia wrote:
> On Oct 31, 2009, at 2:34 PM, Matt Neuburg wrote:
>
>> Solved my own problem, which had nothng to do with what I thought it
>> had to
>> do with. The source of the difficulty is actually this: On Snow
>> Leopard,
>> [self controlView] works - it points from the NSCell to the NSMatrix
>> that
>> contains it. On Leopard, it doesn't work.
>
> See the section titled "NSCell controlView property changes” in the
> Snow Leopard AppKit release notes.

Spot on, thanks! m.


___

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

Please do not post admin requests or moderator comments to the list.
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


Rounded rect overlap in collection view

2009-10-31 Thread PCWiz
I'm using AMCollectionView (Code - harmless Cocoa, clone of  
NSCollectionView) to display a collection of views. In my prototype  
view subclass I have this:


- (void)drawRect:(NSRect)dirtyRect
{
[[NSColor whiteColor] set];
	NSBezierPath *path = [NSBezierPath  
bezierPathWithRoundedRect:dirtyRect xRadius:6.0 yRadius:6.0];

[path stroke];
[super drawRect:dirtyRect];
}

Just some simple drawing code to draw a rounded border around the  
view. I end up with this:


http://img263.imageshack.us/img263/5651/screenshot20091031at202.png

The borders seem to be overlapping each other. I tried adjusting the y  
origin and height of the view but I cannot fix the overlap. What am I  
doing wrong here?

___

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

Please do not post admin requests or moderator comments to the list.
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: Rounded rect overlap in collection view

2009-10-31 Thread Kyle Sluder

On Oct 31, 2009, at 1:10 PM, PCWiz  wrote:


- (void)drawRect:(NSRect)dirtyRect
{
   [[NSColor whiteColor] set];
   NSBezierPath *path = [NSBezierPath  
bezierPathWithRoundedRect:dirtyRect xRadius:6.0 yRadius:6.0];


You're rounding the wrong rect here. You want the whole view frame,  
not the dirty rect (whatever the drawing machinery has decided is the  
smallest rect you need to draw).


--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: Rounded rect overlap in collection view

2009-10-31 Thread PCWiz

I tried drawing a rect around the whole frame like so:

- (void)drawRect:(NSRect)dirtyRect
{
	NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:[self  
frame] xRadius:6.0 yRadius:6.0];

[[NSColor whiteColor] set];
[path stroke];
[super drawRect:dirtyRect];
}

..and I get the same result

On 2009-10-31, at 2:54 PM, Kyle Sluder wrote:


On Oct 31, 2009, at 1:10 PM, PCWiz  wrote:


- (void)drawRect:(NSRect)dirtyRect
{
  [[NSColor whiteColor] set];
  NSBezierPath *path = [NSBezierPath  
bezierPathWithRoundedRect:dirtyRect xRadius:6.0 yRadius:6.0];


You're rounding the wrong rect here. You want the whole view frame,  
not the dirty rect (whatever the drawing machinery has decided is  
the smallest rect you need to draw).


--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: 64 bit cocoa version of HIViewFlashDirtyArea() ?

2009-10-31 Thread David M. Cotter
the point is i want to programmatically turn it on and off via my  
app's "debug" menu, so testers can see it without having to install  
the dev tools


On Oct 31, 2009, at 11:23 AM, Kyle Sluder wrote:

On Sat, Oct 31, 2009 at 10:55 AM, David M. Cotter  
 wrote:
hmm, that seems to be what i'm looking for, except i want to flash  
only
once, and i want to be able to turn it on and off during the time  
the app is

already launched.  any ideas about that?
if not, perhaps i need to use the "-getRectsBeingDrawn:count:"  
method and do

it myself


Have you tried using Quartz Debug?

--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: Double-clicking a screensaver

2009-10-31 Thread Gabriel Zachmann
Can you post the project settings and all of the configurations?  
Even better, can you open the source and post the code to your  
favorite open source hosting site (if you haven't already done so)?


Sure, you can download the complete source here:

  http://zach.in.tu-clausthal.de/software/ArtSaver_source.dmg

Thanks a lot in advance.

Regards,
Gabriel.




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

Asynchronous downloading again

2009-10-31 Thread DKJ
I've got a series of data files that my app needs to download before  
the user can do anything. Because I want to have an activity indicator  
spinning while the download is in progress, I have to do asynchronous  
downloading. (Thanks to the list members who guided me to that  
epiphany.) So I'm going to use the NSURLConnection class to do the  
download.


Now I'm wondering if this will work: Suppose I want to download file1  
and file2. (Again, the user can do nothing until both files are  
downloaded.) I use NSURLConnection to download file1. Then in the  
connectionDidFinishLoading delegate method, I do a synchronous  
download of file2, with something like stringWithContentsOfURL.


My idea is that the synchronous download of file2 would be taking  
place in a separate thread from the one that started the asynchronous  
download of file1. So, from the first thread's point of view, file2 is  
being downloaded asynchronously too.


Am I on the right track here? If so, it sure would simplify  
downloading all those files.


dkj

P.S. It's time for my semi-anual global "Thank You" to all those list  
members who've responded to my queries over the last six months.


THANK YOU!
___

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

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

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

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


Re: Rounded rect overlap in collection view

2009-10-31 Thread Graham Cox


On 01/11/2009, at 8:17 AM, PCWiz wrote:


I tried drawing a rect around the whole frame like so:

- (void)drawRect:(NSRect)dirtyRect
{
	NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:[self  
frame] xRadius:6.0 yRadius:6.0];

[[NSColor whiteColor] set];
[path stroke];
[super drawRect:dirtyRect];
}

..and I get the same result



You're flailing. The scattergun approach never works for coding. Look  
up the right documentation: "Cocoa Drawing Guide", and also the  
supporting documentation for NSView.


1. the  passed is exactly what it implies.

2. the rect you need to be drawing is [self bounds] which is the  
locally adjusted frame rectangle. Note that [self frame] is typically  
(but not always) the same size but has a different location. If you  
are programming with views you definitely need to know the difference.


3. There's no need to call [super drawRect] as it doesn't do anything  
(unless this is a sub-subclass of NSView and you know different).



--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: Seemingly Documentation confusion?

2009-10-31 Thread Ken Thomases

On Oct 30, 2009, at 1:59 AM, Scott Anguish wrote:


I’ve fixed these two docs. You’ll see them around turkey time.


... by which he presumably means the U.S. Thanksgiving holiday,  
November 26th this year.  (In case anybody was confused. :)


Cheers,
Ken

___

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

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

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

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


Re: Double-clicking a screensaver

2009-10-31 Thread Bill Bumgarner
Related, I recently ported a handful of [really ancient NeXTSTEP] screensavers 
to Snow Leopard, including the ability to run on both 64 bit GC'd and 32 bit 
non-GC'd Snow Leopard or Leopard (ppc or i386).

http://www.friday.com/bbum/2009/10/19/spiroscales-source-for-snow-leopard-available/
http://www.friday.com/bbum/2009/10/25/dphyllotaxis/

The source -- including project files -- can be found here:

http://svn.red-bean.com/bbum/trunk/ScreenSavers/
svn co http://svn.red-bean.com/bbum/trunk/ScreenSavers/

(SpiroScalyLizardSaver contains the xcode project, etc...)

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


Re: Asynchronous downloading again

2009-10-31 Thread Roland King
The whole point of doing things asynchronously is you don't have to  
care about waiting for one thing to do another thing, just set up two  
NSURLConnections and start them going at the same time. So unless you  
need some information from file 1 before starting on file 2


	connection1 = [ [ NSURLConnection alloc ] initWithRequest:request1  
delegate:self ];
	connection2 = [ [ NSURLConnection alloc ] initWithRequest:request2  
delegate:self ];


where connection1 and connection2  are instance variables of your  
class. Then when you get the callbacks in your delegate just look to  
see which connection they are for and deal with them appropriately.  
When they are both finished downloading (and don't forget to release  
the NSURLConnection(s) when they are) you start doing whatever else it  
is you want to do.


Don't understand why you keep trying to go back to synchronous  
downloads and you're talking about threads, who says NSURLConnection  
uses threads at all. Apart from that, if you read the documentation  
for NSURLConnection it tells you all delegate calls take place on the  
thread you initiated the download on so, no, even if you did what you  
suggested you'd just block the main thread with the download of file2.


On 01-Nov-2009, at 6:34 AM, DKJ wrote:

I've got a series of data files that my app needs to download before  
the user can do anything. Because I want to have an activity  
indicator spinning while the download is in progress, I have to do  
asynchronous downloading. (Thanks to the list members who guided me  
to that epiphany.) So I'm going to use the NSURLConnection class to  
do the download.


Now I'm wondering if this will work: Suppose I want to download  
file1 and file2. (Again, the user can do nothing until both files  
are downloaded.) I use NSURLConnection to download file1. Then in  
the connectionDidFinishLoading delegate method, I do a synchronous  
download of file2, with something like stringWithContentsOfURL.


My idea is that the synchronous download of file2 would be taking  
place in a separate thread from the one that started the  
asynchronous download of file1. So, from the first thread's point of  
view, file2 is being downloaded asynchronously too.


Am I on the right track here? If so, it sure would simplify  
downloading all those files.


dkj

P.S. It's time for my semi-anual global "Thank You" to all those  
list members who've responded to my queries over the last six months.


   THANK YOU!
___

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

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

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

This email sent to r...@rols.org


___

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

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

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

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


Re: SOLVED NSTextFieldCell subclass hobbles the field editor

2009-10-31 Thread Jonathan Fewtrell
I had forgotten to call super in copyWithZone:. Thanks to Andreas  
Schwarz for putting me right.


On 29 Oct 2009, at 16:00, Jonathan Fewtrell wrote:

I have a subclass of NSTextFieldCell as the dataCell of an  
NSTableColumn. When I click on the cell to edit the text, the field  
editor appears, but instead of displaying the text that was in the  
cell it displays the word 'Field' and cannot be edited.


___

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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread DKJ
All of the files have to be downloaded before the app can do anything.  
I get the connectionDidFinishLoading delegate method of my one and  
only NSURLConnection to call a downloadFinished method at the end of  
the synchronous downloads, so the app knows everything is in place and  
can start processing the files.


I was worried that having a download connection for each file would  
make it more complicated for the app to know when they were all  
finished.


And the main thread doesn't seem to be blocked, because my activity  
indicator is now spinning quite nicely during the download.



On 2009-10-31, at 18:02 , Roland King wrote:

The whole point of doing things asynchronously is you don't have to  
care about waiting for one thing to do another thing, just set up  
two NSURLConnections and start them going at the same time. So  
unless you need some information from file 1 before starting on file 2


	connection1 = [ [ NSURLConnection alloc ] initWithRequest:request1  
delegate:self ];
	connection2 = [ [ NSURLConnection alloc ] initWithRequest:request2  
delegate:self ];


where connection1 and connection2  are instance variables of your  
class. Then when you get the callbacks in your delegate just look to  
see which connection they are for and deal with them appropriately.  
When they are both finished downloading (and don't forget to release  
the NSURLConnection(s) when they are) you start doing whatever else  
it is you want to do.


Don't understand why you keep trying to go back to synchronous  
downloads and you're talking about threads, who says NSURLConnection  
uses threads at all. Apart from that, if you read the documentation  
for NSURLConnection it tells you all delegate calls take place on  
the thread you initiated the download on so, no, even if you did  
what you suggested you'd just block the main thread with the  
download of file2.


=
Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.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: Asynchronous downloading again

2009-10-31 Thread Kyle Sluder
On Sat, Oct 31, 2009 at 6:50 PM, DKJ  wrote:
> I was worried that having a download connection for each file would make it
> more complicated for the app to know when they were all finished.

Translation: "I don't know how to do it correctly, and therefore fear
it.  I want to stick to what I know."

You can overcome this fear; it's surprisingly easy to do.  All you
have to do is start writing the code, without concern that you're
doing it wrong.  Keep butting your head against it and eventually the
pattern will shine through.

This is a process with which I got very familiar while learning Cocoa.
 The intricacy of correct usage is intimidating, but the only way to
overcome it is to try.

--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: Asynchronous downloading again

2009-10-31 Thread DKJ
I'm still not getting this. Why go to the trouble of setting up four  
separate NSURLConnections when one will do the job? And at the same  
time give me a very simple way to know when all the data is in place?


If the files took a long time to download, I could see it. But these  
take less than 5 seconds, even with a completely synchronous download.


dkj

On 2009-10-31, at 19:01 , Kyle Sluder wrote:


On Sat, Oct 31, 2009 at 6:50 PM, DKJ  wrote:
I was worried that having a download connection for each file would  
make it

more complicated for the app to know when they were all finished.


Translation: "I don't know how to do it correctly, and therefore fear
it.  I want to stick to what I know."

You can overcome this fear; it's surprisingly easy to do.  All you
have to do is start writing the code, without concern that you're
doing it wrong.  Keep butting your head against it and eventually the
pattern will shine through.

This is a process with which I got very familiar while learning Cocoa.
The intricacy of correct usage is intimidating, but the only way to
overcome it is to try.

--Kyle Sluder


=
Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.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: Asynchronous downloading again

2009-10-31 Thread Roland King
So you've used the observation that your user interface element is  
animating a spin to decide that mixing synchronous and asynchronous  
calls is somehow causing things to happen on different threads; you're  
programming backwards. Also what you're doing here is making your app  
as slow as it can possibly be by ensuring your two files are  
downloaded serially instead of potentially at the same time, and as  
complicated as it can possibly be because you've mixed two different  
ways of accomplishing the same thing.


You can trivially use one delegate to manage both these downloads,  
have them happen at the same time and only call downloadFinished when  
both of them have finished, or if you have more than 2, all 3, or 4 or  
127 of them.


On 01-Nov-2009, at 9:50 AM, DKJ wrote:

All of the files have to be downloaded before the app can do  
anything. I get the connectionDidFinishLoading delegate method of my  
one and only NSURLConnection to call a downloadFinished method at  
the end of the synchronous downloads, so the app knows everything is  
in place and can start processing the files.


I was worried that having a download connection for each file would  
make it more complicated for the app to know when they were all  
finished.


And the main thread doesn't seem to be blocked, because my activity  
indicator is now spinning quite nicely during the download.



On 2009-10-31, at 18:02 , Roland King wrote:

The whole point of doing things asynchronously is you don't have to  
care about waiting for one thing to do another thing, just set up  
two NSURLConnections and start them going at the same time. So  
unless you need some information from file 1 before starting on  
file 2


	connection1 = [ [ NSURLConnection alloc ] initWithRequest:request1  
delegate:self ];
	connection2 = [ [ NSURLConnection alloc ] initWithRequest:request2  
delegate:self ];


where connection1 and connection2  are instance variables of your  
class. Then when you get the callbacks in your delegate just look  
to see which connection they are for and deal with them  
appropriately. When they are both finished downloading (and don't  
forget to release the NSURLConnection(s) when they are) you start  
doing whatever else it is you want to do.


Don't understand why you keep trying to go back to synchronous  
downloads and you're talking about threads, who says  
NSURLConnection uses threads at all. Apart from that, if you read  
the documentation for NSURLConnection it tells you all delegate  
calls take place on the thread you initiated the download on so,  
no, even if you did what you suggested you'd just block the main  
thread with the download of file2.


=
Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.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: Asynchronous downloading again

2009-10-31 Thread Roland King
The trouble? Since you must already have the NSURLRequests then you're  
talking about the difference between


[ [ NSURLConnection alloc ] initWithRequest:request delegate:self ]

vs

[ NSURLConnection sendSynchronousRequest:request returningResponse... ]

don't see the extra trouble here. And why are you now talking about 4  
NSURLConnections when you say you have 2 files? Using the delegate  
method also means you can put all your error handling in one place  
instead of having to deal with failures on the first file in the  
delegate method and failures for the second file download in the code.


To know when al your files are downloaded you just need to keep track  
of which requests have finished.



On 01-Nov-2009, at 10:20 AM, DKJ wrote:

I'm still not getting this. Why go to the trouble of setting up four  
separate NSURLConnections when one will do the job? And at the same  
time give me a very simple way to know when all the data is in place?


If the files took a long time to download, I could see it. But these  
take less than 5 seconds, even with a completely synchronous download.


dkj

On 2009-10-31, at 19:01 , Kyle Sluder wrote:


On Sat, Oct 31, 2009 at 6:50 PM, DKJ  wrote:
I was worried that having a download connection for each file  
would make it

more complicated for the app to know when they were all finished.


Translation: "I don't know how to do it correctly, and therefore fear
it.  I want to stick to what I know."

You can overcome this fear; it's surprisingly easy to do.  All you
have to do is start writing the code, without concern that you're
doing it wrong.  Keep butting your head against it and eventually the
pattern will shine through.

This is a process with which I got very familiar while learning  
Cocoa.

The intricacy of correct usage is intimidating, but the only way to
overcome it is to try.

--Kyle Sluder


=
Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.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


Firewall blocking check?

2009-10-31 Thread timm...@gmail.com
Does anyone know of a way to check programmatically if an app is being  
blocked by the firewall in 10.5 or 10.6? I know you could use ipfw or  
check the security plist in 10.4, but that doesn't work anymore. The  
only thing I could find is the com.apple.alf.plist, which can tell me  
if the firewall is on/off, and whether an application is allowed or  
blocked.


The problem is, command line apps without a bundleid (like the app I'm  
trying to check) do not show their name in the plist file. There is an  
"alias" NSData entry, but it doesn't seem to be a standard alias  
record. Does anyone know how to get the file path from this alias entry?


If there is a better way to check if the app is being blocked, please  
let me know.


Thanks!
Karl

___

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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread DKJ

On 2009-10-31, at 19:22 , Roland King wrote:
You can trivially use one delegate to manage both these downloads,  
have them happen at the same time and only call downloadFinished  
when both of them have finished, or if you have more than 2, all 3,  
or 4 or 127 of them.



What would be the best way to do this? Have the delegate count the  
connections as they finish? That is starting to sound more appealing.

___

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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread Roland King
that's one way. Or have a boolean for each one which says when it's  
been downloaded, or put all the connections in an NSArray or some kind  
of dictionary and take each one out as it completes and call your  
routine when the NSArray is empty (don't start any of the connections  
until they are all in the array to avoid any potential race  
condition). That's also entirely scalable and has the benefit that all  
your current connections are easily found so you can cancel them if  
you get an error on one of the other earlier connections and clean  
up .. you are handling errors right, URL downloads fail.


(The comment about the race condition is because I don't know if it's  
possible to get a connectionDidFailWithError: or  
connectionDidFinishLoading: synchronously with submitting the request  
or if you are guaranteed only to get any delegate callbacks only on  
the next run of the runloop, anyone know definitively?).


On 01-Nov-2009, at 10:34 AM, DKJ wrote:


On 2009-10-31, at 19:22 , Roland King wrote:
You can trivially use one delegate to manage both these downloads,  
have them happen at the same time and only call downloadFinished  
when both of them have finished, or if you have more than 2, all 3,  
or 4 or 127 of them.



What would be the best way to do this? Have the delegate count the  
connections as they finish? That is starting to sound more appealing.


___

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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread DKJ

On 2009-10-31, at 19:34 , Roland King wrote:
. And why are you now talking about 4 NSURLConnections when you say  
you have 2 files?



The 2-file example was a simplified case I posted when I was asking  
whether the method would work. I actually have half-a-dozen or so data  
files to download. (It can vary.)


I'm using the delegate to save the files to disk under different  
names, so the delegate has to know which filename to use for which  
connection. There's even a file that needs to be downloaded containing  
the names of other files that need to be downloaded.


That's why I was doing things like this in the delegate (after the  
initial received data was dealt with):


   url = [NSURL URLWithString:[baseURL  
stringByAppendingPathComponent:filename]];

   dataString = [NSString stringWithContentsOfURL:url ...];
   [dataString writeToFile:filename ...];

(I left out some parameters to make it easier to read.)

I'd be quite happy to do the whole thing synchronously: it's plenty  
fast enough. But I wanted my little activity spinner to display, even  
if it was only for a few seconds.


Any suggestions about how to do all of this with multiple  
NSURLConnections would be quite welcome. Elegant code is a worthwhile  
end in itself, even if there is no practical benefit in a particular  
case. 
___


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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread Claus Guttesen
> The 2-file example was a simplified case I posted when I was asking whether
> the method would work. I actually have half-a-dozen or so data files to
> download. (It can vary.)
>
>
> Any suggestions about how to do all of this with multiple NSURLConnections
> would be quite welcome. Elegant code is a worthwhile end in itself, even if
> there is no practical benefit in a particular
> case.___

Maby put the files in an array and traverse that array?

-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare

twitter.com/kometen
___

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

Please do not post admin requests or moderator comments to the list.
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: Asynchronous downloading again

2009-10-31 Thread Ken Thomases

On Oct 31, 2009, at 11:19 PM, DKJ wrote:

The 2-file example was a simplified case I posted when I was asking  
whether the method would work. I actually have half-a-dozen or so  
data files to download. (It can vary.)


I'm using the delegate to save the files to disk under different  
names, so the delegate has to know which filename to use for which  
connection. There's even a file that needs to be downloaded  
containing the names of other files that need to be downloaded.


Any suggestions about how to do all of this with multiple  
NSURLConnections would be quite welcome. Elegant code is a  
worthwhile end in itself, even if there is no practical benefit in a  
particular case.


There are a lot of approaches to this problem.  Here's one quick-and- 
dirty approach:


Have a single object which will serve as the delegate for all of the  
downloads.  It will actually be a controller for the whole process  
covering all of the downloads, so it knows what needs to be done when,  
in what order, how to use data from one download to initiate another,  
and when it's all finished.


It will have a mutable dictionary mapping from NSURLConnection  
instances to a bit of information you need to decide what to do when  
the download completes.  (NSURLConnection can't act as a dictionary  
key because it's not copyable.  You can use +[NSValue  
valueWithNonretainedObject:] as the keys or use NSMapTable instead of  
NSMutableDictionary.)


When delegate methods are invoked, you look up the information you  
need to decide what to do.  Which specific information is required for  
the delegate to make that decision is for you to design.  You could  
make it a dictionary with some data and then code your logic right  
there in the delegate method.  Or, you could make one value in the  
dictionary a selector string for another method to invoke on the  
delegate, passing some other values from the dictionary as arguments.


The action taken as a result of an event on a connection may involve  
adding new connections to the delegate's mapping table.


If the delegate method is one which indicates that the connection  
attempt has completed (connectionDidFail/Finish...), then that  
connection is removed from the table.


If there are no more connections in the table, then everything is  
complete and the delegate can take whatever next step is appropriate.   
If there are more connections, the delegate can start some or all of  
them.  (While running multiple simultaneous downloads is probably a  
good thing, you probably want to put some upper limit on the number  
running at once.  The delegate, being the overall controller of the  
downloads, would be in control of that.)



A more refined, less quick-and-dirty approach would be to create a  
custom class or two for the different types of downloads you perform.   
Each instance of those classes would own a single NSURLConnection and  
would be its delegate.  The classes would encapsulate the information  
and logic to know what to do with its downloaded data.  For example,  
there'd be one class for downloading the list of other files to  
download.  That one would create instances of another class, which  
would know about downloading an individual file.


There might still be a controller to manage the overall process.  It  
might limit the total number of simultaneous downloads.  It would also  
keep track of the active connections and thus know when the last  
completes, so it can trigger some final action.


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