Re: Access main window of other Applications

2011-04-08 Thread Eric Wing
On 4/7/11, Florian Pilz  wrote:
> Hi there!
>
> I'm looking for an easy way to access the main window of another
> Application, thus not my own. (The key window would be fine as well,
> if that is easier.)
> I already searched via Google to solve this task and I found the
> following solutions:
>
> * use AppleScript to perform this task and integrate it into the
> Objective-C/Cocoa App with a Wrapper class, i.e. NSAppleScript
> * use Quartz Window Services
> * use the NSAccessibility Protocol
>
> All three solution don't satisfy me, because a) I wanted to perform
> the task in Objective-C (not AppleScript),

ScriptingBridge will let you do AppleScript-things, but in
non-AppleScript languages. Apple officially supports ScriptingBridge
through Obj-C, PyObjC, and RubyCocoa, though any thing that binds to
Obj-C can access ScriptingBridge too (such as my LuaCocoa).


-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___

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

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

Help/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: Localized sorting of a Core Data entity

2011-04-08 Thread Ray
First: Quincey, Dado, Chase, WT, thanks for your comments, much appreciated!


On Apr 7, 2011, at 6:53 PM, Quincey Morris wrote:

> On Apr 7, 2011, at 03:06, Ray wrote:
> 
>> Right, I tried something like this earlier, but when I use
>> 
>> - (NSString*) localizedName {
>>  return NSLocalizedString (self.name, nil);
>> }
>> 
>> I get an exception:
>> 
>> Terminating app due to uncaught exception 'NSInvalidArgumentException', 
>> reason: 'keypath localizedName not found in entity > id=1>'...
> 
> I don't see anything in the documentation for the fetch sort descriptors that 
> says they have to specify a Core Data property, rather than a custom or 
> derived property, although perhaps that is the problem. You didn't use this 
> key somewhere else, like in the fetch predicate, by any chance?


Dado wrote:

> "The SQL store, on the other hand, compiles the predicate and sort
> descriptors to SQL and evaluates the result in the database itself. This is
> done primarily for performance, but it means that evaluation happens in a
> non-Cocoa environment, and so sort descriptors (or predicates) that rely on
> Cocoa cannot work." [1]
> 
> [1]
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdPersistentStores.html

I think this nails down the problem. I will have to rethink my approach. I was 
hoping to be able to resort to other solutions than what one would do with 
"databases" normally, examples here:




(I just glanced through them briefly, btw.)

Anyway, I will post my solution, if any ;)

Thanks again,
- Ray.

___

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

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

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

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


Re: Access main window of other Applications

2011-04-08 Thread Peter Lübke


Am 07.04.2011 um 17:01 schrieb Florian Pilz:


Hi there!

I'm looking for an easy way to access the main window of another
Application, thus not my own. (The key window would be fine as well,
if that is easier.)
I already searched via Google to solve this task and I found the
following solutions:

* use AppleScript to perform this task and integrate it into the
Objective-C/Cocoa App with a Wrapper class, i.e. NSAppleScript
* use Quartz Window Services
* use the NSAccessibility Protocol

All three solution don't satisfy me, because a) I wanted to perform
the task in Objective-C (not AppleScript)

There's nothing bad about using Cocoa NSAppleScript in a Cocoa app.
Presumed the target app is scriptable.

(Apple Script:)
tell application ""
set theWindow to window 1
end tell


, b) the Quartz API looks
complicated and inappropriate (maybe I'm wrong - feel free to correct
me) and



c) I couldn't find any examples on using the NSAccessibility
protocol to retrieve the main window,

kAXMainWindowAttribute


not mentioning the discomfort
that the user may activate access to accessibility features first.


Agreed.

The answer depends on your goal. Which information do you need about  
the window? Do you want to change its properties?


- Peter
___

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

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

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

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


Re: How To Increment CALayer Retain Count?

2011-04-08 Thread Mike Abdullah

On 7 Apr 2011, at 21:44, Jeffrey Walton wrote:

> On Thu, Apr 7, 2011 at 8:30 AM, Mike Abdullah  
> wrote:
> 
>> Have you tested using the Zombies Instrument?
> I believe so. The executable's environment is "NSZombieEnable = YES"
> and "NSAutoreleaseFreedObjectCheckEnabled = YES".

Use Instruments; it will give you far more detailed information.

___

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

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

Help/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: diable localization

2011-04-08 Thread Georg Seifert
Hi,

Many thanks. That worked perfectly. 

I need this to allow my users to disable localization.

I use this:

- (IBAction) setDisableLocalization:(id) sender {
if ([sender state] == NSOnState) {
[[NSUserDefaults standardUserDefaults] setObject:[NSArray 
arrayWithObject:@"en"] forKey:@"AppleLanguages"];
}
else {
[[NSUserDefaults standardUserDefaults] 
removeObjectForKey:@"AppleLanguages"];
}
}

After a restart all is fine.

Best
Georg

Am 07.04.2011 um 23:58 schrieb Sean McBride:

> On Wed, 6 Apr 2011 09:43:58 +0200, Felix Franz said:
> 
>>> I what to give my users the possibility to disable the localization of
>> my app. Is there a way to tell the system (NSBundle?) to always load the
>> english nibs?
>> 
>> Just read http://homepage.mac.com/mmalc/Stepwise/Internationalization/
>> it mentions the command line switch:
>> 
>> $ /Applications/TextEdit.app/Contents/MacOS/TextEdit -AppleLanguages
>> "(Spanish)"
>> 
>> this is a normal default, so
>> 
>> $ defaults write com.apple.TextEdit AppleLanguages "(Spanish)"
>> 
>> should work, or set the argument/default inside the main function before
>> calling NSApplicationMain
> 
> In Xcode, you can also pass -AppleLanguages as an argument to your
> executable.  This lets you debug in any language, regardless of your
> preferred languages in System Prefs.
> 
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
> 
> 

___

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

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

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

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


Re: Access main window of other Applications

2011-04-08 Thread Bill Cheeseman

On Apr 7, 2011, at 11:01 AM, Florian Pilz wrote:

> c) I couldn't find any examples on using the NSAccessibility
> protocol to retrieve the main window, not mentioning the discomfort
> that the user may activate access to accessibility features first.


The NSAccessibility protocol is intended for use by applications that want to 
make themselves accessible, so that is not what you want.

To write a so-called "assistive application" that can access the UI elements of 
another application, use the Accessibility API. It is documented in the 
"Accessibility (ApplicationServices/‍HIServices) Reference"document, and also 
look for documentation listed in "Accessibility Overview." There are two sample 
code packages available from Apple, only one of which I remember: 
UIElementInspector. This is a C API, not Objective-C, but once you've studied 
the sample code you'll see that it is relatively easy to adapt to it and to 
incorporate it into a Cocoa application.

The Accessibility API does normally require the user to turn on the "Enable 
Access for Assistive Devices" setting in the Universal Access pane of System 
Preferences. Apple requires this in order to force the user to authenticate for 
security reasons, and that's just the way it is. Most developers test whether 
accessibility is enabled (using one of the Accessibility API functions for that 
purpose), and then if necessary include in their applications a dialog that 
tells the user to turn it on and open the Universal Access pane for them.

In my applications, I put up an authentication dialog myself and, after the 
user enters name and password, make my application "trusted" by the 
Accessibility API so that it is not necessary to turn on the global setting. 
This is more convenient for the user, but it is very complicated to code 
because it requires one or two small helper applications embedded in your 
application package, one of which must (very briefly) run as root. Also, if you 
use this "trusted" feature of the Accessibility API, your application will not 
be eligible for the Mac App Store.

-- 

Bill Cheeseman - b...@cheeseman.name

___

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

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

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

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


Re: NSWorkspaceWillPowerOffNotification not working with Qt Cocoa Mac Application

2011-04-08 Thread John C. Randolph


On Apr 7, 2011, at 11:34 PM, manoj wrote:


I am working on Mac application using Qt Cocoa.
Please help me to figure out what is the difference between two.


You'll have to ask Nokia.

-jcr
___

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

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

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

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


Display a "Red frame" on the screen

2011-04-08 Thread eveningnick eveningnick
Hello
I have two monitors attached to the computer, and when i click in
"System Preferences/Displays Preferences" on the "display" image
(Display arrangement tab), the screen of the clicked "scematic
monitor's image" monitor is being surrounded by a red frame.

How could i do something like this from my application? I don't need
the red frame around the whole screen, but i would like to have some
area on the screen. Is it possible to do using some kind of API?
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: Can an image be "rejected" by CALayer?

2011-04-08 Thread Matt Neuburg
On Wed, 06 Apr 2011 18:44:04 +0800, Gabriel Zachmann  
said:
>I am creating CA layers like so:
>
>CALayer * imgLayer = [CALayer layer];
>imgLayer.contents  = (id) image;   
>imgLayer.contentsGravity   = kCAGravityResizeAspect;
>imgLayer.delegate  = nil;
>imgLayer.opacity   = 1.0;  
>imgLayer.position  = CGPointMake( drawRect_.size.width/2.0, 
> drawRect_.size.height/2.0 );
>imgLayer.anchorPoint   = CGPointMake( 0.5, 0.5 );
>imgLayer.zPosition = -1.0; 
>
>Now, sometimes, the image does not get displayed (most images do get 
>displayed).=

What is "image"? If it is not a CGImageRef, setting the layer's contents will 
fail *silently*. I wish I had a nickel for every time I assigned a UIImage to a 
layer's contents and then wasted a day trying to figure out why I couldn't see 
the layer in the interface m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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

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

Help/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: Two Applications Sharing Same Core Data Database

2011-04-08 Thread Carter R. Harrison

On Apr 7, 2011, at 7:04 PM, Carter R. Harrison wrote:

> 
> On Apr 7, 2011, at 6:38 PM, Nick Zitzmann wrote:
> 
>> 
>> On Apr 7, 2011, at 4:24 PM, Carter R. Harrison wrote:
>> 
>>> I really appreciate all of your help.  I gave your suggestion a shot and 
>>> I've run into problems.  Here's what happens.
>>> 
>>> 1. I create a new NSManagedObject in my main application.  It gets inserted 
>>> into the context.
>>> 2. I save the context.  I can see the persistent store update in a text 
>>> editor (its an XML store).
>>> 3. I send a distributed notification with the NSManagedObject's ObjectID.
>>> 4. My background application consumes the notification and uses the object 
>>> ID to get an NSManagedObject (using [NSManagedObjectContext objectWithID:]. 
>>>  This produces an NSManagedObject that is a fault.
>>> 5. I try to fire the fault by using [NSManagedObject valueForKey:].
>>> 6. Step 5 results in an exception "CoreData could not fulfill a fault for 
>>> '0x1001029e0 
>>> '"
>>> 
>>> I'm not sure I understand why this is happening.  If the object is truly a 
>>> fault then shouldn't Core Data go back to the persistent store to find the 
>>> object?
>> 
>> I think I've seen this before... Try calling sync() at the top of your 
>> notification handler. That will force external database changes to be 
>> written to disk.
>> 
>> If that doesn't work, then you may need to fetch the object from the context 
>> using some identifier other than the object ID. We do this in our products 
>> that share a database, and it works for us when a helper app receives a 
>> notification from the master app that a record has been 
>> added/updated/deleted.
>> 
> 
> Well no dice with either option.  sync() doesn't do it and a fetch request 
> using a different identifier yields 0 objects.  Do your products use XML 
> stores?

Well I ended up changing my store to a sqlite store and it started working 
right away.  There are some options you can supply when creating the store to 
force the kernel to flush all changes to the store to disk in a synchronous 
manner which I applied the first time I tried.  Apple's Documentation says this 
is comparatively much slower but I'm not working with large sets of data and 
the I don't need to save too frequently.  I'm going to try backing off on some 
of these options to see if everything still works.

Nick - thanks so much for your help.


>> 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: How To Increment CALayer Retain Count?

2011-04-08 Thread Matt Neuburg
On Thu, 07 Apr 2011 07:15:20 -0400, Jeffrey Walton  said:
>Hi All,
>
>I have a UIViewController as follows. Its just an "About Box", with a
>navigation bar and button (to cancel) and two labels.
>
>The controller was built with Interface Builder. The Navigation Bar
>and two labels are IBOutlets. According to IB, they are properly
>connected. I did not know what to connect the Navigation Items outlet
>to, so they are currently unconnected (formerly, they were connected
>to File's Owner which did not help).
>
>+ File's Owner
>+ First Responder
>+ View
>  + Navigation Bar
>+ Navigation Item (Title)
>  + Bar Button
>  + Label 1
>  + Label 2
>
>When the app starts, I tap a button and bring up the About box. Then I
>dismiss it. That is it.
>
>When the view is dismissed by tapping Cancel, NSZombie reports:
>-[UINavigationBar willMoveToSuperview:]: message sent to
>deallocated instance

You're posing your question very oddly, since you say "I have a 
UIViewController" but then you never show anything about any view controller. 
Thus it is impossible to say what you actually have. How does this view 
controller get instantiated? Who is retaining it? (If no one, then it and the 
whole kit and caboodle it loads from the nib could just vanish in a puff of 
smoke.) It has to be someone's job to retain the view controller, and it is the 
view controller's job to retain its view (which it will do if you are loading 
the nib correctly, but you don't show that, so who's to say?). Since everything 
else is inside the view, it is retained automatically.

It sounds a little like you're confused between outlets and memory management. 
They really don't have much to do with each other. Outlets are ways of getting 
references and setting instance variables as a nib loads. Memory management is, 
uh, memory management. I mean, sure, you might need an outlet to something in 
order to be able to refer to it in order to manage its memory, but they are 
still different worlds of thought. The only item in the nib that you should be 
managing the memory of is the View, because it's a top-level object - and the 
view controller should be doing that, assuming that the First Responder is of 
the view controller's class and assuming that the view controller's view outlet 
is connected to the View and assuming that you're loading the nib correctly...

Anyway, the CALayer is surely a total red herring.

m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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

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

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

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


Framework Installation Directory

2011-04-08 Thread Mr. Gecko
I need help with the Installation Directory for a framework that will be shared 
between a application and 2 daemons within side it. I think I may be able to do 
it if I were to have the 2 daemons executables in the MacOS path or another 
folder such as one named Daemons in the Contents folder. I am needing at least 
1 of the daemons to be a bundle based daemon as it'll have some UI elements and 
such. The installation directory that I have been doing is 
"@executable_path/../Frameworks" which according to this, it'll go back 1 
directory from the path of the executable and into the Frameworks directory to 
find the framework. The reason I am thinking in doing this as a framework is 
because some of the code I am using will be used in the daemons such as core 
code.

Thanks for any help,
Mr. Gecko___

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

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

Help/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: Framework Installation Directory

2011-04-08 Thread Vyacheslav Karamov

08-Apr-11 15:53, Mr. Gecko пишет:

I need help with the Installation Directory for a framework that will be shared between a 
application and 2 daemons within side it. I think I may be able to do it if I were to 
have the 2 daemons executables in the MacOS path or another folder such as one named 
Daemons in the Contents folder. I am needing at least 1 of the daemons to be a bundle 
based daemon as it'll have some UI elements and such. The installation directory that I 
have been doing is "@executable_path/../Frameworks" which according to this, 
it'll go back 1 directory from the path of the executable and into the Frameworks 
directory to find the framework. The reason I am thinking in doing this as a framework is 
because some of the code I am using will be used in the daemons such as core code.

Thanks for any help,
Mr. Gecko___

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

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

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

This email sent to ubuntul...@yandex.ru



I'm not sure what you need exactly, but it hope it would be helpful for you
http://www.dribin.org/dave/blog/archives/2009/11/15/rpath/
http://www.mikeash.com/?page=pyblog/friday-qa-2009-11-06-linking-and-install-names.html
http://lapcatsoftware.com/blog/2007/08/11/embedding-frameworks-in-loadable-bundles/
___

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

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

Help/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: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 8:53 AM, Mr. Gecko  wrote:
> I need help with the Installation Directory for a framework that will be 
> shared between a application and 2 daemons within side it. I think I may be 
> able to do it if I were to have the 2 daemons executables in the MacOS path 
> or another folder such as one named Daemons in the Contents folder. I am 
> needing at least 1 of the daemons to be a bundle based daemon as it'll have 
> some UI elements and such. The installation directory that I have been doing 
> is "@executable_path/../Frameworks" which according to this, it'll go back 1 
> directory from the path of the executable and into the Frameworks directory 
> to find the framework. The reason I am thinking in doing this as a framework 
> is because some of the code I am using will be used in the daemons such as 
> core code.

The details will vary according to how you've structured your bundles,
but the principle is the same. The install name of the framework is
used at link time, and copied into any apps that link with it. At run
time, it's the copy in the app that's used to find the framework, and
you can use install_name_tool's -change option to modify that.

install_name_tool -change
'@executable_path/../Frameworks/Foo.framework/Foo'
'@executable_path/../../Frameworks/Foo.framework/Foo'.

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: Framework Installation Directory

2011-04-08 Thread Mr. Gecko
So basically once I've compiled the daemon, have it run a post script that will 
change the path to go back 4 directories instead of 1 if I was to place it in 
Contents/Daemon/Daemon.app/Contents/MacOS/Daemon?

Thanks for the response,
Mr. Gecko

On Apr 8, 2011, at 8:48 AM, Sherm Pendley wrote:

> The details will vary according to how you've structured your bundles,
> but the principle is the same. The install name of the framework is
> used at link time, and copied into any apps that link with it. At run
> time, it's the copy in the app that's used to find the framework, and
> you can use install_name_tool's -change option to modify that.
> 
> install_name_tool -change
> '@executable_path/../Frameworks/Foo.framework/Foo'
> '@executable_path/../../Frameworks/Foo.framework/Foo'.
> 
> sherm--
> 
> -- 
> Cocoa programming in Perl:
> http://camelbones.sourceforge.net



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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


Re: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
Yeah, that's how I'd do it, add a "run script" build phase to the daemon target.

sherm--

On Fri, Apr 8, 2011 at 9:57 AM, Mr. Gecko  wrote:
> So basically once I've compiled the daemon, have it run a post script that 
> will change the path to go back 4 directories instead of 1 if I was to place 
> it in Contents/Daemon/Daemon.app/Contents/MacOS/Daemon?
>
> Thanks for the response,
> Mr. Gecko
>
> On Apr 8, 2011, at 8:48 AM, Sherm Pendley wrote:
>
>> The details will vary according to how you've structured your bundles,
>> but the principle is the same. The install name of the framework is
>> used at link time, and copied into any apps that link with it. At run
>> time, it's the copy in the app that's used to find the framework, and
>> you can use install_name_tool's -change option to modify that.
>>
>> install_name_tool -change
>> '@executable_path/../Frameworks/Foo.framework/Foo'
>> '@executable_path/../../Frameworks/Foo.framework/Foo'.
>>
>> sherm--
>>
>> --
>> Cocoa programming in Perl:
>> http://camelbones.sourceforge.net
>
>



-- 
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: Framework Installation Directory

2011-04-08 Thread Jean-Daniel Dupas
Or do a symlink of MyApp.app/Contents/Frameworks into your daemon Contents 
directory (using a build script too).

cd Daemon.app/Contents/
ln -s ../../../Frameworks Frameworks

(I didn't check the count of '..' so it may be wrong, but you get the idea).

> Yeah, that's how I'd do it, add a "run script" build phase to the daemon 
> target.
> 
> sherm--
> 
> On Fri, Apr 8, 2011 at 9:57 AM, Mr. Gecko  wrote:
>> So basically once I've compiled the daemon, have it run a post script that 
>> will change the path to go back 4 directories instead of 1 if I was to place 
>> it in Contents/Daemon/Daemon.app/Contents/MacOS/Daemon?
>> 
>> Thanks for the response,
>> Mr. Gecko
>> 
>> On Apr 8, 2011, at 8:48 AM, Sherm Pendley wrote:
>> 
>>> The details will vary according to how you've structured your bundles,
>>> but the principle is the same. The install name of the framework is
>>> used at link time, and copied into any apps that link with it. At run
>>> time, it's the copy in the app that's used to find the framework, and
>>> you can use install_name_tool's -change option to modify that.
>>> 
>>> install_name_tool -change
>>> '@executable_path/../Frameworks/Foo.framework/Foo'
>>> '@executable_path/../../Frameworks/Foo.framework/Foo'.
>>> 
>>> sherm--
>>> 
>>> --
>>> Cocoa programming in Perl:
>>> http://camelbones.sourceforge.net
>> 
>> 
> 
> 
> 
> -- 
> 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/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org

-- Jean-Daniel




___

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

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

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

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


Re: Framework Installation Directory

2011-04-08 Thread Mr. Gecko
True, I forgot all about symbolic links.

On Apr 8, 2011, at 10:05 AM, Jean-Daniel Dupas wrote:

> Or do a symlink of MyApp.app/Contents/Frameworks into your daemon Contents 
> directory (using a build script too).
> 
> cd Daemon.app/Contents/
> ln -s ../../../Frameworks Frameworks
> 
> (I didn't check the count of '..' so it may be wrong, but you get the idea).


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: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
True! There's more than one way to skin that cat. :-)

sherm--

On Fri, Apr 8, 2011 at 11:05 AM, Jean-Daniel Dupas
 wrote:
> Or do a symlink of MyApp.app/Contents/Frameworks into your daemon Contents 
> directory (using a build script too).
>
> cd Daemon.app/Contents/
> ln -s ../../../Frameworks Frameworks
>
> (I didn't check the count of '..' so it may be wrong, but you get the idea).
>
>> Yeah, that's how I'd do it, add a "run script" build phase to the daemon 
>> target.
>>
>> sherm--
>>
>> On Fri, Apr 8, 2011 at 9:57 AM, Mr. Gecko  wrote:
>>> So basically once I've compiled the daemon, have it run a post script that 
>>> will change the path to go back 4 directories instead of 1 if I was to 
>>> place it in Contents/Daemon/Daemon.app/Contents/MacOS/Daemon?
>>>
>>> Thanks for the response,
>>> Mr. Gecko
>>>
>>> On Apr 8, 2011, at 8:48 AM, Sherm Pendley wrote:
>>>
 The details will vary according to how you've structured your bundles,
 but the principle is the same. The install name of the framework is
 used at link time, and copied into any apps that link with it. At run
 time, it's the copy in the app that's used to find the framework, and
 you can use install_name_tool's -change option to modify that.

 install_name_tool -change
 '@executable_path/../Frameworks/Foo.framework/Foo'
 '@executable_path/../../Frameworks/Foo.framework/Foo'.

 sherm--

 --
 Cocoa programming in Perl:
 http://camelbones.sourceforge.net
>>>
>>>
>>
>>
>>
>> --
>> 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/devlists%40shadowlab.org
>>
>> This email sent to devli...@shadowlab.org
>
> -- Jean-Daniel
>
>
>
>
>



-- 
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: Class UITableViewCellContentView is implemented in both and . One of the two will be used. Which one is undefined.

2011-04-08 Thread Luke Hiesterman
It means that UIKit now defines a class called UITableViewCellContentView and 
that collides with one of your classes. Objective C has this inherent weakness 
that if a class with the same name is implemented in more than one place, they 
fight for which one gets used. Since you can't change UIKit, you will have to 
change the name of your class. While you're at it, I'd recommend not prefixing 
your own class names with UI or other apple prefixes such as NS. It will help 
you avoid this situation in the future. 

Luke

On Apr 7, 2011, at 10:50 PM, Laurent Daudelin  wrote:

> Back working on an old project I haven't touched in maybe over a year. 
> Updated the project file with the latest SDK, clean all targets and rebuilt.
> 
> Now, when I launch the app in the simulator (any version of iOS), I'm getting 
> this stupid error:
> 
> Class UITableViewCellContentView is implemented in both 
> /Users/laurent/Library/Application Support/iPhone 
> Simulator/4.0.2/Applications/EB19DD7A-2905-4625-8120-B6A8432318D7/ App>.app/ and 
> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit.
>  One of the two will be used. Which one is undefined.
> 
> I googled the first part of the error and found a few, old references about 
> an old bug that was in the framework but with the recent SDKs still doing it, 
> I don't understand.
> 
> What's wrong with this and what am I missing?
> 
> Thanks in advance!
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelinhttp://www.nemesys-soft.com/
> Logiciels Nemesys Softwarelaur...@nemesys-soft.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/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: Display a "Red frame" on the screen

2011-04-08 Thread David Duncan
On Apr 8, 2011, at 3:39 AM, eveningnick eveningnick wrote:

> Hello
> I have two monitors attached to the computer, and when i click in
> "System Preferences/Displays Preferences" on the "display" image
> (Display arrangement tab), the screen of the clicked "scematic
> monitor's image" monitor is being surrounded by a red frame.
> 
> How could i do something like this from my application? I don't need
> the red frame around the whole screen, but i would like to have some
> area on the screen. Is it possible to do using some kind of API?


You can use NSScreen to get a list of available screens and then just create an 
NSWindow on whatever screens you want. You probably want a borderless window 
(which is a flag you can pass when you create the window) so that the window 
doesn't have content by default.
--
David Duncan

___

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

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

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

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


Re: Class UITableViewCellContentView is implemented in both and . One of the two will be used. Which one is undefined.

2011-04-08 Thread Laurent Daudelin
Thanks Luke.

I initially didn't understand how I could have done this because I'm careful 
about the names I give my classes, having done Objective-C for 15 years. But I 
found one implementation. I remember yesterday when googling that there was an 
issue on Stack Overflow at some point with SDK 3.2 where an exception was 
raised when trying to load a nib. Someone had suggested to create an almost 
empty implementation of UITableViewCellContentView to work around that problem. 
I guess I need to remove that remnant.

Thanks for pointing that out. I would have searched a bit because I didn't 
remember creating that duplicate!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Apr 8, 2011, at 08:33, Luke Hiesterman wrote:

> It means that UIKit now defines a class called UITableViewCellContentView and 
> that collides with one of your classes. Objective C has this inherent 
> weakness that if a class with the same name is implemented in more than one 
> place, they fight for which one gets used. Since you can't change UIKit, you 
> will have to change the name of your class. While you're at it, I'd recommend 
> not prefixing your own class names with UI or other apple prefixes such as 
> NS. It will help you avoid this situation in the future. 
> 
> Luke
> 
> On Apr 7, 2011, at 10:50 PM, Laurent Daudelin  
> wrote:
> 
>> Back working on an old project I haven't touched in maybe over a year. 
>> Updated the project file with the latest SDK, clean all targets and rebuilt.
>> 
>> Now, when I launch the app in the simulator (any version of iOS), I'm 
>> getting this stupid error:
>> 
>> Class UITableViewCellContentView is implemented in both 
>> /Users/laurent/Library/Application Support/iPhone 
>> Simulator/4.0.2/Applications/EB19DD7A-2905-4625-8120-B6A8432318D7/> App>.app/ and 
>> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit.
>>  One of the two will be used. Which one is undefined.
>> 
>> I googled the first part of the error and found a few, old references about 
>> an old bug that was in the framework but with the recent SDKs still doing 
>> it, I don't understand.
>> 
>> What's wrong with this and what am I missing?
>> 
>> Thanks in advance!
>> 
>> -Laurent.
>> -- 
>> Laurent Daudelin
>> AIM/iChat/Skype:LaurentDaudelinhttp://www.nemesys-soft.com/
>> Logiciels Nemesys Softwarelaur...@nemesys-soft.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/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: Framework Installation Directory

2011-04-08 Thread Eric Wing
On 4/8/11, Vyacheslav Karamov  wrote:

> I'm not sure what you need exactly, but it hope it would be helpful for you
> http://www.dribin.org/dave/blog/archives/2009/11/15/rpath/

I agree with Vyacheslav. You should look at @rpath.

-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
___

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

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

Help/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: Display a "Red frame" on the screen

2011-04-08 Thread eveningnick eveningnick
Hi David,
thanks for the answer

I was thinking about the window. But then it has to be something with
a big hole inside. This hole ought to be transparent for mouse clicks
(so if there's something below my "window", that 'something' has to be
clickable and focused, and receive keyboard input)? Is it possible to
do somehow? Borderless is a window without a title (as i understand).
What kind of properties should i specify to make a window as that "Red
frame"? I mean, i really want it to be just a mark for the user,
without any "windowing" behaviour (well, the user can drag it, if he
clicks on the 'red frame' with mouse, but that is the only relation to
a real window it should have).

In OS Windows i would probably use "Regions" API, but i have no idea
what to do in Mac OS. Could you give me a clue?
thanks

2011/4/8 David Duncan :
> You can use NSScreen to get a list of available screens and then just create 
> an NSWindow on whatever screens you want. You probably want a borderless 
> window (which is a flag you can pass when you create the window) so that the 
> window doesn't have content by default.
> --
> David Duncan
>
>
___

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

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

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

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


Re: Compiling screensaver for 10.5

2011-04-08 Thread Michael Diehr
> On Apr 1, 2011, at 12:13 AM, Gabriel Zachmann wrote:
> Yeah, that would do it. 3.2.6 didn't completely drop PPC support, but it did 
> drop it from the list of standard architectures.

I'm building a .saver file -- in 3.2.5 I was able to build a universal .saver 
file that worked on 10.4 (PPC), 10.5-10.6 (PPC, 32 bit Intel, and 64 bit Intel).

I have the exact same issue: updated XCode to 3.2.6 and now I can't build PPC 
any longer.

I've changed my build settings to be explicit about ppc, and yet when I clean 
and build, file (and lipo -info) both report only the 32 and 64 bit Intel code.

When I look at my .pbxproj file in a text editor I see something weird.   It 
looks as if I have two copies of the settings, one under a list called

  Build configuration list for PBXProject "MySaver" (this one looks right)
and one called
  Build configuration list for PBXNativeTarget "MySaver"  (this one looks wrong)

These reference the build settings by ID -- and one of the build settings looks 
correct:

EF7AD73308BB986600CE4634 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
x86_64,
ppc,
ppc64,
ppc7400,
ppc970,
);
"GCC_ENABLE_OBJC_GC[arch=x86_64]" = supported;
"GCC_FAST_OBJC_DISPATCH[arch=ppc]" = NO;
GCC_VERSION = 4.2;
"GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = NO;
PREBINDING = NO;
SDKROOT = "";
"SDKROOT[arch=i386]" = macosx10.4;
"SDKROOT[arch=ppc]" = macosx10.4;
"SDKROOT[arch=x86_64]" = "";
VALID_ARCHS = "i386 x86_64 ppc ppc64 ppc7400 
ppc970";
};
name = Release;


e.g. it includes ppc.

The other build settings is not:

EF7AD72F08BB986600CE4634 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = iScreensaver_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = iScreensaver;
VALID_ARCHS = "x86_64 i386 ppc ppc64 ppc7400 
ppc970";
WRAPPER_EXTENSION = saver;
};
name = Release;

Is this perhaps an XCode bug?

Any ideas what to do here?  What's the difference between PBXNativeTarget and 
PBXProject?

___

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

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

Help/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: Compiling screensaver for 10.5

2011-04-08 Thread Nick Zitzmann

On Apr 8, 2011, at 11:35 AM, Michael Diehr wrote:

> I'm building a .saver file -- in 3.2.5 I was able to build a universal .saver 
> file that worked on 10.4 (PPC), 10.5-10.6 (PPC, 32 bit Intel, and 64 bit 
> Intel).
> 
> I have the exact same issue: updated XCode to 3.2.6 and now I can't build PPC 
> any longer.
> 
> I've changed my build settings to be explicit about ppc, and yet when I clean 
> and build, file (and lipo -info) both report only the 32 and 64 bit Intel 
> code.
> 
> When I look at my .pbxproj file in a text editor I see something weird.   It 
> looks as if I have two copies of the settings, one under a list called
> 
>  Build configuration list for PBXProject "MySaver" (this one looks right)
> and one called
>  Build configuration list for PBXNativeTarget "MySaver"  (this one looks 
> wrong)
> 
> These reference the build settings by ID -- and one of the build settings 
> looks correct:
> 
>   EF7AD73308BB986600CE4634 /* Release */ = {
>   isa = XCBuildConfiguration;
>   buildSettings = {
>   ARCHS = (
>   i386,
>   x86_64,
>   ppc,
>   ppc64,
>   ppc7400,
>   ppc970,
>   );
>   "GCC_ENABLE_OBJC_GC[arch=x86_64]" = supported;
>   "GCC_FAST_OBJC_DISPATCH[arch=ppc]" = NO;
>   GCC_VERSION = 4.2;
>   "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
>   GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
>   GCC_WARN_ABOUT_RETURN_TYPE = YES;
>   GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
>   GCC_WARN_UNUSED_VARIABLE = YES;
>   ONLY_ACTIVE_ARCH = NO;
>   PREBINDING = NO;
>   SDKROOT = "";
>   "SDKROOT[arch=i386]" = macosx10.4;
>   "SDKROOT[arch=ppc]" = macosx10.4;
>   "SDKROOT[arch=x86_64]" = "";
>   VALID_ARCHS = "i386 x86_64 ppc ppc64 ppc7400 
> ppc970";
>   };
>   name = Release;
> 
> 
> e.g. it includes ppc.
> 
> The other build settings is not:
> 
>   EF7AD72F08BB986600CE4634 /* Release */ = {
>   isa = XCBuildConfiguration;
>   buildSettings = {
>   ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
>   GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
>   GCC_MODEL_TUNING = G5;
>   GCC_PRECOMPILE_PREFIX_HEADER = YES;
>   GCC_PREFIX_HEADER = iScreensaver_Prefix.pch;
>   INFOPLIST_FILE = Info.plist;
>   INSTALL_PATH = "$(HOME)/Library/Screen Savers";
>   ONLY_ACTIVE_ARCH = NO;
>   PRODUCT_NAME = iScreensaver;
>   VALID_ARCHS = "x86_64 i386 ppc ppc64 ppc7400 
> ppc970";
>   WRAPPER_EXTENSION = saver;
>   };
>   name = Release;
> 
> Is this perhaps an XCode bug?

No.

> Any ideas what to do here?  What's the difference between PBXNativeTarget and 
> PBXProject?

Projects and targets can have different configuration settings. Settings 
assigned to the target apply only to that target, while settings assigned to 
the project apply to all targets in the project unless they are overridden. You 
have the Release settings correct for the project, but not for the target, and 
the target overrides the project.

Also, there is no reason to disable the accelerated dispatch unless you are 
still targeting Panther users. And there aren't that many of them that are 
still around & downloading new software.

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: Display a "Red frame" on the screen

2011-04-08 Thread Andreas Mayer

Am 08.04.2011 um 19:24 schrieb eveningnick eveningnick:

> I was thinking about the window. But then it has to be something with
> a big hole inside. This hole ought to be transparent for mouse clicks
> (so if there's something below my "window", that 'something' has to be
> clickable and focused, and receive keyboard input)? Is it possible to
> do somehow? Borderless is a window without a title (as i understand).
> What kind of properties should i specify to make a window as that "Red
> frame"? I mean, i really want it to be just a mark for the user,
> without any "windowing" behaviour (well, the user can drag it, if he
> clicks on the 'red frame' with mouse, but that is the only relation to
> a real window it should have).

See this little project. It uses a (borderless) window to place a 'puff* 
graphic under the mouse cursor.

http://www.harmless.de/cocoa-code.php#floatingimage


Andreas___

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

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

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

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


Re: Compiling screensaver for 10.5

2011-04-08 Thread Michael Diehr
On Apr 8, 2011, at 11:00 AM, Nick Zitzmann wrote:
>> 
>> Is this perhaps an XCode bug?
> 
> No.
> 
>> Any ideas what to do here?  What's the difference between PBXNativeTarget 
>> and PBXProject?
> 
> Projects and targets can have different configuration settings. Settings 
> assigned to the target apply only to that target, while settings assigned to 
> the project apply to all targets in the project unless they are overridden. 
> You have the Release settings correct for the project, but not for the 
> target, and the target overrides the project.
> 

Ok, you may be right that I'm confused about Target vs. Project settings.

However, I'm pretty sure there is an actual bug here:

In 3.2.6:
* double-click  MyProject.xcodeproj in the finder
* with the root item selected in Groups&Files
* click the "Info" button in the toolbar

Result:
Configuration shows:
 Active (Release)
 Architectures: i386, x86_64, ppc, ppc64, ppc7400, ppc970

(that's what I expect)

* close the Info window
* From the Project menu,  choose "Edit Active Target"

Result:
Configuration shows:
 Active (Release)
 Architectures: Standard (32/64 bit Intel)

At this point, switching the Configuration popup from Active (Release) to 
Release has no effect -- I can't get it to show " Architectures: i386, x86_64, 
ppc, ppc64, ppc7400, ppc970" any longer.

And then a little later Xcode crashes (see crash log below)

So, there seems to be some bug with XCode getting confused about target 
settings.


> Also, there is no reason to disable the accelerated dispatch unless you are 
> still targeting Panther users. And there aren't that many of them that are 
> still around & downloading new software.

Thanks, I no longer support 10.3 users...


Crash log:

Application Specific Information:
objc_msgSend() selector name: groupTreeDisplayName
objc[32172]: garbage collection is ON

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib 0x7fff8547b11c objc_msgSend + 40
1   ...ple.Xcode.DevToolsInterface  0x00010084d46d -[PBXGroupTreeModule 
outlineView:objectValueForTableColumn:byItem:] + 143
2   com.apple.AppKit0x7fff85838a00 -[NSTableView 
preparedCellAtColumn:row:] + 323
3   com.apple.AppKit0x7fff858518e7 -[NSTableView 
_drawContentsAtRow:column:withCellFrame:] + 47
4   com.apple.AppKit0x7fff8585185d -[NSOutlineView 
_drawContentsAtRow:column:withCellFrame:] + 95
5   com.apple.AppKit0x7fff85850980 -[NSTableView 
drawRow:clipRect:] + 1242
6   com.apple.AppKit0x7fff85850273 -[NSTableView 
drawRowIndexes:clipRect:] + 369
7   com.apple.AppKit0x7fff858500f4 -[NSOutlineView 
drawRowIndexes:clipRect:] + 131
8   com.apple.AppKit0x7fff8584ec20 -[NSTableView 
drawRect:] + 1302
9   com.apple.AppKit0x7fff85844c49 -[NSView 
_drawRect:clip:] + 3390
10  com.apple.AppKit0x7fff858438bc -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1325
11  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
12  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
13  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
14  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
15  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
16  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
17  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
18  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
19  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
20  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
21  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
22  com.apple.AppKit0x7fff85843c26 -[NSView 
_recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
23  com.apple.AppKit0x7fff85841f8e -[NSView 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
 + 767
24  com.apple.AppKit0x7fff85841ab0 -[NSThemeFrame 
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
 + 254
25  com.apple.AppKit0x7f

Re: Display a "Red frame" on the screen

2011-04-08 Thread Peter Lübke


Am 08.04.2011 um 19:24 schrieb eveningnick eveningnick:


I was thinking about the window. But then it has to be something with
a big hole inside. This hole ought to be transparent for mouse clicks
(so if there's something below my "window", that 'something' has to be
clickable and focused, and receive keyboard input)? Is it possible to
do somehow? Borderless is a window without a title (as i understand).
What kind of properties should i specify to make a window as that "Red
frame"? I mean, i really want it to be just a mark for the user,
without any "windowing" behaviour (well, the user can drag it, if he
clicks on the 'red frame' with mouse, but that is the only relation to
a real window it should have).

In OS Windows i would probably use "Regions" API, but i have no idea
what to do in Mac OS. Could you give me a clue?


Invoke  -setIgnoresMouseEvents: on the borderless window.

Cheers,

Peter

___

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

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

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

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


Re: Compiling screensaver for 10.5

2011-04-08 Thread Michael Diehr
Ok, a few issues:

Issue 1:  Nick, you were right in that I was totally misunderstanding the 
distinction between Project and Target -- this didn't matter in XCode 3.2.5 
since the architecture macros were fine, but in 3.2.6 this changed.   It also 
didn't help that my xcode file name, project name, and target names were all 
the same, and I didn't realize that the Info button is context sensitive (the 
contents of the info window depends on what you have selected when you click 
it, of course).  My fault.

So I've fixed that.

Issue 2: started getting link errors when trying to build including "ppc64".  
Removed that and now it compiles & links just fine.

Issue 3: supposing that I want to support the G3, G4, and G5 ppc chips, but 
only care about OS X 10.4 and later -- what ppc archs should I use?

Performance here is not terribly important, so if there's one minimal setting I 
can use that reduces file size, I'm happy to use it.

Should I just use:
  archs = i386 x86_64 ppc 

or perhaps
  archs = i386 x86_64 ppc ppc7400 ppc970

Not clear on what the differences are and the consequences for chip.

Does anyone know which PPC archs were included in the former (XCode 3.2.5) 
Universal Binary app macro?

Thanks again for your help :)




On Apr 8, 2011, at 11:14 AM, Michael Diehr wrote:

> On Apr 8, 2011, at 11:00 AM, Nick Zitzmann wrote:
>>> 
>>> Is this perhaps an XCode bug?
>> 
>> No.
>> 
>>> Any ideas what to do here?  What's the difference between PBXNativeTarget 
>>> and PBXProject?
>> 
>> Projects and targets can have different configuration settings. Settings 
>> assigned to the target apply only to that target, while settings assigned to 
>> the project apply to all targets in the project unless they are overridden. 
>> You have the Release settings correct for the project, but not for the 
>> target, and the target overrides the project.
>> 
> 
> Ok, you may be right that I'm confused about Target vs. Project settings.
> 
> However, I'm pretty sure there is an actual bug here:
> 
> In 3.2.6:
> * double-click  MyProject.xcodeproj in the finder
> * with the root item selected in Groups&Files
> * click the "Info" button in the toolbar
> 
> Result:
> Configuration shows:
> Active (Release)
> Architectures: i386, x86_64, ppc, ppc64, ppc7400, ppc970
> 
> (that's what I expect)
> 
> * close the Info window
> * From the Project menu,  choose "Edit Active Target"
> 
> Result:
> Configuration shows:
> Active (Release)
> Architectures: Standard (32/64 bit Intel)
> 
> At this point, switching the Configuration popup from Active (Release) to 
> Release has no effect -- I can't get it to show " Architectures: i386, 
> x86_64, ppc, ppc64, ppc7400, ppc970" any longer.
> 
> And then a little later Xcode crashes (see crash log below)
> 
> So, there seems to be some bug with XCode getting confused about target 
> settings.
> 
> 
>> Also, there is no reason to disable the accelerated dispatch unless you are 
>> still targeting Panther users. And there aren't that many of them that are 
>> still around & downloading new software.
> 
> Thanks, I no longer support 10.3 users...
> 
> 
> Crash log:
> 
> Application Specific Information:
> objc_msgSend() selector name: groupTreeDisplayName
> objc[32172]: garbage collection is ON
> 
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   libobjc.A.dylib   0x7fff8547b11c objc_msgSend + 40
> 1   ...ple.Xcode.DevToolsInterface0x00010084d46d -[PBXGroupTreeModule 
> outlineView:objectValueForTableColumn:byItem:] + 143
> 2   com.apple.AppKit  0x7fff85838a00 -[NSTableView 
> preparedCellAtColumn:row:] + 323
> 3   com.apple.AppKit  0x7fff858518e7 -[NSTableView 
> _drawContentsAtRow:column:withCellFrame:] + 47
> 4   com.apple.AppKit  0x7fff8585185d -[NSOutlineView 
> _drawContentsAtRow:column:withCellFrame:] + 95
> 5   com.apple.AppKit  0x7fff85850980 -[NSTableView 
> drawRow:clipRect:] + 1242
> 6   com.apple.AppKit  0x7fff85850273 -[NSTableView 
> drawRowIndexes:clipRect:] + 369
> 7   com.apple.AppKit  0x7fff858500f4 -[NSOutlineView 
> drawRowIndexes:clipRect:] + 131
> 8   com.apple.AppKit  0x7fff8584ec20 -[NSTableView 
> drawRect:] + 1302
> 9   com.apple.AppKit  0x7fff85844c49 -[NSView 
> _drawRect:clip:] + 3390
> 10  com.apple.AppKit  0x7fff858438bc -[NSView 
> _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1325
> 11  com.apple.AppKit  0x7fff85843c26 -[NSView 
> _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
> 12  com.apple.AppKit  0x7fff85843c26 -[NSView 
> _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
> 13  com.apple.AppKit  0x7fff85843c26 -[NSView 
> _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2199
> 14  com.apple.AppKit  0x7fff85843c26 -[NSView 
> _recursi

Re: Compiling screensaver for 10.5

2011-04-08 Thread Quincey Morris
On Apr 8, 2011, at 11:14, Michael Diehr wrote:

> Architectures: i386, x86_64, ppc, ppc64, ppc7400, ppc970

Surely this isn't what you mean. You want 6 architectures in your executable?


___

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

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

Help/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: Compiling screensaver for 10.5

2011-04-08 Thread Nick Zitzmann

On Apr 8, 2011, at 12:14 PM, Michael Diehr wrote:

> Ok, you may be right that I'm confused about Target vs. Project settings.
> 
> However, I'm pretty sure there is an actual bug here:
> 
> In 3.2.6:
> * double-click  MyProject.xcodeproj in the finder
> * with the root item selected in Groups&Files
> * click the "Info" button in the toolbar
> 
> Result:
> Configuration shows:
> Active (Release)
> Architectures: i386, x86_64, ppc, ppc64, ppc7400, ppc970
> 
> (that's what I expect)
> 
> * close the Info window
> * From the Project menu,  choose "Edit Active Target"
> 
> Result:
> Configuration shows:
> Active (Release)
> Architectures: Standard (32/64 bit Intel)
> 
> At this point, switching the Configuration popup from Active (Release) to 
> Release has no effect -- I can't get it to show " Architectures: i386, 
> x86_64, ppc, ppc64, ppc7400, ppc970" any longer.

Of course it has no effect; you didn't actually switch the configuration. You 
need to delete the overridden properties in the Release build in the target. 
That way, the target & configuration will use the same properties as the 
project.

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: Compiling screensaver for 10.5

2011-04-08 Thread Nick Zitzmann

On Apr 8, 2011, at 12:39 PM, Michael Diehr wrote:

> Issue 2: started getting link errors when trying to build including "ppc64".  
> Removed that and now it compiles & links just fine.

The ppc64 architecture was never actually used by the screen saver engine or 
framework, so this isn't too surprising.

> Issue 3: supposing that I want to support the G3, G4, and G5 ppc chips, but 
> only care about OS X 10.4 and later -- what ppc archs should I use?

ppc. The linker may change this to ppc7400 under certain circumstances. This is 
normal, and only means that your screen saver will not load on G3 Macs.

> Should I just use:
>  archs = i386 x86_64 ppc 

Yes.

> or perhaps
>  archs = i386 x86_64 ppc ppc7400 ppc970
> 
> Not clear on what the differences are and the consequences for chip.

ppc7400 = G4
ppc970 = G5

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: Compiling screensaver for 10.5

2011-04-08 Thread Laurent Daudelin
On Apr 8, 2011, at 11:39, Michael Diehr wrote:

> Should I just use:
>  archs = i386 x86_64 ppc 
> 
> or perhaps
>  archs = i386 x86_64 ppc ppc7400 ppc970

If I recall correctly, "ppc" is the basic, G3 architecture which is supported 
by the G4 and the G5 so even though the generated code would not be fully 
optimized to take advantage of the improvements in the G4 and the G5, I think 
it's fairly acceptable for PowerPC users. That's what I currently use for 
projects that support PowerPC.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laurent@nemesys-soft.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: Compiling screensaver for 10.5

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 2:48 PM, Nick Zitzmann  wrote:
>
>
> ppc. The linker may change this to ppc7400 under certain circumstances. This 
> is normal, and only means that your screen saver will not load on G3 Macs.

This has to do with the deployment target, right? That is, it will be
changed to ppc7400 if your deployment target is an OS version that
requires a G4 anyway...

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: Compiling screensaver for 10.5

2011-04-08 Thread Nick Zitzmann

On Apr 8, 2011, at 2:28 PM, Sherm Pendley wrote:

> This has to do with the deployment target, right? That is, it will be
> changed to ppc7400 if your deployment target is an OS version that
> requires a G4 anyway...

Correct.

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: Display a "Red frame" on the screen

2011-04-08 Thread eveningnick eveningnick
thanks andreas, i'll look at that
___

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

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

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

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


Test for TCP port

2011-04-08 Thread Heizer, Charles
Hello,
What is the best way to test to see if a TCP port is reachable and will answer 
connections? I was trying to use NSSocketPort and NSConnection but I'm not 
getting a valid connection.

Thanks,
Charles


NSSocketPort *sendPort = [[NSSocketPort alloc] initRemoteWithTCPPort:3600 
host:@"test.myhost.com"];
NSConnection *connection = [NSConnection connectionWithReceivePort:nil 
sendPort:sendPort];


[connection setRequestTimeout:10.0];
[connection setReplyTimeout:10.0];


NSLog(@"theConnection 0x%X", connection);
NSLog(@"Connect is valid? %d", (int)[connection isValid]);
___

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

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

Help/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: Test for TCP port

2011-04-08 Thread Kyle Sluder
On Fri, Apr 8, 2011 at 3:26 PM, Heizer, Charles  wrote:
> What is the best way to test to see if a TCP port is reachable and will 
> answer connections? I was trying to use NSSocketPort and NSConnection but I'm 
> not getting a valid connection.

The *only* way to correctly determine if a TCP port can be connected
is to attempt the connection.

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


CFXMLTreeRef

2011-04-08 Thread koko
I am adding an iOS target to an existing project.

I am getting the errors:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WSMethodInvocation.h:759:
 error: 'CFXMLTreeRef' has not been declared

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:8142:
 error: 'CGDirectDisplayID' does not name a type


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65:
 error: 'CGCharCode' has not been declared


/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h:65:
 error: 'CGKeyCode' has not been declared

What should I include to expunge these errors?

-koko


___

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

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

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

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


NSDateFormatter setDoesRelativeDateFormatting: broken?

2011-04-08 Thread Laurent Daudelin
Is it me or is NSDateFormatter's setDoesRelativeDateFormatting: is broken?

Here is the code I use to create a new NSDateFormatter instance:
NSDateFormatter *dateFormatter = [[NSDateFormatter 
alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:YES];
[dateFormatter setLocale:[NSLocale currentLocale]];
[dateFormatter setDoesRelativeDateFormatting:YES];
[dateFormatter 
setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
[dateFormatter setTimeStyle:NSDateFormatterLongStyle];

When I use stringFromDate:, the date is always output like 4/8/11 3:50:50 PM. I 
was expecting that it would output something more along the line of "Today 
3:50:50 PM" or something like that.

The doc gives this example for setDoesRelativeDateFormatting:

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
NSLocale *frLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"fr_FR"];
[dateFormatter setLocale:frLocale];
 
[dateFormatter setDoesRelativeDateFormatting:YES];
 
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:60*60*24*3];
NSString *dateString = [dateFormatter stringFromDate:date];
 
NSLog(@"dateString: %@", dateString);
// Output
// dateString: après-après-demain

So, what's wrong with this? Am I missing something or is NSDateFormatter 
setDoesRelativeDateFormatting is broken somehow?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: Test for TCP port

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 6:26 PM, Heizer, Charles  wrote:
>
> What is the best way to test to see if a TCP port is reachable and will 
> answer connections? I was trying to use NSSocketPort and NSConnection but I'm 
> not getting a valid connection.
>
> NSSocketPort *sendPort = [[NSSocketPort alloc] initRemoteWithTCPPort:3600 
> host:@"test.myhost.com"];

That's not a valid host name. Try connecting to just @"test.myhost.com" instead.

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: Test for TCP port

2011-04-08 Thread Dave Carrigan

On Apr 8, 2011, at 3:26 PM, Heizer, Charles wrote:

> What is the best way to test to see if a TCP port is reachable and will 
> answer connections? I was trying to use NSSocketPort and NSConnection but I'm 
> not getting a valid connection.

You have to connect to it. Unfortunately, neither NSSocketPort nor NSConnection 
attempt to connect until you send data, so with those, you have no way of 
immediately knowing that anything is actually listening. The best way is to get 
down a level and use socket(2) and friends.

-- 
Dave Carrigan
d...@openshut.net
Seattle, WA, USA

___

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

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

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

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


Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Rick Mann
Hi. In my garbage collection-required app, I'm trying to store a code block 
(void (^)(void)) in a CFMutableDictionary. The docs says copy/retain/release 
can be sent to a block, suggesting this can be done. But it's not working. When 
I later retrieve the block and call it, I get an EXEC_BAD_ACCESS.

This is when the block references an NSObject declared & allocated in the 
block's enclosing scope. If I don't access that variable, it executes fine.

This tells me the block isn't being properly copied as it is inserted into into 
the dictionary.

Is there something I can do to allow this to work? Thanks.

-- 
Rick___

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

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

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

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


Re: NSDateFormatter setDoesRelativeDateFormatting: broken?

2011-04-08 Thread Rick Mann

On Apr 8, 2011, at 16:44 , Laurent Daudelin wrote:

>   NSDateFormatter *dateFormatter = [[NSDateFormatter 
> alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:YES];

My guess would be the format you're initting it with is overriding the relative 
date setting. Try using "init" instead.

-- 
Rick

___

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

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

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

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


Re: Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Dave DeLong
Please post your code. 

Dave

Sent from my iPhone

On Apr 8, 2011, at 5:25 PM, Rick Mann  wrote:

> Hi. In my garbage collection-required app, I'm trying to store a code block 
> (void (^)(void)) in a CFMutableDictionary. The docs says copy/retain/release 
> can be sent to a block, suggesting this can be done. But it's not working. 
> When I later retrieve the block and call it, I get an EXEC_BAD_ACCESS.
> 
> This is when the block references an NSObject declared & allocated in the 
> block's enclosing scope. If I don't access that variable, it executes fine.
> 
> This tells me the block isn't being properly copied as it is inserted into 
> into the dictionary.
> 
> Is there something I can do to allow this to work? Thanks.
> 
> -- 
> Rick___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.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: Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Kyle Sluder
On Fri, Apr 8, 2011 at 5:25 PM, Rick Mann  wrote:
> Hi. In my garbage collection-required app, I'm trying to store a code block 
> (void (^)(void)) in a CFMutableDictionary. The docs says copy/retain/release 
> can be sent to a block, suggesting this can be done. But it's not working. 
> When I later retrieve the block and call it, I get an EXEC_BAD_ACCESS.
>
> This is when the block references an NSObject declared & allocated in the 
> block's enclosing scope. If I don't access that variable, it executes fine.

As explained in the Blocks Programming Guide, you should not allow
blocks that reference stack storage to escape that scope. See
"Patterns to Avoid":
http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/bxUsing.html

--Kyle Sluder
___

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

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

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

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


Re: Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Rick Mann
Hmm. Reading the docs there again, it also says:

"Typically, you shouldn’t need to copy (or retain) a block. You only need to 
make a copy when you expect the block to be used after destruction of the scope 
within which it was declared. Copying moves a block to the heap."

So, I expressly copied my block and stored the copy in the dictionary. That 
worked (I mistakenly conflated the fact that keys typically get copied, not 
objects).

Thanks.

-- 
Rick

On Apr 8, 2011, at 17:51 , Kyle Sluder wrote:

> On Fri, Apr 8, 2011 at 5:25 PM, Rick Mann  wrote:
>> Hi. In my garbage collection-required app, I'm trying to store a code block 
>> (void (^)(void)) in a CFMutableDictionary. The docs says copy/retain/release 
>> can be sent to a block, suggesting this can be done. But it's not working. 
>> When I later retrieve the block and call it, I get an EXEC_BAD_ACCESS.
>> 
>> This is when the block references an NSObject declared & allocated in the 
>> block's enclosing scope. If I don't access that variable, it executes fine.
> 
> As explained in the Blocks Programming Guide, you should not allow
> blocks that reference stack storage to escape that scope. See
> "Patterns to Avoid":
> http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/bxUsing.html
> 
> --Kyle Sluder

___

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

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

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

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


Re: NSDateFormatter setDoesRelativeDateFormatting: broken?

2011-04-08 Thread Laurent Daudelin
On Apr 8, 2011, at 17:26, Rick Mann wrote:

> On Apr 8, 2011, at 16:44 , Laurent Daudelin wrote:
> 
>>  NSDateFormatter *dateFormatter = [[NSDateFormatter 
>> alloc] initWithDateFormat:@"%Y-%m-%d %H:%M:%S" allowNaturalLanguage:YES];
> 
> My guess would be the format you're initting it with is overriding the 
> relative date setting. Try using "init" instead.

Yeah, that's what Gary Wade suggested privately and it's now working.

Thanks for the suggestion, Rick, much appreciated.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: Test for TCP port

2011-04-08 Thread Heizer, Charles
Thanks,
This is what I kind of suspected. Are there any wrappers around bsd socket to 
make it easier?

Thanks,
Charles



On Apr 8, 2011, at 5:17 PM, Dave Carrigan wrote:

> 
> On Apr 8, 2011, at 3:26 PM, Heizer, Charles wrote:
> 
>> What is the best way to test to see if a TCP port is reachable and will 
>> answer connections? I was trying to use NSSocketPort and NSConnection but 
>> I'm not getting a valid connection.
> 
> You have to connect to it. Unfortunately, neither NSSocketPort nor 
> NSConnection attempt to connect until you send data, so with those, you have 
> no way of immediately knowing that anything is actually listening. The best 
> way is to get down a level and use socket(2) and friends.
> 
> -- 
> Dave Carrigan
> d...@openshut.net
> Seattle, WA, USA
> 

--
Charles Heizer
Systems Management Solutions Group
Lawrence Livermore National Laboratory
P: 925-422-0197 



___

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

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

Help/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: Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Kyle Sluder
On Fri, Apr 8, 2011 at 5:56 PM, Rick Mann  wrote:
> Hmm. Reading the docs there again, it also says:
>
> "Typically, you shouldn’t need to copy (or retain) a block. You only need to 
> make a copy when you expect the block to be used after destruction of the 
> scope within which it was declared. Copying moves a block to the heap."
>
> So, I expressly copied my block and stored the copy in the dictionary. That 
> worked (I mistakenly conflated the fact that keys typically get copied, not 
> objects).

But it references a stack variable, which is going to get destroyed as
soon as the syntactical block enclosing the declaration of your code
block (*sigh* for namespace collision) goes out of scope.

If you reference a stack variable from your block, you cannot allow
that block to escape the scope of that variable.

--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: Storing a block in a CF/NSMutableDictionary?

2011-04-08 Thread Kyle Sluder
On Fri, Apr 8, 2011 at 9:03 PM, Kyle Sluder  wrote:
> If you reference a stack variable from your block, you cannot allow
> that block to escape the scope of that variable.

Well, I suppose it's worth mentioning that read-only NSObject
variables are okay to use in this fashion because the compiler is
smart enough to retain the object when the block gets copied. (Beware
any retain cycles this may create! See Mike Ash's MAZeroingWeakRef.)

I was under the impression you were using the variable for general purposes.

I should have just stuck with Dave's recommendation to ask you to post
your code…

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

2011-04-08 Thread Michael Dautermann

On Apr 8, 2011, at 7:29 PM, koko wrote:

> I am adding an iOS target to an existing project.
> 
> I am getting the errors:
> 
> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/WebServicesCore.framework/Headers/WSMethodInvocation.h:759:
>  error: 'CFXMLTreeRef' has not been declared
> 
> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:8142:
>  error: 'CGDirectDisplayID' does not name a type

CGDirectDisplayID is purely a MacOS X thing.

Are you trying to add an iOS target to a project that builds Macintosh apps?


___

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

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

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

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