Plugin Information

2008-04-14 Thread Rick Langschultz

Hello everyone,

My application uses plugins from a support folder in /Library/ 
Application Support/AppName/Plugins/. The application searches this  
folder for all the plugins and loads them. But here is my dilemma: i  
want to put the plugin class name as the bundle identifier so that i  
can call methods from those classes when something in the main  
application is triggered.


For instance, I have a plugin called A.plugin, B.plugin, and C.plugin  
with Principal Classes named APluginClass, BPluginClass, and  
CPluginClass respectively. They conform to AppNameProtocol which has  
an installation, allocation/init, dealloc, and other class names.


My code uses NSString *bundlePath, and NSBundle *bundle. I want to  
have something like *bundlePathA, *bundlePathB, etc; and *bundleA,  
*bundleB, *bundleC. Is there a simple way that I can do this?


I have researched NSBundle on the Developer docs, and on apple.com,  
along with some code on google.com/codesearch .


Can anyone give me a pointer or two?

Thanks,

Rick L.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Accessing Directory.app shared contacts

2008-04-14 Thread Kyle Sluder
On Sat, Apr 12, 2008 at 11:02 AM, Tito Ciuro [EMAIL PROTECTED] wrote:
 The data is stored in the OpenDirectory respository. Shared Contacts are
 stored under 'People'. You'll probably need to use the Directory Services
 API to manipulate the data.

That's what I feared.  Unfortunately the schema used for these
contacts is non-standard, and while trivial to deduce it's as always
preferable to use a standardized approach to getting a task done.  I
sure hope there are plans for Address Book to see this information
(and eventually merge/be supplanted by Directory.app).

--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 [EMAIL PROTECTED]


Re: Plugin Information

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 2:30 AM, Rick Langschultz [EMAIL PROTECTED] wrote:
  My code uses NSString *bundlePath, and NSBundle *bundle. I want to have
 something like *bundlePathA, *bundlePathB, etc; and *bundleA, *bundleB,
 *bundleC. Is there a simple way that I can do this?

What exactly are you trying to do?  Use variable names that are
defined at runtime?  You should already know that this is nonsensical
in C.

I think you're really looking for a mapping from bundle identifier to
class instance.  That already exists.  Once you've loaded the bundle,
you can use +[NSBundle bundleWithIdentifier:] to get it again
elsewhere, then use -[NSBundle principalClass] to get its principal
class.  Then +alloc/-init as normal.

--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 [EMAIL PROTECTED]


Re: Plugin Information

2008-04-14 Thread Uli Kusterer

Am 14.04.2008 um 08:30 schrieb Rick Langschultz:
My application uses plugins from a support folder in /Library/ 
Application Support/AppName/Plugins/. The application searches this  
folder for all the plugins and loads them. But here is my dilemma: i  
want to put the plugin class name as the bundle identifier so that i  
can call methods from those classes when something in the main  
application is triggered.


 You're not really making sense here: You can set the bundle  
identifier in the Properties tab of the Target Info window in Xcode.  
There's also a field for the principal class name. You really do not  
want to force the bundle identifier and class name to be the same.  
That's not the purpose of these two fields. The bundle ID is for  
uniquely identifying a plugin, not just across all plugins for your  
app, and not just across all developers who might write plugins for  
your app (so that e.g. Microsoft's 'Load WMF file' plugin can be  
distinguished from your own), but also across all plugins on a  
particular Mac, no matter what app they're for. Using a class name as  
a bundle ID is asking for collisions, and someone is bound to look up  
the wrong bundle and try to load the wrong kind of file. Don't abuse  
the bundle ID.


For instance, I have a plugin called A.plugin, B.plugin, and  
C.plugin with Principal Classes named APluginClass, BPluginClass,  
and CPluginClass respectively. They conform to AppNameProtocol which  
has an installation, allocation/init, dealloc, and other class names.


My code uses NSString *bundlePath, and NSBundle *bundle. I want to  
have something like *bundlePathA, *bundlePathB, etc; and *bundleA,  
*bundleB, *bundleC. Is there a simple way that I can do this?


 Do what? If you mean, look up a bundle based on its class name, then  
you can use an NSDictionary to associate class name with NSBundle  
objects. This also works for the other way round, but in that case you  
could just use the principalClass method of a particular NSBundle  
object.


 Does that help? If not, it may help to illustrate what you're having  
trouble with by giving us more information, in particular giving us a  
concrete example of what you're trying to do, plus maybe even code  
that illustrates the problem.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

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

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

This email sent to [EMAIL PROTECTED]


RE: A question about Tabviews and tabview items

2008-04-14 Thread Francisco Tolmasky

Take a look at drawLabel:inRect and sizeOfLabel: in NSTabViewItem

If however, you want do something more complex, consider putting the  
tabview in borderless mode, making your own UI around it, and just  
calling selectTabViewItem: appropriately.



Francisco

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Window moved when dock appears.

2008-04-14 Thread Uli Kusterer

Am 13.04.2008 um 19:56 schrieb Mohsan Khan:
I have a window (NSBorderlessWindowMask), this window gets pushed  
away when my Dock appears from being hidden.


How can I bypass this behaviour for my window?



I think you should override:

 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen  
*)screen;


to just return the frameRect it is given, unchanged.

I thought there was a flag to get this behaviour automagically, but I  
can't find it right now. Maybe I just wrote a custom subclass that has  
this feature and forgot about it.


 Others have already warned you about not covering up the dock  
because users get annoyed when that happens. But I guess if you're  
trying to do some graphical overlay or full-screen app it may be OK.  
Though in the case of a full-screen app, you may want to check out  
hiding the menu bar, that usually also hides the dock, IIRC, and fixes  
the issue in a much more elegant way. There's also a special kiosk  
mode for full screen apps that may be used to implement behaviour  
many full screen apps need.


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Window moved when dock appears.

2008-04-14 Thread Kyle Sluder
On Sun, Apr 13, 2008 at 1:56 PM, Mohsan Khan [EMAIL PROTECTED] wrote:
  How can I bypass this behaviour for my window?

First, unless your window does not need to be clickable or visible at
all, don't do this.  Pro Tools doesn't move when the dock pref is
changed, and it annoys the hell out of me, especially when its resize
widget is behind the dock.

If you do have a good reason (which I can't think of), then try
setting your window's level to be below that of a normal window, like
0, and see if that does the trick.

--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 [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 604

2008-04-14 Thread Julian James
Hi,

Sounds good to me if it means I save money! How does it work when I go on 
holiday, as I will in May for 2 weeks or when I'm between contracts and have no 
income?

Julian

 
On Monday, April 14, 2008, at 10:01AM, [EMAIL PROTECTED] wrote:
Send Cocoa-dev mailing list submissions to
   cocoa-dev@lists.apple.com

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

You can reach the person managing the list at
   [EMAIL PROTECTED]

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


Today's Topics:

   1. NSMatrix Content Binding (Seth Willits)
   2. Re: Window moved when dock appears. (Seth Willits)
   3. Re: Core Data -- [NSCFArray member:]: unrecognized selector
  --   solved my own problem (Dan Knapp)
   4. Running a Choose Template Sheet (Kip Nicol)
   5. Re: Why should we set ivars to nil in dealloc? (Bill Bumgarner)
   6. Re: A question about Tabviews and tabview items (Sean Murphy)
   7. Re: Running a Choose Template Sheet (Sean Murphy)
   8. Using Properties at Outlets (Steve Sheets)
   9. Re: Using Properties at Outlets (Seth Willits)
  10. NSDateFormatter giving different results in different
  programs (Derrick Bass)
  11. Plugin Information (Rick Langschultz)
  12. Re: Accessing Directory.app shared contacts (Kyle Sluder)
  13. Re: Plugin Information (Kyle Sluder)
  14. Re: Plugin Information (Uli Kusterer)
  15. RE: A question about Tabviews and tabview items
  (Francisco Tolmasky)
  16. Re: Window moved when dock appears. (Kyle Sluder)
  17. Re: Window moved when dock appears. (Uli Kusterer)


--

Message: 1
Date: Sun, 13 Apr 2008 19:57:54 -0700
From: Seth Willits [EMAIL PROTECTED]
Subject: NSMatrix Content Binding
To: cocoa dev cocoa-dev@lists.apple.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Howdy,


I have a matrix of radio buttons that I'm trying to bind-ify. The two  
options in the matrix should shown with the titles:

   Mac OS Extended
   Mac OS Extended Journaled

The *values* of these two items should be:
   
   HFS+
   Journaled HFS+

Then what I'd like to do is bind the selectedValue of the matrix  
(which would be either HFS+ or Journaled HFS+) to a string  
property in my model.



I can bind the content of the matrix to my model's diskImageFormats  
key path which would be:

- (NSArray *)diskImageFormats;
{
   return [NSArray arrayWithObjects:@Mac OS Extended, @Mac OS  
Extended (Journaled), nil];
}


...and that properly sets the titles of the two buttons, but the  
values are still the titles. So I *thought* could simply bind  
contentValues to another key path such as:

- (NSArray *)diskImageFormatValues;
{
   return [NSArray arrayWithObjects:@HFS+, @Journaled HFS+, nil];
}

...but this doesn't work, because apparently the key path of  
contentValues must have the content key path as a prefix, such as  
diskImageFormat.value which entails a certain organization that  
seems to be too far off from what I need.



Is there a way to do what I want to do?



--
Seth Willits






--

Message: 2
Date: Sun, 13 Apr 2008 20:00:51 -0700
From: Seth Willits [EMAIL PROTECTED]
Subject: Re: Window moved when dock appears.
To: cocoa dev Cocoa-dev@lists.apple.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

On Apr 13, 2008, at 10:56 AM, Mohsan Khan wrote:

 I have a window (NSBorderlessWindowMask), this window gets pushed  
 away when my Dock appears from being hidden.

Huh. I wouldn't expect it to do that given that it's borderless.



 How can I bypass this behaviour for my window?

 Should I use applicationDidChangeScreenParameters and reposition the  
 window, or is there an option to make my window not care about the  
 Dock appearing?

It'd probably be easier to just override setFrame in a window subclass  
and make sure it's always what it should be. Just a thought.



--
Seth Willits






--

Message: 3
Date: Sun, 13 Apr 2008 23:02:33 -0400
From: Dan Knapp [EMAIL PROTECTED]
Subject: Re: Core Data -- [NSCFArray member:]: unrecognized selector
   --  solved my own problem
To: cocoa-dev@lists.apple.com
Message-ID:
   [EMAIL PROTECTED]
Content-Type: text/plain; charset=UTF-8

Naturally, right after I gave up on solving it for the night, I guessed the
solution.
I figured I'd reply to myself and say that, to save others the trouble of
trying.
It was indeed something embarrassingly simple: I had accidentally created a
method with the same name as an accessor which otherwise would have been
autogenerated, overriding it.  Changing the name of that method made it all
work.

Oh well - 

Re: Accessing Directory.app shared contacts

2008-04-14 Thread Alexander Hartner
You could always use ABxLDAP (http://www.addressbookserver.com) to
transfer contacts from you standard OS X Address Book to an LDAP
directory. It uses the iSync API and runs in the back-ground.

Have fun
Alex

 On Sat, Apr 12, 2008 at 11:02 AM, Tito Ciuro [EMAIL PROTECTED] wrote:
 The data is stored in the OpenDirectory respository. Shared Contacts are
 stored under 'People'. You'll probably need to use the Directory
 Services
 API to manipulate the data.

 That's what I feared.  Unfortunately the schema used for these
 contacts is non-standard, and while trivial to deduce it's as always
 preferable to use a standardized approach to getting a task done.  I
 sure hope there are plans for Address Book to see this information
 (and eventually merge/be supplanted by Directory.app).

 --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/alex%40j2anywhere.com

 This email sent to [EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


NSTableView memory usage

2008-04-14 Thread Valentin Dan
Hi,

 

I have a NSTableView object with 3 columns and an average of 30 characters per 
cell.

 

At 1500 rows,  “ps –A -u” reports it uses 39.0% memory (there is 1GB of memory 
on this Mac). After the panel containing the NSTableView is closed, the app 
uses 1.8% (just as before opening it). The panel in question doesn’t have 
anything else on it …

 

So is this a major memory leak or a normal situation?

 

Thanks!

 

___

Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   

Email: HYPERLINK mailto:[EMAIL PROTECTED][EMAIL PROTECTED] 
Office: +40 356-710158

Masstech Group Inc.  Fax:+40 256-220912

HYPERLINK http://www.masstechgroup.com/http://www.masstechgroup.com 

 

THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.13/1376 - Release Date: 13.04.2008 
13:45
 
___

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

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

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

This email sent to [EMAIL PROTECTED]


ld: total output size exceeds 2GB (2033MB)

2008-04-14 Thread younker yang
Hi, All, 

This is my first post on this mailing list, I checked out cogx from SVN, and
change the project settings to be xcode 3.1 compatible, but when I build the
WMA.framework, I got the following error,
It seems there is some error on link configuration.

Can anyone help me to solve this issue?

Ld 
/Users/younker/Developer/cogosx/cog/Frameworks/WMA/../../build/Release/WMA.f
ramework/Versions/A/WMA normal i386
cd /Users/younker/Developer/cogosx/cog/Frameworks/WMA
/Developer/usr/bin/gcc-4.2 -arch i386 -dynamiclib -isysroot
/Developer/SDKs/MacOSX10.5.sdk
-L/Users/younker/Developer/cogosx/cog/Frameworks/WMA/../../build/Release
-F/Users/younker/Developer/cogosx/cog/Frameworks/WMA/../../build/Release
-filelist 
/Users/younker/Developer/cogosx/cog/Frameworks/WMA/../../build/WMA.build/Re
lease/WMA Framework.build/Objects-normal/i386/WMA.LinkFileList
-install_name /Users/younker/Library/Frameworks/WMA.framework/Versions/A/WMA
-mmacosx-version-min=10.5 -liconv -Wl,-single_module -compatibility_version
1 -current_version 1 -o
/Users/younker/Developer/cogosx/cog/Frameworks/WMA/../../build/Release/WMA.f
ramework/Versions/A/WMA
ld: total output size exceeds 2GB (2033MB)
collect2: ld returned 1 exit status

Best regards.
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ld: total output size exceeds 2GB (2033MB)

2008-04-14 Thread Alastair Houghton

On 14 Apr 2008, at 20:35, younker yang wrote:

This is my first post on this mailing list, I checked out cogx from  
SVN, and
change the project settings to be xcode 3.1 compatible, but when I  
build the

WMA.framework, I got the following error,
It seems there is some error on link configuration.

Can anyone help me to solve this issue?


You want the xcode-users list, not cocoa-dev.

Kind regards,

Alastair.

--
http://alastairs-place.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 [EMAIL PROTECTED]


To write to a file

2008-04-14 Thread Nick Rogers

Hi,
I have to write some data to file in sequence.
what methods can I use?
NSFileManager has method for creating a file but not for writing to  
file.


Thanks,
Nick
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Why should we set ivars to nil in dealloc?

2008-04-14 Thread Tony Becker

OK. My $0.02

To answer the original question...
We live in an Object world, where we like to re-use things.
So, for example, I have an object hierarchy of view controllers.
	In -awakeFromNib:, I use a instantiate and use a iVar. In dealloc, I  
release it.
	However, under the covers, I DON'T call [super -awakeFrommNib:],  
because my parent didn't awake from his .nib.
	But, in dealloc, I call [super dealloc], so my parent gets called  
(and eventually NSObject)
	Assuming that, in his awakeFromNib:, my parent used the same iVar (or  
more correctly, I'm re-using it), he too will release it, which is BAD.
	So, he needs to check if it's nil before releasing it (yes, Obj-C  
will ignore the release to a nil object), and thus, more importantly,  
and to the question at hand, I need to set it to nil, in my dealloc,  
when I'm done with it.


	Technically, you got the ivar nil-ed out, and it's good form to put  
it back the way you found it.


On Apr 13, 2008, at 11:39 PM, Bill Bumgarner wrote:


On Apr 13, 2008, at 6:35 PM, Ben Trumbull wrote:

Seriously, we're arguing about this ?


If you want a total hack, just assign (id) 0x1 to any variable that


... please step away from the tequila.


Heh.  No amount of testing (see below for framing of this statement)  
will catch every fault.I like my software to fail  
catastrophically throughout the beta period (or pre-submission  
period, in many cases) if anything I didn't catch in testing falls  
through the cracks.   Nor can you expect to have all the full-on  
testing goop enabled outside of your development environment.


For example, how long does the typical app run for with libgmalloc  
hanging out and chewing up pages?



Running unit tests through debugging tools (zombies, leaks, etc)  
nightly has been the single highest return on effort debugging  
decisions I've ever seen.


Ever.  Seen.

The second highest was actually writing the unit tests in the first  
place, a necessary prerequisite, but more effort.


Just imagine what you could do mixing this stuff with dtrace ...


But, really, what Ben said.  Seriously.   Unit tests, automated  
tests, and doing them continuously goes a really really long way to  
minimizing defect analysis pain.


Applying the system provided analysis tools during testing runs is  
relatively easy and extremely useful, too. The tools are there,  
might as well use 'em.


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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


hooking into another app

2008-04-14 Thread Don Arnel

Hi all,

I've only been developing using Xcode for about 5 weeks now (long-time  
Windows programmer). I am attempting to write a Cocoa app that I would  
like to have hook into a text chat window from another app so that I  
can log the incoming messages. The other app does not belong to my app.


If anyone could point me to some help topics on how this can be  
accomplished I would greatly appreciate it.


Thanks!
- Don
___

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

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

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

This email sent to [EMAIL PROTECTED]


mouseMoved: behaving correctly when application isn't frontmost

2008-04-14 Thread Mattias Arrelid
Hi all,

Our application it setup to forward all mouse moved events to our
content view, regardless if our application is the frontmost one. Now,
we have some areas of the content view that are to be highlighted when
the mouse hovers over them. This works ok (with work, I mean it looks
acceptable) if the area in question is fully visible, e.g. our content
view and the tracking area are not covered by another window. What
does not work is when the tracking rect is partially covered - it
looks strange if the mouse pointer is hovering over another window
covering our window, and we start highlight stuff in our window... Get
me?

To see what I mean (and how I want to solve the problem); open up
Safari (i have 3.1 installed). Make sure that you have a couple of
bookmarks in the bookmark bar. Now, make another application the
frontmost application. Move the new application's window so that it
partially covers one of the bookmark items. When hovering over the
(now inactive) Safari window and the partially covered bookmark item,
the item will highlight while the window directly under the mouse
pointer is Safari - otherwise it does _not_ highlight.

How can you tell, inside mouseMoved: or similar, if the window
beloning to the view isn't covered by another window where the mouse
pointer currently is?

Thanks in advance
Mattias
___

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

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

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

This email sent to [EMAIL PROTECTED]


warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread yang younker
Hi,  All, 

I had made a simple login dialog by interface builder, but when I built this
xib file in xcode, I got the following errors
CompileXIB /Users/younker/Developer/Example1/English.lproj/MainMenu.xib
cd /Users/younker/Developer/Example1
/Developer/usr/bin/ibtool --errors --warnings --notices --output-format
human-readable-text --compile
/Users/younker/Developer/Example1/build/Debug/Example1.app/Contents/Resource
s/English.lproj/MainMenu.nib
/Users/younker/Developer/Example1/English.lproj/MainMenu.xib
/* com.apple.ibtool.document.notices */
/* com.apple.ibtool.document.warnings */
/Users/younker/Developer/Example1/English.lproj/MainMenu.xib:460: warning:
Image scaling is not supported on Mac OS X versions prior to 10.5.
/Users/younker/Developer/Example1/English.lproj/MainMenu.xib:458: warning:
Image scaling is not supported on Mac OS X versions prior to 10.5.
/* com.apple.ibtool.document.errors */


What does this mean? I don¹t change the attributes related to images in the
simple login window.


Best Regards.
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Thomas Davie
Someone may correct me if I'm wrong, but that sounds a lot like  
something that has been very very deliberately left out of any API...


I want to write an app that I'd like to have hook into a text box in  
Safari and log your IDs, passwords, and bank account status.


Thanks

Bob

On 14 Apr 2008, at 13:30, Don Arnel wrote:

Hi all,

I've only been developing using Xcode for about 5 weeks now (long- 
time Windows programmer). I am attempting to write a Cocoa app that  
I would like to have hook into a text chat window from another app  
so that I can log the incoming messages. The other app does not  
belong to my app.


If anyone could point me to some help topics on how this can be  
accomplished I would greatly appreciate it.


Thanks!
- Don
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


loading the universal bundle

2008-04-14 Thread anoop.varughese
Hi All,

 I need to run the Automator action Ask for Photos from
System/Library/Automator/Ask for Photos.action on Mac OSX.4 Tiger.I did
not find much supporting document using Objective-c.

I added following codes  for running the action.

NSDictionary *dict=[NSDictionary infoDictionary];
aAct=[[AMBundleAction alloc] initWithDefinition:dict fromArchives:YES];

select=[[AMBundleAction alloc] runWithInput:nil fromAct:act error:dr];



But my workflow is not running.How can i run the ActomatorAction without
using AMWrokflow class.I am getting my desired result by using the
Leopard specific API.

I prefer to use Objective-c only.
Hope some one can guide me into right direction.
Thanks in Advance.


Regards,
Anoop T Varughese.



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.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 [EMAIL PROTECTED]


Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
You and one other both made this suggestion to me and examining it, it  
is certainly the easiest and most logical way to go. Which is probably  
why it did not occur to me. Thank you very much for your suggestion, I  
think this is the approach I will use.


On Apr 13, 2008, at 9:26 PM, Sean Murphy wrote:


On Apr 13, 2008, at 6:24 PM, Development wrote:

Is it possible to create a tabview who's tabviewitems have a custom  
look, For instance, the label is horizontal when the tabs are on  
the side, or can have icons? If so could I get a pointer to some  
info as I cant seem to find any.


Rather than subclassing NSTabView (since it does not really expose  
any mechanism to override tab drawing), custom tabs can be  
implemented by hiding the NSTabView's tab buttons and utilizing a  
completely separate custom tab bar view containing your buttons.   
The custom view would then oversee the actual NSTabView's selection,  
set as its delegate to monitor outside selection changes, and would  
itself switch to the proper NSTabViewItems when clicked.


For some examples of this approach, take a look at what we do in  
Camino: http://mxr.mozilla.org/seamonkey/source/camino/src/browser/BrowserTabBarView.mm 



And see the excellent PSMTabBarControl:
http://code.google.com/p/maccode/source/browse/trunk/Utilities/PSMTabBarControl/source/ 



-Murph


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
Thank you very much for the suggestion. This looks to me to be the  
best approach to use so I will forgo the very complex subclassing of  
NSTabView I had begun in favor of this.



On Apr 14, 2008, at 1:49 AM, Francisco Tolmasky wrote:


Take a look at drawLabel:inRect and sizeOfLabel: in NSTabViewItem

If however, you want do something more complex, consider putting the  
tabview in borderless mode, making your own UI around it, and just  
calling selectTabViewItem: appropriately.



Francisco



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 10:00 AM, Thomas Davie [EMAIL PROTECTED] wrote:
 Someone may correct me if I'm wrong, but that sounds a lot like something
 that has been very very deliberately left out of any API...

  See the many discussions regarding input managers.

  I want to write an app that I'd like to have hook into a text box in
 Safari and log your IDs, passwords, and bank account status.

  Well, password fields are special and are 'resistant' to key
logging, but you don't have to 'hook into' any apps to log the rest.
You don't even need an input manager.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread I. Savant
I want to write an app that I'd like to have hook into a text box in
   Safari and log your IDs, passwords, and bank account status.

   Well, password fields are special and are 'resistant' to key
  logging, but you don't have to 'hook into' any apps to log the rest.
  You don't even need an input manager.

  I realized as soon as I hit 'send' that this was unclear.

  To log everything but passwords, simple keylogging can be employed
without an input manager or otherwise talking with the other
applications. The event dispatch system will happily help you with
that 'problem' (using Carbon).

  Passwords, etc, can be gotten via input managers I believe. I think
this is how 1Password works. Password fields are, however, resistant
to key logging as I said.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


[job posting] Senior OSX C++ Developer for Contract

2008-04-14 Thread Paul Wilkinson
Soma Engineering is looking to hire a seasoned OSX engineer on contract
basis. The project involves porting a middleware audio product from Windows
to OSX. The product is an audio system for video games.

Required qualifications are (1) At least 5 years C++ professional
development experience; (2) Solid OSX experience; (3) Core Audio experience;
and (5) Subversion experience.  You should have some experience with any of
(1) Shipping middleware; (2) Video Games; (3) Porting from Windows; or (4)
Windows Development Experience.

We are looking for somebody that is accustomed to working with shared code
bases, and that can establish a maintainable structure for ongoing
maintenance.

Working remotely is fine. We're in the SF Bay Area. You must be able to work
legally in the USA.

Please reply with resume to jobs 'at' cremoni.com [EMAIL PROTECTED]. Please
do not reply to this list!

Regards,

Paul Wilkinson
Soma Engineering
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Don Arnel

No...no...NO!

Re-read my message. If it was unclear, what I want to do is be able to  
log (record) text being written to a chat window from another app. NOT  
log key strokes. For example, how could I progmatically record an  AIM  
chat conversation from my app?


On Apr 14, 2008, at 10:00 AM, Thomas Davie wrote:

Someone may correct me if I'm wrong, but that sounds a lot like  
something that has been very very deliberately left out of any API...


I want to write an app that I'd like to have hook into a text box  
in Safari and log your IDs, passwords, and bank account status.


Thanks

Bob

On 14 Apr 2008, at 13:30, Don Arnel wrote:

Hi all,

I've only been developing using Xcode for about 5 weeks now (long- 
time Windows programmer). I am attempting to write a Cocoa app that  
I would like to have hook into a text chat window from another  
app so that I can log the incoming messages. The other app does not  
belong to my app.


If anyone could point me to some help topics on how this can be  
accomplished I would greatly appreciate it.


Thanks!
- Don
___

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

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

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


This email sent to [EMAIL PROTECTED]




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Menu items vs modal sessions

2008-04-14 Thread Pierre Bernard

Thanks for the insights Keary.

I did indeed expect to get some of the behavior for free, but didn't.

This is probably due to the fact that I am using bindings to bind menu  
items to controller actions. I guess one gets the free behavior only  
when using target/action connections on the first responder.


Maybe the right way of doing things with bindings is to put the  
controller into an NSObjectController and pull it out / swap it when a  
modal window comes up. This would approximate the responder chain logic.


Best,
Pierre

On 13 Apr 2008, at 21:25, Keary Suska wrote:


If you already get certain behavior for free, why complexify it  
needlessly?

What problem are you trying to solve? If you have menu items that are
enabled during certain modal sessions, and you specifically don't  
want them
to, then you should look at your application design and adjust  
accordingly.

So, I guess to answer your questions, I would say, probably not.

Better to follow the ways that AppKit wants you to do things (such as
intelligent use of the responder chain), rather than jerry-rig a  
band-aid

solution.




---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com





smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 10:26 AM, Don Arnel [EMAIL PROTECTED] wrote:
 No...no...NO!

  Alright. Now how about we take a few deep breaths, switch to decaf,
and try our social interaction again. This time without the attitude,
please.

  Re-read my message. If it was unclear, what I want to do is be able to log
 (record) text being written to a chat window from another app. NOT log key
 strokes. For example, how could I progmatically record an  AIM chat
 conversation from my app?

  Understood - in this case, it's unsupported system hack time, since
the Mac OS X world takes a different approach to security which means
you have to work a bit harder.

  If you really want to do this, I'd recommend looking into
Application Enhancer. There's a fair amount of controversy about this
topic - and I have no intention of being drawn into yet another APE
debate thread - but it's the clearest path to what you're trying to
accomplish. You'd write an APE Module which could conceivably
intercept whatever you wish and forward it along.

  The drawback to this is that if you don't write it perfectly, bad
(and weird) things can happen with every app into which it's injected.
You'll have to make some assumptions, etc. which can easily backfire
the next time the target application is updated by the user. This can
(rightly) upset people. Be warned.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Keary Suska
on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said:

 Re-read my message. If it was unclear, what I want to do is be able to
 log (record) text being written to a chat window from another app. NOT
 log key strokes. For example, how could I progmatically record an  AIM
 chat conversation from my app?

You can't, at least not without the application's cooperation, such as being
a plugin, using OSA, etc. With a *user's* (or administrator's) cooperation,
you could have an app that acts as a proxy. Another option would involve a
kernel extension, and that may be more work than it is worth.

Best,

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: HUD-style panel controls?

2008-04-14 Thread douglas a. welton

Jacob,

You may want to look at applying one or more of the numerous filters  
available to you when you make your controls layer backed.  I did this  
with most of the controls in my HUD for an image editing application  
and it works just fine.  Color Monochrome is your friend!


Using filters avoids all of the hueristics of modifying controls to  
use custom imagery.  Note:  Applying a filter to most text will  
product crappy-looking text. In my case, I simply used white text.


later,

douglas

On Apr 12, 2008, at 10:01 PM, Jacob Bandes-Storch wrote:

I'm adding a HUD panel to my application. Looking around, I don't  
see a way to get the proper style of controls easily. The Human  
Interface Guidelines say that HUD controls should be white with  
gray accents and use white or gray text. And yet I don't see a way  
to get these controls (gray sliders, semitransparent buttons, etc.)  
in Interface Builder. Am I missing something?

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Florian Soenens

Maybe if the log is written to a file, you can read in that file.
But that won't be real-time logging of course.

Regards,
Flor.

On 14 Apr 2008, at 16:49, Keary Suska wrote:


on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said:

Re-read my message. If it was unclear, what I want to do is be able  
to
log (record) text being written to a chat window from another app.  
NOT
log key strokes. For example, how could I progmatically record an   
AIM

chat conversation from my app?


You can't, at least not without the application's cooperation, such  
as being
a plugin, using OSA, etc. With a *user's* (or administrator's)  
cooperation,
you could have an app that acts as a proxy. Another option would  
involve a

kernel extension, and that may be more work than it is worth.

Best,

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


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/florian.soenens%40nss.be

This email sent to [EMAIL PROTECTED]




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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

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

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

This email sent to [EMAIL PROTECTED]


Re: Why should we set ivars to nil in dealloc?

2008-04-14 Thread j o a r


On Apr 14, 2008, at 5:29 AM, Tony Becker wrote:
	In -awakeFromNib:, I use a instantiate and use a iVar. In dealloc,  
I release it.
	However, under the covers, I DON'T call [super -awakeFrommNib:],  
because my parent didn't awake from his .nib.
	But, in dealloc, I call [super dealloc], so my parent gets called  
(and eventually NSObject)
	Assuming that, in his awakeFromNib:, my parent used the same iVar  
(or more correctly, I'm re-using it), he too will release it, which  
is BAD.



The class that adds an instance variable is ultimately responsible for  
clearing it in dealloc. You are not responsible for managing the  
destruction of any instance variables of your superclass. If your  
superclass expose an instance variable for connecting objects in IB,  
you should trust that it deals with them in dealloc.


Directly accessing the instance variables of another class, including  
your superclass, is fraught with peril and typically incorrect. Always  
use accessor methods / properties for that type of situation.


Also keep in mind what I said earlier in this thread about calling out  
from init/dealloc - It's dangerous!


j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMatrix Content Binding

2008-04-14 Thread Keary Suska
on 4/13/08 8:57 PM, [EMAIL PROTECTED] purportedly said:

 I have a matrix of radio buttons that I'm trying to bind-ify. The two
 options in the matrix should shown with the titles:
 
 Mac OS Extended
 Mac OS Extended Journaled
 
 The *values* of these two items should be:
 
 HFS+
 Journaled HFS+
snip 
 
 Is there a way to do what I want to do?

If changing your array to an array of dictionaries is not acceptable, you
could use a custom NSValueTransformer.

Best,

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Menu items vs modal sessions

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 10:28 AM, Pierre Bernard [EMAIL PROTECTED] wrote:
  This is probably due to the fact that I am using bindings to bind menu
 items to controller actions. I guess one gets the free behavior only when
 using target/action connections on the first responder.

Just for kicks, check to see what happens when you have directly
connected an NSMenuItem to a target (not using the responder chain).
Does AppKit automatically disable it when modal?  If so, then a
workaround might be to have a proxy object whose target and action are
bound using bindings, and then directly connect your menu item to this
proxy object.

In either case, file an enhancement request at
http://bugreport.apple.com so that this situation can be fixed.

--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 [EMAIL PROTECTED]


Re: NSTableView memory usage

2008-04-14 Thread j o a r


On Apr 14, 2008, at 3:15 AM, Valentin Dan wrote:
At 1500 rows,  “ps –A -u” reports it uses 39.0% memory (there is 1GB  
of memory on this Mac). After the panel containing the NSTableView  
is closed, the app uses 1.8% (just as before opening it). The panel  
in question doesn’t have anything else on it …


So is this a major memory leak or a normal situation?



If this is normal or not probably depends on the size of the objects  
that you represent in the table view. You might only expose the name  
property of an object in the table view, but the object itself could  
of course have a ton of other properties that uses up a lot of memory.


As you get back the memory when you close the panel, it doesn't sound  
like you have a memory leak per se.


Whenever you think that you use too much memory, or want to track down  
some of the memory that you inevitably leak, I'd suggest that you take  
a look at the performance tool Instruments, in particular the Object  
Allocations and Leaks templates that should be able to answer these  
questions.


j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMatrix Content Binding

2008-04-14 Thread Keary Suska
on 4/13/08 8:57 PM, [EMAIL PROTECTED] purportedly said:

 I have a matrix of radio buttons that I'm trying to bind-ify. The two
 options in the matrix should shown with the titles:
 
 Mac OS Extended
 Mac OS Extended Journaled
 
 The *values* of these two items should be:
 
 HFS+
 Journaled HFS+
 
 Then what I'd like to do is bind the selectedValue of the matrix
 (which would be either HFS+ or Journaled HFS+) to a string
 property in my model.

BTW, as you saw but maybe didn't notice, the contentValues binding
indicates what the titles of the matrix will be. The contentObjects
binding would indicate what object is set on selection, and can correspond
to the slectedObject binding.

Best,

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Using Properties at Outlets

2008-04-14 Thread Randall Meadows

On Apr 13, 2008, at 10:46 PM, Steve Sheets wrote:
Has anyone had any problems with creating Properties with Objective- 
C 2.0 that are also Outlets?


I been using this inside my code, and I want to be sure there is no  
problems with this. I create fairly standard (readonly) and  
(readwrite, copy) properties using ivars, @property and @synthesize.  
I place IBOutlet in front of the ivar like thus:


[snip]

The documentation does not explicitly say you can do this. I just  
want to know if anyone has seen an issue?


I just completed a rewrite of a program for a client, and made copious  
use of properties as IBOutlets.  I did not see any problems at all.


Well, except for that method I wrote that looked *exactly* like a  
setter, but wasn't; but that was a PEBCAK...and a doozy to debug.


randy
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread Nathan Vander Wilt

On Apr 14, 2008, at 6:12 AM, yang younker wrote:

/* com.apple.ibtool.document.notices */
/* com.apple.ibtool.document.warnings */
/Users/younker/Developer/Example1/English.lproj/MainMenu.xib:460:  
warning:

Image scaling is not supported on Mac OS X versions prior to 10.5.
/Users/younker/Developer/Example1/English.lproj/MainMenu.xib:458:  
warning:

Image scaling is not supported on Mac OS X versions prior to 10.5.
/* com.apple.ibtool.document.errors */


This means your NIB/XIB has a deployment target not equal to 10.5.x,  
but you have some sort of button or other view whose Scaling setting  
is not None. If you go into Interface Builder, and go to your file's  
Info window, it will show a list of all these warnings. Either change  
your deployment target, or click each warning to pull up the  
problematic view in the inspector window and set its Scaling to  
None. It may be alright to ignore these warnings, I don't know.


hope this helps,
-natevw
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Nathan Vander Wilt

On Apr 13, 2008, at 7:15 AM, Carter R. Harrison wrote:
CGContextRef context = [[NSGraphicsContext currentContext]  
graphicsPort];
CGContextDrawLayerInRect(context, CGRectMake([self frame].origin.x,  
[self frame].origin.y, [self frame].size.width, [self  
frame].size.height), cgback);


cgback is a instance variable pointing to a CGLayer.

So my code works, the correct things are being drawn to my view  
(more or less), but what happens is that after several seconds of  
use, the app crashes and I get an EXC_BAD_ACCESS error.



Can you post more information regarding your cgback variable? How is  
it being allocated? That parameter seems to be the most likely culprit.


-nvw
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTableView memory usage

2008-04-14 Thread John Stiles
I think Instruments could do a better job of telling you what's going 
wrong than we could.


FWIW, the table view doesn't even know the contents of most of your 1500 
rows. It asks for them from the data source as it needs them, and 
probably only knows the values of the currently visible cells.



Valentin Dan wrote:

Hi,

 


I have a NSTableView object with 3 columns and an average of 30 characters per 
cell.

 


At 1500 rows,  “ps –A -u” reports it uses 39.0% memory (there is 1GB of memory 
on this Mac). After the panel containing the NSTableView is closed, the app 
uses 1.8% (just as before opening it). The panel in question doesn’t have 
anything else on it …

 


So is this a major memory leak or a normal situation?

 


Thanks!

 


___

Valentin Dan, Software Developer Direct: +1 905 886 1833 ext.3047   


Email: HYPERLINK mailto:[EMAIL PROTECTED][EMAIL PROTECTED] 
Office: +40 356-710158

Masstech Group Inc.  Fax:+40 256-220912

HYPERLINK http://www.masstechgroup.com/http://www.masstechgroup.com 

 


THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 



No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.13/1376 - Release Date: 13.04.2008 13:45
 
___


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

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

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

This email sent to [EMAIL PROTECTED]
  

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Christopher Nebel

On Apr 14, 2008, at 8:24 AM, Oliver Quas wrote:


Am 14.04.2008 um 16:58 schrieb Florian Soenens:






on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said:

Re-read my message. If it was unclear, what I want to do is be  
able to
log (record) text being written to a chat window from another  
app. NOT
log key strokes. For example, how could I progmatically record  
an  AIM

chat conversation from my app?


You can't, at least not without the application's cooperation,  
such as being a plugin, using OSA, etc. With a *user's* (or  
administrator's) cooperation, you could have an app that acts as a  
proxy. Another option would involve a kernel extension, and that  
may be more work than it is worth.




Under the premise that your Chat-Client supports AppleScript, why  
not use the ScriptingBridge?


Because Scripting Bridge is for controlling other applications, not  
for writing handlers that an application will call.


Mr. Arnel's answer is basically correct -- you're going to need the  
target application to give you some hooks to hang your recorder on.   
(Unless you want to do something grungy like a kernel extension, that  
is.)  Some chat clients provide such hooks as part of their  
scriptability.  For example, iChat in Leopard has a rather extensive  
set of handlers that you can attach AppleScript scripts to, and from  
there you can do what you like -- in your case, you'd want the  
message received handler.  You never specified the application you  
were interested in, but take a look at its scripting interface (drop  
it on Script Editor) and see if something looks promising.



--Chris Nebel
AppleScript Engineering

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Don Arnel
Sorry if that came across as having attitude, but I was a little  
miffed at being accused of having intentions to steal passwords or  
account information by writing a key logger.


Anyway, thanks for giving me a starting point to research.
- Don

On Apr 14, 2008, at 10:40 AM, I. Savant wrote:


On Mon, Apr 14, 2008 at 10:26 AM, Don Arnel [EMAIL PROTECTED] wrote:

No...no...NO!


 Alright. Now how about we take a few deep breaths, switch to decaf,
and try our social interaction again. This time without the attitude,
please.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSDateFormatter giving different results in different programs

2008-04-14 Thread Nick Zitzmann


On Apr 13, 2008, at 11:21 PM, Derrick Bass wrote:

In one program that links to this framework, the date is getting  
parsed correctly. But in another, the very same string is coming  
back as 1969-12-31 16:00:00 -0800! Using - 
[getObjectValue:forString:range:error:] gives the same results  
no error.


What could be causing the different behaviors and how do I get the  
string to parse no matter what?



There are two styles of NSDateFormatter: The pre-Tiger style (10.0)  
and the Tiger  later style (10.4). The latter supports non-Gregorian  
calendars and automatically fetching properly localized date  
formatters, but when parsing strings into dates, they require the  
format to be extremely strict or they don't work. The former only  
supports the Gregorian calendar, and the methods of getting properly  
localized date formats have been deprecated, but they are much more  
flexible in the kind of input they take.


So make sure both formatters are of the 10.0 style.

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




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Chilton Webb
Hi Don,

On Monday, April 14, 2008, at 09:27AM, Don Arnel [EMAIL PROTECTED] wrote:
No...no...NO!

Re-read my message. If it was unclear, what I want to do is be able to  
log (record) text being written to a chat window from another app. NOT  
log key strokes. For example, how could I progmatically record an  AIM  
chat conversation from my app?

Specifics are the key here. You can log iChat text rather easily, IIRC, via 
AppleScript. Just look at its scripting dictionary--it either supports it or it 
doesn't. As I recall, I could do this via the event callbacks in there, but 
it's been about 6 years since I had a need to do it.

If you want to log any text in any chat app, that's an entirely different 
matter.

On the topic of Input Managers, it would be fine with me if Apple did away with 
this blatant security hole altogether. 
I can think of zero real reasons to have it around still, which couldn't be 
addressed via more secure means, or by the individual application developers.

-Chilton
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Alastair Houghton

On 14 Apr 2008, at 18:01, Chilton Webb wrote:

On the topic of Input Managers, it would be fine with me if Apple  
did away with this blatant security hole altogether.
I can think of zero real reasons to have it around still, which  
couldn't be addressed via more secure means, or by the individual  
application developers.


They are in the process of doing just that, I think you'll find.  It's  
just that, rather than removing them instantly, they've been  
deprecated and replaced with an alternative and more secure mechanism  
(Input Servers, if I remember rightly).  In some future version of Mac  
OS X, I think you can expect to see them go away.


This was noted in the 10.5 AppKit release notes, which said:

The automatic loading of bundles located in InputManagers folders is  
now officially unsupported. The conditions for valid input manager  
bundle is further tightened. This functionality is likely to be  
disabled in a future release.


Kind regards,

Alastair.

--
http://alastairs-place.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 [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 12:56 PM, Don Arnel [EMAIL PROTECTED] wrote:
 Sorry if that came across as having attitude, but I was a little miffed at
 being accused of having intentions to steal passwords or account information
 by writing a key logger.

  I see no 'accusation' in this thread. Chill out.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Subclassing NSScroller

2008-04-14 Thread Jonathan Dann


On 14 Apr 2008, at 02:12, Chris Hanson wrote:


On Apr 13, 2008, at 3:13 PM, [EMAIL PROTECTED] wrote:


I believe this is a typo in the documentation. The method you want to
override is actually spelled -drawArrow:highlightParts:


In http://www.cocoabuilder.com/archive/message/cocoa/ 
2008/1/26/197320, Troy Stephens responds to Michael Watson's  
mention of that method with:


That method isn't part of NSScroller's published API (note its  
absence

from NSScroller.h).  Therefore it's subject to disappearing without
warning in a future release, and you should avoid any reliance on it
in your code.


Don't rely on anything that isn't API.  If there's something you  
can't do within the API, please file a bug at http://bugreport.apple.com/ 
 and describe what you're trying to create.


 -- Chris



Hi Guys,

Thanks ever so much for your responses on this, I appreciate it.  Can  
I clarify then?


Clearly using undocumented API is a bad road to start on so - 
drawArrow:highlightParts: is out of the question.  So if I override - 
drawRect: (so obvious that I forgot about it), draw the arrows and  
then call -drawKnob etc. I'm then going along the right lines?


Any ideas why passing slimmer frames to -initWithFrame: has no effect  
on the initial scroller width?


Jon

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 [EMAIL PROTECTED]

Re: hooking into another app

2008-04-14 Thread I. Savant
  They are in the process of doing just that, I think you'll find.  It's just
 that, rather than removing them instantly, they've been deprecated and
 replaced with an alternative and more secure mechanism (Input Servers, if I
 remember rightly).  In some future version of Mac OS X, I think you can
 expect to see them go away.

  Additionally, I think I read somewhere that only those in the
/Library/... folder get loaded now. That may be wrong.

--
I.S.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Forced Refreshing of WebKit

2008-04-14 Thread KJ Walker
I have a product that uses a WebView to display HTML to the user.  At  
times, due to activities spawned along with updating the HTML data to  
the WebView, response times can be a few seconds.  It would be a  
better user experience to see the updated view displayed before other  
activities are finished.  While many other types of views can be  
forced to immediately redisplayed via [... display], WebView appears  
to not immediately update, preferring instead to update after the  
current event is processed.


Is there a means to have a WebView update immediately instead of  
waiting for the normal drawing process?


Thanks!


Kevin (KJ) Walker
Senior Mac Developer
SmartSound Software, Inc.



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Carter R. Harrison
cgback is a CGLayerRef instance variable that I setup when the view is  
inited.  I use the following line:


cgback = CGLayerCreateWithContext(context, CGSizeMake([self  
bounds].size.width, [self bounds].size.height), NULL);


It's my understanding that I do not need to retain cgback with  
CFRetain(), but I do need to release cgback in my dealloc() method -  
which I'm doing.



On Apr 14, 2008, at 12:02 PM, Nathan Vander Wilt wrote:


On Apr 13, 2008, at 7:15 AM, Carter R. Harrison wrote:
CGContextRef context = [[NSGraphicsContext currentContext]  
graphicsPort];
CGContextDrawLayerInRect(context, CGRectMake([self frame].origin.x,  
[self frame].origin.y, [self frame].size.width, [self  
frame].size.height), cgback);


cgback is a instance variable pointing to a CGLayer.

So my code works, the correct things are being drawn to my view  
(more or less), but what happens is that after several seconds of  
use, the app crashes and I get an EXC_BAD_ACCESS error.



Can you post more information regarding your cgback variable? How is  
it being allocated? That parameter seems to be the most likely  
culprit.


-nvw


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSCompositeSourceOver equivalent in Quartz 2D?

2008-04-14 Thread David Duncan

On Apr 13, 2008, at 1:43 PM, Carter R. Harrison wrote:

I'm trying to do some drawing in Quartz 2D.  I'm trying to set the  
blending mode of my CGContextRef to the equivalent of  
NSCompositeSourceOver from NSGraphicsContext.  It doesn't look like  
there is such a blending mode for a CGContext.  Am I mistaken in  
this, or is there another way of accomplishing this?  It seems funny  
to me that this blending mode doesn't exist in Quartz given that  
NSGraphicsContext should be a wrapper class around CGContextRef.



NSCompositeSourceOver is equivalent to kCGBlendModeNormal (which is  
the default blend mode in a CGContext).

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Basic Core Animation question

2008-04-14 Thread David Duncan

On Apr 13, 2008, at 12:01 AM, Greg Sabo wrote:

Ah! It compiled. Thank you very much! And thanks to Michael for  
putting

together the sample project.

Now to get the CALayer to draw a path. Most of the documentation  
I've seen
suggest to do this with a delegate function, is that correct? Here  
is the

delegate function I've written (a.k.a. copied from another program):

// 


- (void)drawLayer:(CALayer *)theLayer
   inContext:(CGContextRef)theContext {
   CGMutablePathRef thePath = CGPathCreateMutable();

   CGPathMoveToPoint(thePath,NULL,15.0f,15.f);
   CGPathAddCurveToPoint(thePath,
 NULL,
 15.f,250.0f,
 295.0f,250.0f,
 295.0f,15.0f);

   CGContextBeginPath(theContext);
   CGContextAddPath(theContext, thePath );

   CGContextSetLineWidth(theContext, 1);

CGContextSetRGBStrokeColor(theContext,0.0,0.0,1.0,1.0);


   CGContextStrokePath(theContext);
}
//**

I'm just seeing the black background right now.
Again, thanks for your help and sorry I'm such a pain :)


Note that this code (by itself) leaks, the mutable path your creating  
is never released (in this snippet). You actually don't need to do  
this anyway, you can use CGContextMoveToPoint/CGContextAddCurveToPoint/ 
etc instead and not have to worry about the memory management issue  
that using CGPath brings up.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Scott Ribe
 Sorry if that came across as having attitude, but I was a little
 miffed at being accused of having intentions to steal passwords or
 account information by writing a key logger.

Nobody was accusing *you* of wanting to do that, just pointing out that you
were asking for an OS feature which would open the OS to that kind of
attach.

-- 
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread David Duncan

On Apr 14, 2008, at 11:56 AM, Carter R. Harrison wrote:

cgback is a CGLayerRef instance variable that I setup when the view  
is inited.  I use the following line:


cgback = CGLayerCreateWithContext(context, CGSizeMake([self  
bounds].size.width, [self bounds].size.height), NULL);


It's my understanding that I do not need to retain cgback with  
CFRetain(), but I do need to release cgback in my dealloc() method -  
which I'm doing.



Where is context coming from? CGLayers are made relative to an  
example context that they optimize themselves for, but at -init your  
view hasn't been drawn yet, so there is no context. I suspect that  
your getting something you very much do not expect.


In general if you want to use layers with views, you should create the  
layer on the first -drawRect: call rather than trying to have them  
around from -init forward.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Carter R. Harrison

Hi David,

I'm getting the reference to the context by using:

CGContextRef context = [[NSGraphicsContext currentContext]  
graphicsPort];


in my view's initWithFrame: method.  Based upon what you said, how  
would you recommend I draw to a CGLayer prior to the first invocation  
of drawRect: (at which point I could initialize a CGContextRef  
instance variable)?


Thanks for your help!

Regards,
Carter

On Apr 14, 2008, at 3:30 PM, David Duncan wrote:


On Apr 14, 2008, at 11:56 AM, Carter R. Harrison wrote:

cgback is a CGLayerRef instance variable that I setup when the view  
is inited.  I use the following line:


cgback = CGLayerCreateWithContext(context, CGSizeMake([self  
bounds].size.width, [self bounds].size.height), NULL);


It's my understanding that I do not need to retain cgback with  
CFRetain(), but I do need to release cgback in my dealloc() method  
- which I'm doing.



Where is context coming from? CGLayers are made relative to an  
example context that they optimize themselves for, but at -init your  
view hasn't been drawn yet, so there is no context. I suspect that  
your getting something you very much do not expect.


In general if you want to use layers with views, you should create  
the layer on the first -drawRect: call rather than trying to have  
them around from -init forward.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSString value mangled in NSDictionary with Garbage Collection

2008-04-14 Thread Mike R. Manzano
Can we see the rest of the code that is currently represented as  
comments in your example?


On Apr 10, 2008, at 3:44 AM, Jason Kravitz wrote:

I created a while loop where I am reading through a text file and  
pulling
out certain words based on RegEx criteria. I want to add these words  
as a
comma separated list under different keys in an NSMutableDictionary.  
I've
created a simplified psuedo-code representation of what I'm trying  
to do as
it may make it clearer and potentially expose what I'm doing wrong  
(see

below).
[…]

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how should I go about downloading files

2008-04-14 Thread Laimonas Simutis
On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish [EMAIL PROTECTED] wrote:

  On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote:

  Hey,
 
  This is my first cocoa projects so I am kind of finding my way around
  the framework. The question I have is maybe more related to the design
  practices with cocoa.
 
  I make a HTTP call to a server which gives me back a list of urls
  pointing to mp3 files. For each url handling I created FileDownloader
  class that inside uses NSURLDownload class to download the mp3 file.
  All works fine but I have a problem with finding a solution for
  queuing the downloads. I want to control how many files will be
  downloaded concurrently (usually it will be one or two). However right
  now what I have is basically this:
 

  Have a look at NSOperation and NSOperationQueue in concert with
 NSURLDownload

  this will allow you to do this, as well as change priorities, control how
 many downloads can occur at the same time, etc..

NSOperation* classes look like what I could definitely use, but the
docs mention that NSOperation and
NSOperationQueue are available for MacOSX 10.5 and above. I am
developing on 10.4. And the question arose here, when the
documentation states that a class is available for 10.5 and later does
that mean that if I use this class my app is compatible only with mac
osx 10.5 and later or does that mean that to take advantage of this
class I must run 10.5 but once compiled it will run in previous
versions of mac OS?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how should I go about downloading files

2008-04-14 Thread John Stiles

Laimonas Simutis wrote:

On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish [EMAIL PROTECTED] wrote:
  

 On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote:



Hey,

This is my first cocoa projects so I am kind of finding my way around
the framework. The question I have is maybe more related to the design
practices with cocoa.

I make a HTTP call to a server which gives me back a list of urls
pointing to mp3 files. For each url handling I created FileDownloader
class that inside uses NSURLDownload class to download the mp3 file.
All works fine but I have a problem with finding a solution for
queuing the downloads. I want to control how many files will be
downloaded concurrently (usually it will be one or two). However right
now what I have is basically this:

  

 Have a look at NSOperation and NSOperationQueue in concert with
NSURLDownload

 this will allow you to do this, as well as change priorities, control how
many downloads can occur at the same time, etc..



NSOperation* classes look like what I could definitely use, but the
docs mention that NSOperation and
NSOperationQueue are available for MacOSX 10.5 and above. I am
developing on 10.4. And the question arose here, when the
documentation states that a class is available for 10.5 and later does
that mean that if I use this class my app is compatible only with mac
osx 10.5 and later or does that mean that to take advantage of this
class I must run 10.5 but once compiled it will run in previous
versions of mac OS?
If you use NSOperation/NSOperationQueue, your app will require 10.5. 
(And you'd need to be developing on 10.5 to even access them.)


You can usually do the same sorts of things with NSThread, it will just 
not be as easy to do.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 5:12 PM, Don Arnel [EMAIL PROTECTED] wrote:
  I've only been working with a Mac running Leopard now for about 5 weeks and
 am not familiar with AppleScript or the Script Editor. I ran the Script
 Editor and dragged the iChat.app (since you said that app had lots of
 handlers) file into it, but what am I looking for? I saw no scripting
 interface. Am I doing it wrong? Is that how I was suppose to drop it on
 Script Editor?

Scriptable applications provide what are known as dictionaries of
their terminology.  You can open an application's dictionary using
the Open Dictionary item on Script Editor's File menu.

Under the hood, AppleScript is just a human-readable representation of
Apple Events, which are the primitive IPC mechanism on Mac OS (well,
if you don't want to talk about kernel-level IPC through mach ports or
BSD-layer IPC with pipes and sockets, that is).  Apple Events are
somewhat analogous to Windows messages like WM_CLOSE, but they are a
lot more structured and versatile.

When you right-click and application's Dock icon and click Quit, for
example, the OS is actually sending that app a Quit Apple Event.  This
is just like when you quit an application from the Task Manager in
Windows (in that case, Windows posts a quit event to the app's message
queue -- actually its first top-level window -- which is usually
special-cased in the app's message pump).

But the similarities pretty much end there.  Windows also uses
messages for a lot of internal message passing.  Also, in Windows,
pretty much everything is a window, and you can iterate through all
the windows owned by any process you own (generalizing here in the
context of security descriptors).  Neither of these is the case on OS
X.  You have no access to another application's internal structures
whatsoever; you only have access to what the application grants you,
which in most cases is merely Apple Events/AppleScript.  In this
sense, Apple Events are used more like COM.

Long story short, you're going to need to seriously retrain yourself
for how OS X is architected.  It is a very different beast from
Windows.

--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 [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Bill Cheeseman
on 2008-04-14 8:30 AM, Don Arnel at [EMAIL PROTECTED] wrote:

 I am attempting to write a Cocoa app that I would
 like to have hook into a text chat window from another app so that I
 can log the incoming messages. The other app does not belong to my app.
 
 If anyone could point me to some help topics on how this can be
 accomplished I would greatly appreciate it.

Use the Accessibility API. It's designed to do exactly this. It's a C API,
not Cocoa or Objective-C, but you can use it in a Cocoa application.

The Accessibility API does two things: (1) it enables you to make the user
controls and views in your application accessible to so-called assistive
applications, and (2) it enables you to write an assistive application
yourself that accesses the user controls and views of any application. The
Accessibility API was created to make applications accessible to people with
disabilities through assistive devices and applications. However, the
Accessibility API is also wonderfully useful for doing lots of other things,
such as hooking into a text chat window so that you can log the incoming
messages.

Apple has lots of documentation about how to make your own application's
user controls and views accessible by assistive applications, but that
usually is only necessary if your application has custom user controls and
views. If your application uses standard Carbon or Cocoa code for its user
controls and views, they are automatically accessible out of the box.

But Apple offers very little documentation about how to write an assistive
application, which is what you want to do. There is a reference document
that describes the functions in the Accessibility API that you have to use
to write an assistive application, and there are a couple of example code
projects, including the UI Element Inspector example.

You can download the free 30-day trial version of my PreFab UI Browser at
http://prefabsoftware.com/uibrowser/, which uses the Accessibility API to
read and manipulate other applications. Try it with your target
application's chat window to see whether UI Browser is able to read the
incoming messages. You might have to read the chat window periodically to
notice new messages, but more likely your assistive application can install
(or register) a notification observer that will notice every time the
content of the chat window changes. You can test that in UI Browser, too. In
your assistive application, you would respond to each such notification by
reading the new content of the chat window and saving it to your log.

--

Bill Cheeseman - [EMAIL PROTECTED]
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.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 [EMAIL PROTECTED]


NSMenuItem view bug with status bar menu

2008-04-14 Thread Kimo
I believe I have found a bug with a menu item view when used in the  
status bar menu.
Here's how to recreate the bug.  Assume the app MyApp is active and  
has a status bar menu, and one of the menu items has a view:
1. Bring another app to the front (such as Safari), and access the  
MyApp status bar menu, displaying the view.

2. Bring MyApp to the front.
3. Now there is a ghost image from the view displayed when MyApp was  
inactive.  The ghost image goes away after about 20 seconds.  When I  
say ghost image it's just a white space void of any of the views  
contents.


Maybe the NSMenuItem view is not meant to be used with a status bar  
menu?  Or this is a bug?
Or more importantly, does anyone know a workaround so I don't get this  
ghost image on the screen?


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 [EMAIL PROTECTED]


Re: Window moved when dock appears.

2008-04-14 Thread Mohsan Khan

Thanks, this does the trick!


- (void)setFrame: (NSRect)frameRect
 display: (BOOL)flag
{
#pragma unused( frameRect, flag )

[super setFrame: myRect
display: YES];
}



On må 14 apr 2008, at 05.00, Seth Willits wrote:


On Apr 13, 2008, at 10:56 AM, Mohsan Khan wrote:

I have a window (NSBorderlessWindowMask), this window gets pushed  
away when my Dock appears from being hidden.


Huh. I wouldn't expect it to do that given that it's borderless.




How can I bypass this behaviour for my window?

Should I use applicationDidChangeScreenParameters and reposition  
the window, or is there an option to make my window not care about  
the Dock appearing?


It'd probably be easier to just override setFrame in a window  
subclass and make sure it's always what it should be. Just a thought.




--
Seth Willits


___

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

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

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

This email sent to [EMAIL PROTECTED]


Memory leak when re-alloc Methods

2008-04-14 Thread marioegt
Hi and sorry for my bad english. 

I have a nasty leak problem when i realloc several methods of the main class of 
my app. 

I have a button that initiate a series of methods of my Main Model Class for 
initialize and display sprites.  In a NSView, when i alloc the class for the 
first time every is fine, no noticiables memory leak in the app, however when i 
press the button that call the methods more than one time the memory consumed 
by my app increase heavily, perhaps when i re alloc and initialize the same 
methods the older version is still live in the computer memory, i dont know, 
but i can tell you, in every class i have created i implemented a dealloc 
method releasing all my objects but the memory leak is still here, thanks for 
your time and your opinions about this bug. 


Enviado desde mi BlackBerry de Movistar

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMatrix Content Binding

2008-04-14 Thread Seth Willits

On Apr 14, 2008, at 8:07 AM, Keary Suska wrote:


Is there a way to do what I want to do?


If changing your array to an array of dictionaries is not  
acceptable, you

could use a custom NSValueTransformer.


An array of dictionaries wouldn't work though. Since it'd use the  
entire dictionary as the value, which isn't what I want. It's kinda  
annoying. A value transformer seems like a good idea. I haven't looked  
into them yet, but I think there's a couple places where some custom  
ones could be handy. I'll look into that. Thanks



--
Seth Willits




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Don Arnel

Thank you, Bill

This is exactly what I was looking for!

On Apr 14, 2008, at 5:39 PM, Bill Cheeseman wrote:


Use the Accessibility API. It's designed to do exactly this. It's a  
C API,

not Cocoa or Objective-C, but you can use it in a Cocoa application.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Forced Refreshing of WebKit

2008-04-14 Thread John Joyce


On Apr 14, 2008, at 2:02 PM, [EMAIL PROTECTED] wrote:


Forced Refreshing of WebKit
To force refresh a WebKit view, do the same thing web developers do:  
JavaScript...?

or
- reload:

example from webview docs:

- (IBAction)reload:(id)sender
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Basic Core Animation question

2008-04-14 Thread Greg Sabo
Thanks for the tip, I've made that function simpler (displaying a red
circle):

- (void)drawLayer:(CALayer *)theLayer
inContext:(CGContextRef)theContext {

CGRect theRect = CGRectMake(0.5, 0.5, 1, 1);
CGContextSetRGBFillColor(theContext, 1, 0, 1, 1);
CGContextFillEllipseInRect(theContext, theRect );
}

On Mon, Apr 14, 2008 at 2:24 PM, David Duncan [EMAIL PROTECTED]
wrote:

 On Apr 13, 2008, at 12:01 AM, Greg Sabo wrote:

  Ah! It compiled. Thank you very much! And thanks to Michael for putting
  together the sample project.
 
  Now to get the CALayer to draw a path. Most of the documentation I've
  seen
  suggest to do this with a delegate function, is that correct? Here is
  the
  delegate function I've written (a.k.a. copied from another program):
 
 
  //
  - (void)drawLayer:(CALayer *)theLayer
inContext:(CGContextRef)theContext {
CGMutablePathRef thePath = CGPathCreateMutable();
 
CGPathMoveToPoint(thePath,NULL,15.0f,15.f);
CGPathAddCurveToPoint(thePath,
  NULL,
  15.f,250.0f,
  295.0f,250.0f,
  295.0f,15.0f);
 
CGContextBeginPath(theContext);
CGContextAddPath(theContext, thePath );
 
CGContextSetLineWidth(theContext, 1);
 
  CGContextSetRGBStrokeColor(theContext,0.0,0.0,1.0,1.0);
 
 
CGContextStrokePath(theContext);
  }
  //**
 
  I'm just seeing the black background right now.
  Again, thanks for your help and sorry I'm such a pain :)
 

 Note that this code (by itself) leaks, the mutable path your creating is
 never released (in this snippet). You actually don't need to do this anyway,
 you can use CGContextMoveToPoint/CGContextAddCurveToPoint/etc instead and
 not have to worry about the memory management issue that using CGPath brings
 up.
 --
 David Duncan
 Apple DTS Animation and Printing
 [EMAIL PROTECTED]




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Basic Core Animation question

2008-04-14 Thread Greg Sabo
I think I'm doing those things, see below:

//Setting object as delegate for CALayer
- (id) initWithFrame:(NSRect) frame {
if (self = [super initWithFrame: frame]) {
animateLayer = [CALayer layer];
[animateLayer setDelegate:self];
}
return self;
}

//drawing the view and setting setNeedsDisplay of CALayer to YES
- (void)drawRect:(NSRect)rect {
[self drawBoardBackgroundInRect:rect];
//whenever this next line is not commented out, the program crashes
//when I try to resize the window
[animateLayer setNeedsDisplay];
}

//Implementation of drawLayer: inContext:
- (void)drawLayer:(CALayer *)theLayer
inContext:(CGContextRef)theContext {

CGRect theRect = CGRectMake(0.5, 0.5, 1, 1);
CGContextSetRGBFillColor(theContext, 1, 0, 1, 1);
CGContextFillEllipseInRect(theContext, theRect );
}

Thanks for your help, you guys are awesome!

On Mon, Apr 14, 2008 at 2:21 AM, Michael Vannorsdel [EMAIL PROTECTED]
wrote:

 Are you implementing the drawLayer:inContext: in your delegate object and
 sure the object is set as the delegate and the draw method is called?



 On Apr 13, 2008, at 8:05 AM, Greg Sabo wrote:

  I am now, (in DrawRect) but no luck, also the program now crashes when I
  attempt to resize the frame...
 
  //***
  - (void)drawRect:(NSRect)rect {
 [self drawBoardBackgroundInRect:rect];
 [animateLayer setNeedsDisplay];
  }
 

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Matt Burnett
The OS is all ready wide open to this sort of attack. Criticizing the  
OP for asking for this feature illustrates the false sense of security  
Mac users have simply because there isnt a spyware problem... yet.  
Apple allows you to hook IOHIKeyboard's _keyboardEventTarget.


On Apr 14, 2008, at 2:24 PM, Scott Ribe wrote:


Sorry if that came across as having attitude, but I was a little
miffed at being accused of having intentions to steal passwords or
account information by writing a key logger.


Nobody was accusing *you* of wanting to do that, just pointing out  
that you

were asking for an OS feature which would open the OS to that kind of
attach.

--
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.w.burnett%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread I. Savant

On Apr 14, 2008, at 8:27 PM, Matt Burnett wrote:
The OS is all ready wide open to this sort of attack. Criticizing  
the OP for asking for this feature illustrates the false sense of  
security Mac users have simply because there isnt a spyware  
problem... yet. Apple allows you to hook IOHIKeyboard's  
_keyboardEventTarget.



  Not once was it suggested that the OS isn't open to this sort of  
attack. Not once did the OP ask for a 'feature', and not once was the  
OP criticized for asking for a way to do what he wanted. Several  
different approaches to the (very loosely defined) problem were  
offered by many different posters, in fact.


  Either you're confusing this with another thread or you're trolling  
for 'apple fanboy security' flamewars. Stick to Cocoa discussion on  
the cocoa-dev list, please.


--
I.S.



___

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

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

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

This email sent to [EMAIL PROTECTED]


Cannot Remove Observer Error

2008-04-14 Thread Thaddeus Cooper
Starting earlier today, I started getting the following error in my  
software.


2008-04-14 17:59:41.535 WineCellar[4928:10b] Cannot remove an observer  
WineArrayController 0x25a450 for the key path wineType.name from  
Wine 0x6c55170, most likely because the value for the key wineType  
has changed without an appropriate KVO notification being sent. Check  
the KVO-compliance of the Wine class.


I haven't changed anything significant (well at least I don't think I  
did) and I definitely have not been messing around with the  
WineArrayController and/or the Wine classes. I can't figure out how to  
track this error down -- I've tried a number of things including  
putting a removeObserver:forKeyPath method in the array controller so  
I could look at the back trace and I've also put in enter and exit  
debug messages in a large portion of the code. Still the error seems  
to come from nowhere and I am stumped as to how I might find what the  
root cause of the problem is.


Does anyone have any suggestions as to how to track down this type of  
error.


Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread Markus Spoettl

On Apr 14, 2008, at 9:09 AM, Nathan Vander Wilt wrote:
This means your NIB/XIB has a deployment target not equal to  
10.5.x, but you have some sort of button or other view whose  
Scaling setting is not None. If you go into Interface Builder,  
and go to your file's Info window, it will show a list of all these  
warnings. Either change your deployment target, or click each  
warning to pull up the problematic view in the inspector window and  
set its Scaling to None. It may be alright to ignore these  
warnings, I don't know.



The real problem with this as I see it is that it happens with a  
default project with no changes. Create a new Cocoa application, open  
the NIB and add a Push Button/NSButton on the window. You'll get a NIB  
warning the OP describes immediately. Bad default settings in my  
opinion.


In order to make the warning go away you can either set the build  
target for the NIB file to 10.5 or set the Scaling attribute to  
none for the button. Neither of this is immediately obvious to  
newbies like myself because you would assume things like that just  
work.


What I've been wondering: What happens if I get a warning like this,  
switch my build target to 10.5 and the final application runs on a pre  
10.5 system? Will it crash, will the scaling functionality just don't  
work or will the user get lots of error messages when starting the  
application?


Regards
Markus
--
__
Markus Spoettl

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Basic Core Animation question

2008-04-14 Thread Michael Vannorsdel
In your initWithFrame: method you need to retain the layer object or  
the autorelease pool may deallocate it.  Also, where do you set the  
layer to a view to be displayed?



On Apr 14, 2008, at 6:26 PM, Greg Sabo wrote:


I think I'm doing those things, see below:

//Setting object as delegate for CALayer
- (id) initWithFrame:(NSRect) frame {
if (self = [super initWithFrame: frame]) {
animateLayer = [CALayer layer];
[animateLayer setDelegate:self];
}
return self;
}

//drawing the view and setting setNeedsDisplay of CALayer to YES
- (void)drawRect:(NSRect)rect {
[self drawBoardBackgroundInRect:rect];
//whenever this next line is not commented out, the program  
crashes

//when I try to resize the window
[animateLayer setNeedsDisplay];
}

//Implementation of drawLayer: inContext:
- (void)drawLayer:(CALayer *)theLayer
inContext:(CGContextRef)theContext {

CGRect theRect = CGRectMake(0.5, 0.5, 1, 1);
CGContextSetRGBFillColor(theContext, 1, 0, 1, 1);
CGContextFillEllipseInRect(theContext, theRect );
}

Thanks for your help, you guys are awesome!

___

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

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

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

This email sent to [EMAIL PROTECTED]


is this badly written code?

2008-04-14 Thread Adam Gerson
In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];

or to flush it out in to individual lines:

NSWindowController *mainWindow = [[self delegate] mainWindowController];
NSTreeController *treeController = [mainWindow treeController];
NSArray *selectedTreeObjects = [treeController selectedObjects];
NSManagedObject *selectedTreeObject =  [selectedTreeObjects objectAtIndex:0];

I am looking for some guidance on best practices in a situation with a
lot of nested calls like this. If ultimately the only value I care
about is the final one, selectedTreeObject, whats the best way to go
about getting it? I know best is a subjective word. Interested to
hear all of your opinions.

Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hooking into another app

2008-04-14 Thread Matt Burnett
You reply couldnt be more fanboi-ish. If that wasnt enuf you have a  
documented history of being a apple fanboi (http://projects.info-pull.com/moab/hallofshame/line-noise_offended-pimpdouche.txt 
)




 Not once was it suggested that the OS isn't open to this sort of  
attack.


You yourself said that the OS is resistant against this sort of attack  
in the following quotes:



 Well, password fields are special and are 'resistant' to key
logging, but you don't have to 'hook into' any apps to log the rest.



 Understood - in this case, it's unsupported system hack time, since
the Mac OS X world takes a different approach to security which means
you have to work a bit harder.





Not once did the OP ask for a 'feature', and not once was the OP  
criticized for asking for a way to do what he wanted.


The OP asked if such a feature existed, directly implying that if it  
did not, then it would be a desired feature. Although you didn't  
criticize him, Thomas Davie did with the following reply:


Someone may correct me if I'm wrong, but that sounds a lot like  
something that has been very very deliberately left out of any API...
I want to write an app that I'd like to have hook into a text box  
in Safari and log your IDs, passwords, and bank account status.




Several different approaches to the (very loosely defined) problem  
were offered by many different posters, in fact.


The OP's request couldn't be more straight forward. He said he wanted  
to hook into a text chat window from another app so that I can log  
the incoming messages. I dont know what could be confusing about  
logging text that is displayed in a text field, perhaps you could  
elaborate on how this was confusing.




 Either you're confusing this with another thread or you're trolling  
for 'apple fanboy security' flamewars. Stick to Cocoa discussion on  
the cocoa-dev list, please.


So im the troll huh? Which is why i'm posting with my real name  
instead of a pseudonym like yourself. I suppose my post wasnt directly  
Cocoa related, but it still dealt with OS X development, albeit at the  
kernel level. If you would have bothered to check the email headers,  
you would have seen that my message was sent with Apple Mail, which  
would further reduce the likely hood of being a troll. And finally if  
you would have bothered to google my email address you would find  
plenty of posts on the darwin-dev lists critizing Apple's lack of  
support for function hooking.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: is this badly written code?

2008-04-14 Thread John Stiles
The chained approach is tempting since it's short and convenient, so if 
the code is not prone to failure, I'd say go for it.


If you expect that you might need to see intermediate values in the 
debugger or there are weird edge cases where something might return nil, 
I'd break it out into multiple lines.


This is really a matter of personal preference so YMMV here.


Adam Gerson wrote:

In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];

or to flush it out in to individual lines:

NSWindowController *mainWindow = [[self delegate] mainWindowController];
NSTreeController *treeController = [mainWindow treeController];
NSArray *selectedTreeObjects = [treeController selectedObjects];
NSManagedObject *selectedTreeObject =  [selectedTreeObjects objectAtIndex:0];

I am looking for some guidance on best practices in a situation with a
lot of nested calls like this. If ultimately the only value I care
about is the final one, selectedTreeObject, whats the best way to go
about getting it? I know best is a subjective word. Interested to
hear all of your opinions.

Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]
  

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: is this badly written code?

2008-04-14 Thread Michael Vannorsdel
I don't think there's anything wrong combining messages into a chain  
when you only need one variable from it.  With the well-worded method  
names common with Cocoa it's not too hard to see what the chain is  
doing.  Sometimes having a bunch of placeholder variables on each line  
can look more messy and confusing than one line of chained messages.



On Apr 14, 2008, at 8:53 PM, Adam Gerson wrote:


In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];

or to flush it out in to individual lines:

NSWindowController *mainWindow = [[self delegate]  
mainWindowController];

NSTreeController *treeController = [mainWindow treeController];
NSArray *selectedTreeObjects = [treeController selectedObjects];
NSManagedObject *selectedTreeObject =  [selectedTreeObjects  
objectAtIndex:0];


I am looking for some guidance on best practices in a situation with a
lot of nested calls like this. If ultimately the only value I care
about is the final one, selectedTreeObject, whats the best way to go
about getting it? I know best is a subjective word. Interested to
hear all of your opinions.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: is this badly written code?

2008-04-14 Thread Matt Burnett
Have you thought of using KVC? It makes that code alot smaller, and  
(im 99% sure) it deals with things like if treeController returned nil  
instead of a NSArray.


NSManagedObject *selectedTreeObject = [self  
valueForKeyPath 
:@delegate 
.mainWindowController.treeController.selectedObjects.lastObject];


On Apr 14, 2008, at 10:05 PM, John Stiles wrote:

The chained approach is tempting since it's short and convenient, so  
if the code is not prone to failure, I'd say go for it.


If you expect that you might need to see intermediate values in the  
debugger or there are weird edge cases where something might return  
nil, I'd break it out into multiple lines.


This is really a matter of personal preference so YMMV here.


Adam Gerson wrote:

In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];

or to flush it out in to individual lines:

NSWindowController *mainWindow = [[self delegate]  
mainWindowController];

NSTreeController *treeController = [mainWindow treeController];
NSArray *selectedTreeObjects = [treeController selectedObjects];
NSManagedObject *selectedTreeObject =  [selectedTreeObjects  
objectAtIndex:0];


I am looking for some guidance on best practices in a situation  
with a

lot of nested calls like this. If ultimately the only value I care
about is the final one, selectedTreeObject, whats the best way to go
about getting it? I know best is a subjective word. Interested to
hear all of your opinions.

Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.w.burnett%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: is this badly written code?

2008-04-14 Thread John Stiles
Actually, that code isn't smaller, it just replaces ]  with . in a 
couple of places :)
As to whether it does anything special to avoid problems with nil 
objects, I have no idea...



Matt Burnett wrote:
Have you thought of using KVC? It makes that code alot smaller, and 
(im 99% sure) it deals with things like if treeController returned nil 
instead of a NSArray.


NSManagedObject *selectedTreeObject = [self 
valueForKeyPath:@delegate.mainWindowController.treeController.selectedObjects.lastObject]; 



On Apr 14, 2008, at 10:05 PM, John Stiles wrote:

The chained approach is tempting since it's short and convenient, so 
if the code is not prone to failure, I'd say go for it.


If you expect that you might need to see intermediate values in the 
debugger or there are weird edge cases where something might return 
nil, I'd break it out into multiple lines.


This is really a matter of personal preference so YMMV here.


Adam Gerson wrote:

In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];

or to flush it out in to individual lines:

NSWindowController *mainWindow = [[self delegate] 
mainWindowController];

NSTreeController *treeController = [mainWindow treeController];
NSArray *selectedTreeObjects = [treeController selectedObjects];
NSManagedObject *selectedTreeObject =  [selectedTreeObjects 
objectAtIndex:0];


I am looking for some guidance on best practices in a situation with a
lot of nested calls like this. If ultimately the only value I care
about is the final one, selectedTreeObject, whats the best way to go
about getting it? I know best is a subjective word. Interested to
hear all of your opinions.

Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.w.burnett%40gmail.com 



This email sent to [EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: is this badly written code?

2008-04-14 Thread Ferhat Ayaz


On Apr 15, 2008, at 4:53 AM, Adam Gerson wrote:


In cocoa its very tempting to write a single line of code like:
NSManagedObject *selectedTreeObject = [self delegate]
mainWindowController] treeController] selectedObjects]
objectAtIndex:0];



If you have to embed a lot of messages, you should really consider to  
redesign your code. At least since you have to send message to objects  
far far far away from your actual object, it is a signal to refactor :)


Ferhat





___

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

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

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

This email sent to [EMAIL PROTECTED]


[Moderator] Re: hooking into another app

2008-04-14 Thread Scott Anguish
None of this is relevant to this discussion or Cocoa. Nor was your  
earlier response.



On Apr 14, 2008, at 11:04 PM, Matt Burnett wrote:
You reply couldnt be more fanboi-ish. If that wasnt enuf you have a  
documented history of being a apple fanboi


snip irrelevant URL and flame


Either you're confusing this with another thread or you're trolling  
for 'apple fanboy security' flamewars. Stick to Cocoa discussion on  
the cocoa-dev list, please.


So im the troll huh? Which is why i'm posting with my real name  
instead of a pseudonym like yourself. I suppose my post wasnt  
directly Cocoa related, but it still dealt with OS X development,  
albeit at the kernel level. If you would have bothered to check the  
email headers, you would have seen that my message was sent with  
Apple Mail, which would further reduce the likely hood of being a  
troll. And finally if you would have bothered to google my email  
address you would find plenty of posts on the darwin-dev lists  
critizing Apple's lack of support for function hooking.



This is not acceptable behavior for this list, or any Apple list for  
that matter.



Everyone, please take note that this type of blatant foolishness will  
not be tolerated, nor will posting links to posts about other users.  
This will result in your posts to the list being moderated, as Matt's  
have now been.


Whether I.S. chooses to post under his real name or a pseudonym is not  
an issue. He's developed a reputation here of providing accurate and  
helpful answers to many questions.


Scott [Moderator]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Subclassing NSArrayController

2008-04-14 Thread Scott Anguish


On Apr 14, 2008, at 11:53 PM, antikraft clover wrote:

A very newbie-ish question:

If I am subclassing NSArrayController to provide and update an array
of objects, which methods do I need to implement ?


you may want to provide more information, or re-check the docs.

it shouldn't be necessary to subclass NSArrayController simply to  
provide and update array content in the vast majority of cases.


___

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

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

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

This email sent to [EMAIL PROTECTED]


NSAllocateCollectable() questions

2008-04-14 Thread Brendan Younger

Hi all,

This is a re-post since I didn't receive any response on Sunday.

I've been writing a library that uses NSAllocateCollectable() quite a  
bit and I have a few questions about proper usage.


- Copying data
if I am copying to a malloc'd block, I can use memmove() regardless of  
whether the source is GC'd or not, right?
if I am copying to a GC block allocated with NSScannedOption, I need  
to use objc_memmove_collectable(), right?
if I am copying to a GC block allocated with nonscanned memory, I can  
use memmove(), right?


- Zero'ing data
There does not seem to be a GC-compatible bzero().  If I loop through  
and zero out each pointer in a scanned block, that would generate a  
write barrier for each pointer which is expensive.  However, if I use  
bzero(), then libauto won't know that I've messed with the block.   
Will it eventually figure it out when it does an exhaustive scan?  Or  
will it never notice that I've zero'd out the block?


Thanks,
Brendan
___

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

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

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

This email sent to [EMAIL PROTECTED]