Re: Dot Syntax docs missing?

2008-07-18 Thread mmalc crawford


On Jul 18, 2008, at 10:16 PM, Andy Lee wrote:

Interesting... the online doc is missing a couple of sections that  
my Xcode doc has.  I'm looking here:

Oddly, the online version would seem to be *newer*.  At the bottom  
of the page it says "Last updated: 2008-07-08", whereas my Xcode doc  
says "(Last updated: 2008-06-09)".

Maybe the docs were reorganized a bit for 3.1.




mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


Quick problem with arraycontroller

2008-07-18 Thread Jason Cox
I have 2 array controllers. the 1st manages an array of Project  
objects. within the project object there is an NSMutableArray of  
ProjectInfo objects.

Here is an image of my Interface Builder setup for the 2 controllers:

http://www.design-factor.com/jason/bindings.jpg

The Projects array controller works fine, but when i try to use the  
array controllers add: for the ProjectInfo controller, it gives me  
this in the console:

Cannot create NSArray from object NSCFString of class NSCFString

Im new to Cocoa / obj-c so please forgive the possible butchering of  
terminology. Im sure anyone out there can take a quick look at this  
and tell me exactly what I'm doing wrong.


Thanks so much,

Jason
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CoreData Property access compiles, but fails at runtime

2008-07-18 Thread Rick Mann
I think this is also a bit of a red herring. I realize that my setEp1:  
is only being called because I instantiated this instance directly.  
When the instance is created by CoreData, my setEp1 is not called.


This is odd, because I'm doing this successfully in a different entity  
(shadowing the CGPoint type).


On Jul 18, 2008, at 22:38:23, Rick Mann wrote:

I have a CoreData entity called WireSegment, and a class to  
implement it. A stripped-down version looks like this:


@interface
WireSegment : NSManagedObject
{
}

@property   CGPoint ep1;
@property (retain)  NSString*   shadowEP1;

@end

@implementation WireSegment

@dynamic shadowEP1;

- (CGPoint)
ep1
{
NSString* v = self.shadowEP1;
NSPoint nsP = ::NSPointFromString(v);
return ::NSPointToCGPoint(nsP);
}

- (void)
setEp1: (CGPoint) inVal
{
NSString* v = ::NSStringFromPoint(::NSPointFromCGPoint(inVal));
self.shadowEP1 = v;
}


When executing the line

self.shadowEP1 = v;

I get the following in the console:

	-[WireSegment setShadowEP1:]: unrecognized selector sent to  
instance 0x1067600


In the CoreData model, ep1 is a transient undefined attribute, and  
shadowEP1 is an NSString.


Any suggestions as to what's wrong? Thanks!

--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: substitute class at runtime?

2008-07-18 Thread Kyle Sluder
On Sat, Jul 19, 2008 at 1:10 AM, Andy Lee <[EMAIL PROTECTED]> wrote:
> Am I misunderstanding?

No, I assure you that I'm the one who misunderstood.  Although now the
question is why would one use an array of strings when one could use
an array of Class objects... maybe because the strings are coming from
elsewhere.

Sorry about that.

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


how to clear the whole render tree of CALayer fast and safely?

2008-07-18 Thread Cloud Strife
Hi, everyone.Assuming there is a Core Animation render tree with many
calayers and complex levels, should I use the iteration function to remove
one layer from one layer or there just is some useful function to delete the
whole render tree neatly at once to make the app robust ?

After created and some work to the existing render tree, I want to clean it
to release the CPU and memory and GPU it occupied. Because the performance
and stability are the main keys of my application. I wrote some ugly code to
do that, as expected, the result is very bad, my application crashed ...
:-(

[self cleanWindowContentViewSubLayers:[[[_aWindow contentView] layer]
sublayers ]];


-(void) cleanWindowContentViewSubLayers:(NSArray*)_Layers{

int i, count = [_Layers count];

for(i = 0;i < count; i++){

CALayer* _oneLayer = (CALayer*)[_Layers objectAtIndex:i];

[self cleanWindowContentViewSubLayers:[_oneLayer sublayers]];

//if the _oneLayer is the leaf of the render tree, when iterating the next
level of the stack, the for statement won't execute for the _Layers == nil

//then we can delete it

[_oneLayer removeFromSuperlayer];

[_oneLayer release];

}

}

here are so many smart developers. Would any one give me a guidance to
accomplish this task?

Any discussion or help is highly welcome. :-)

Thank you in advance.



-- 
Best regards.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


CoreData Property access compiles, but fails at runtime

2008-07-18 Thread Rick Mann
I have a CoreData entity called WireSegment, and a class to implement  
it. A stripped-down version looks like this:


@interface
WireSegment : NSManagedObject
{
}

@property   CGPoint ep1;
@property (retain)  NSString*   shadowEP1;

@end

@implementation WireSegment

@dynamic shadowEP1;

- (CGPoint)
ep1
{
NSString* v = self.shadowEP1;
NSPoint nsP = ::NSPointFromString(v);
return ::NSPointToCGPoint(nsP);
}

- (void)
setEp1: (CGPoint) inVal
{
NSString* v = ::NSStringFromPoint(::NSPointFromCGPoint(inVal));
self.shadowEP1 = v;
}


When executing the line

self.shadowEP1 = v;

I get the following in the console:

	-[WireSegment setShadowEP1:]: unrecognized selector sent to instance  
0x1067600


In the CoreData model, ep1 is a transient undefined attribute, and  
shadowEP1 is an NSString.


Any suggestions as to what's wrong? Thanks!

--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: WebView load background color.

2008-07-18 Thread Andy Lee
I'm afraid I don't know, but please don't post a new question by  
replying to an existing question.  It screws up the threading in Mail.


--Andy

On Jul 19, 2008, at 1:15 AM, Bruce Cresanta wrote:


Hello,

	Is it possible to change the background color when loading a  
WebView from white to whatever?


Thank you,

Bruce

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dot Syntax docs missing?

2008-07-18 Thread Andy Lee

On Jul 19, 2008, at 1:01 AM, Rick Mann wrote:

On Jul 18, 2008, at 21:53:45, Andy Lee wrote:
How up-to-date are your docs?  Maybe the Dot Syntax section wasn't  
written yet in your version of the docs.



I was looking online, at the ADC website.

I'll check Xcode.


Interesting... the online doc is missing a couple of sections that my  
Xcode doc has.  I'm looking here:





Oddly, the online version would seem to be *newer*.  At the bottom of  
the page it says "Last updated: 2008-07-08", whereas my Xcode doc says  
"(Last updated: 2008-06-09)".


Maybe the docs were reorganized a bit for 3.1.

--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


WebView load background color.

2008-07-18 Thread Bruce Cresanta

Hello,

	Is it possible to change the background color when loading a WebView  
from white to whatever?


Thank you,

Bruce
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dot Syntax docs missing?

2008-07-18 Thread Rick Mann


On Jul 18, 2008, at 21:51:57, Jerry Krinock wrote:

setEp1: should work.  The colon is significant and is a part of the  
method name.


In fact, I do have the colon in the actual definition. Definitely  
something else is going on, I think.


I would advise you to embrace and learn both the dot syntax and  
square brackets.


Well, I'm forced to use the square brackets for method calls (excuse  
me, "message sends"), and I love square brackets as array index  
operators. I don't think I'll ever embrace them for method dispatch.



--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: property name-to-accessor munging? (was: Dot Syntax docs missing?)

2008-07-18 Thread Rick Mann


On Jul 18, 2008, at 22:00:56, Andy Lee wrote:

I haven't used either properties or dot syntax myself, but in the  
sidebar of the Objective-C 2.0 doc I see a "Declared Properties"  
section with a "Using Properties" subsection which has a "Property  
Declaration" section.  Looks like what you want.


Do you see something different?



No, I see that stuff. But I must be skimming it too lightly...I'm not  
finding a description of how it transliterates by default.


I think I'm pretty sure how it works. I even tried explicitly setting  
the getter/setter name with the declaration attributes. They're not  
getting called for some other reason, I think.


Thanks to all for their help.

--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dot Syntax docs missing?

2008-07-18 Thread Glenn L. Austin

On Jul 18, 2008, at 8:58 PM, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C 2.0  
docs (Properties section) refers you "Dot Syntax." A search of ADC  
turns up the first hit:


Look for Graphviz.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: substitute class at runtime?

2008-07-18 Thread Andy Lee

On Jul 19, 2008, at 12:58 AM, Kyle Sluder wrote:

On Fri, Jul 18, 2008 at 2:05 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

NSClassFromString()


No, just use [ClassName class].  NSObject's +class method returns the
class itself (in other words, it's as if the metaclass defined -class
to return self).


Am I misunderstanding?  The given code has an array of NSStrings which  
are names of controller classes.  I assumed Nathaniel wanted to  
convert one of those names to a class.


On Jul 18, 2008, at 2:00 PM, Nathaniel Gottlieb-Graham wrote:

NSString *nameOfClass = fooViewController

NSArray *classNameArray = [NSArray arrayWithObjects:  
@"FooViewController", @"BarViewController", nil];


if ([classNameArray containsObject:nameOfClass])
{
[[[??? alloc]initWithNibName:nameOfClass] autorelease]
}


I think the solution is

[[[NSClassFromString(nameOfClass) alloc]  
initWithNibName:nameOfClass] autorelease];


This may or may not be correct for other reasons, but I *think* it's  
what Nathaniel wanted.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dot Syntax docs missing?

2008-07-18 Thread Rick Mann


On Jul 18, 2008, at 21:53:45, Andy Lee wrote:

How up-to-date are your docs?  Maybe the Dot Syntax section wasn't  
written yet in your version of the docs.



I was looking online, at the ADC website.

I'll check Xcode.

--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: property name-to-accessor munging? (was: Dot Syntax docs missing?)

2008-07-18 Thread Andy Lee

On Jul 19, 2008, at 12:53 AM, Rick Mann wrote:
I realize after all this, it's not really the Dot Syntax I need. I  
need to know how a property name (starts with lower-case letter) is  
transliterated into the getter/setter names.


I haven't used either properties or dot syntax myself, but in the  
sidebar of the Objective-C 2.0 doc I see a "Declared Properties"  
section with a "Using Properties" subsection which has a "Property  
Declaration" section.  Looks like what you want.


Do you see something different?

--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: substitute class at runtime?

2008-07-18 Thread Kyle Sluder
On Fri, Jul 18, 2008 at 2:05 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
> NSClassFromString()

No, just use [ClassName class].  NSObject's +class method returns the
class itself (in other words, it's as if the metaclass defined -class
to return self).

--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: Dot Syntax docs missing?

2008-07-18 Thread Andy Lee
The Xcode doc window is your friend.  I did a search for "dot syntax"  
and "The Dot Syntax" was the second hit.


>


Here's the link to my Obj-C 2.0 docs:

>


For me, there's a link on the sidebar to "The Dot Syntax".  Do you not  
have this link?


How up-to-date are your docs?  Maybe the Dot Syntax section wasn't  
written yet in your version of the docs.


--Andy


On Jul 18, 2008, at 11:58 PM, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C 2.0  
docs (Properties section) refers you "Dot Syntax." A search of ADC  
turns up the first hit:


The Objective-C 2.0 Programming Language: The Dot Syntax - Size: 24k
... The ... Syntax. Objective-C provides a ... ( . ... Listing 4-5  
Accessing properties

using the ... syntax. Graphic *graphic = [[Graphic alloc] init]; ...
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Articles/
chapter_5_section_4.html

Clicking that link, however, takes you to "Subclassing with  
Properties".


I have a property named "ep1". I need to implement accessors for it,  
but they're not getting called. I've tried variations of


setEp1
setep1
setEP1

none of those works.

Any suggestions? TIA,
--
Rick

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%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]


property name-to-accessor munging? (was: Dot Syntax docs missing?)

2008-07-18 Thread Rick Mann
I realize after all this, it's not really the Dot Syntax I need. I  
need to know how a property name (starts with lower-case letter) is  
transliterated into the getter/setter names.


On Jul 18, 2008, at 20:58:35, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C 2.0  
docs (Properties section) refers you "Dot Syntax." A search of ADC  
turns up the first hit:


The Objective-C 2.0 Programming Language: The Dot Syntax - Size: 24k
... The ... Syntax. Objective-C provides a ... ( . ... Listing 4-5  
Accessing properties

using the ... syntax. Graphic *graphic = [[Graphic alloc] init]; ...
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Articles/
chapter_5_section_4.html

Clicking that link, however, takes you to "Subclassing with  
Properties".


I have a property named "ep1". I need to implement accessors for it,  
but they're not getting called. I've tried variations of


setEp1
setep1
setEP1

none of those works.

Any suggestions? TIA,
--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dot Syntax docs missing?

2008-07-18 Thread Jens Alfke


On 18 Jul '08, at 9:44 PM, Rick Mann wrote:

I know how to use the dot syntax in the typical case. What I want is  
an authoritative reference on how property names change case to  
match accessor functions I define.


It's probably described in the documentation for Key-Value Coding.


If you have a choice, avoid using dot syntax at all.


Really? Why? Seems like Apple encourages it quite strongly, and I  
frakking hate square brackets.


I agree. Some people might have a religious objection to dots, but I  
find they're easier to type and make the overall syntax a lot clearer.


—Jens



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: Dot Syntax docs missing?

2008-07-18 Thread Jerry Krinock


On 2008 Jul, 18, at 20:58, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C 2.0  
docs (Properties section) refers you "Dot Syntax."


It also refers to "structure elements", by which they mean a C  
struct.  Remember, Objective-C is built on C.  With properties, as  
with C structs, you use a dot to indicate descent into the property  
hierarchy, such as the example they give there, myInstance.value.  For  
a more complicated example, consider  
planet.continent.nation.region.city.


I have a property named "ep1". I need to implement accessors for it,  
but they're not getting called. I've tried variations of


setEp1
setep1
setEP1


setEp1: should work.  The colon is significant and is a part of the  
method name.



If you have a choice, avoid using dot syntax at all.


Really? Why? Seems like Apple encourages it quite strongly, and I  
frakking hate square brackets.


I would advise you to embrace and learn both the dot syntax and square  
brackets.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dot Syntax docs missing?

2008-07-18 Thread Rick Mann


On Jul 18, 2008, at 21:37:59, Diop Mercer wrote:


Rick, I think all you need to do is say:

//set
someobject.someproperty = foo;

//get
bar = someobject.someproperty;


I know how to use the dot syntax in the typical case. What I want is  
an authoritative reference on how property names change case to match  
accessor functions I define.



If you have a choice, avoid using dot syntax at all.


Really? Why? Seems like Apple encourages it quite strongly, and I  
frakking hate square brackets.



--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dot Syntax docs missing?

2008-07-18 Thread Glenn L. Austin


On Jul 18, 2008, at 9:08 PM, Rick Mann wrote:



On Jul 18, 2008, at 21:05:33, Glenn L. Austin wrote:


On Jul 18, 2008, at 8:58 PM, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C  
2.0 docs (Properties section) refers you "Dot Syntax." A search of  
ADC turns up the first hit:


Look for Graphviz.


What? No, I'm referring to the dot syntax of Objective-C 2.0  
properties.


Sorry, wrong Dot Syntax...
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dot Syntax docs missing?

2008-07-18 Thread Rick Mann


On Jul 18, 2008, at 21:05:33, Glenn L. Austin wrote:


On Jul 18, 2008, at 8:58 PM, Rick Mann wrote:

Where is the description of the dot syntax? The top of the Obj-C  
2.0 docs (Properties section) refers you "Dot Syntax." A search of  
ADC turns up the first hit:


Look for Graphviz.




What? No, I'm referring to the dot syntax of Objective-C 2.0 properties.

--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Dot Syntax docs missing?

2008-07-18 Thread Rick Mann
Where is the description of the dot syntax? The top of the Obj-C 2.0  
docs (Properties section) refers you "Dot Syntax." A search of ADC  
turns up the first hit:


The Objective-C 2.0 Programming Language: The Dot Syntax - Size: 24k
... The ... Syntax. Objective-C provides a ... ( . ... Listing 4-5  
Accessing properties

using the ... syntax. Graphic *graphic = [[Graphic alloc] init]; ...
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Articles/
chapter_5_section_4.html

Clicking that link, however, takes you to "Subclassing with Properties".

I have a property named "ep1". I need to implement accessors for it,  
but they're not getting called. I've tried variations of


setEp1
setep1
setEP1

none of those works.

Any suggestions? TIA,
--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 8:31 PM, Michael Ash wrote:

On Fri, Jul 18, 2008 at 7:48 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

We'll just have to disagree on how odd the objections are.

Corner case or not, we must understand that retains, wherever they  
occur,
must be balanced with releases.  Therefore we must understand that  
the same
object can "own" another object multiple times -- it happens all  
the time.
In fact, at the time you take ownership of something, you have no  
idea how
many times you've owned it already.  IMO this is not mere hair- 
splitting.
It blows away the normal English concept of ownership, which is  
binary: you

as an individual either own something or you don't.


I think it is hair splitting simply because it doesn't matter. You
only see this problem if you take a global view of the situation. But
the whole point of Cocoa memory management is to remove the
requirement to take such a global view. The concept of ownership can
be applied to the individual pointer variables, which makes this all
go away.


The funny thing is, I didn't take such a global view until I found  
that something about the word "ownership" nagged at me.  I usually  
take a very local and low-level view.  In the case where I receive an  
object I own (to use the terminology), I think: "I don't know or care  
what the actual retain count and autorelease count are; I only know I  
have to treat this object *as if* it has a retain count of 1 and no  
autoreleases."  In the other case, I think: "I don't know or care  
etc.; I only know I have to treat this object *as if* it has a retain  
count of 1 and an autorelease count of 1."


It's only when the ownership metaphor was applied that I questioned  
whether the abstraction holds up.


This is why I never call the retain count a reference count,  
although it
seems like the two terms have become interchangeable lately (I  
could swear
that once upon a time the distinction mattered).  Reference counts  
are about

ownership; retain counts are about bookkeeping.


I've never heard such a distinction made before. I've seen "reference
count" used to describe bookkeeping all over the place, for example in
many primitive garbage collection systems.


I've definitely heard the distinction made, but it was a long, long  
time ago.  As far as I can tell from Google, I'm the only one who  
remembers, because everybody uses them interchangeably.


The distinction, as it was made to me, is that a retain count isn't  
necessarily the number of references your program has to the object,  
whereas something like the reference count in a simple C++ String  
class is precisely the number of references your program has to the  
char buffer.


(Note: my knowledge of C++ is very outdated, but I believe, from the  
link you included below, that the old simple String class is still a  
relevant example.  I thought it was very clever when it was explained  
to me.)



Using
"ownership" to indicate responsibility for freeing an object is
nothing unusual.


Hm.  Apparently it isn't.  Okay, that makes me a little more  
comfortable with the term.



The only unusual thing Cocoa does with it is allow
multiple owners.


I'm confused by this statement.  Take that simple C++ String class  
again.  If you have:


String a = "aaa";
String b = a;
String c = a;

...don't a, b, and c all own the underlying char buffer?  (And yes, a  
char buffer isn't an object, but that's what the article you linked to  
is referring to when it mentions ownership.)


--Andy


See for example this random LinuxDevCenter article on C++ memory  
management:


http://www.linuxdevcenter.com/pub/a/linux/2003/06/19/cpp_mm-1.html

Same terminology, same basic concepts, just much greater difficulty
due to ownership being singular.




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Inverse Regex Library?

2008-07-18 Thread Philip Mötteli


Am 19.07.2008 um 02:13 schrieb Marcel Weiher:



On Jul 17, 2008, at 14:11 , Philip Mötteli wrote:


What I'm asking is, if you can
identify everything that is not a too-many relationship, find them  
via

a process of elimination (if it's not something I can identify, then
it must be a too-many).


But I can't make this analysis every-time an object gets  
serialized. My program would be way too slow.



You want to do the original processing every time an object gets  
serialized?


Marcel… Read the sentence: "I can NOT make this analysis every-time an  
object gets serialized".


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Unicode names

2008-07-18 Thread Adam R. Maxwell


On Jul 18, 2008, at 5:45 AM, Gerriet M. Denkmann wrote:

Is there a way (Cocoa, Carbon or whatsoever) to get the Unicode name  
of a character?


Like: unicodeName( 0x1D110 ) = "MUSICAL SYMBOL FERMATA".

Sure, I could (at least on 10.4.11) read /System/Library/Perl/5.8.6/ 
unicore/UnicodeData.txt, but as Unicode names are used in Edit ->  
Special Characters... there might be some system function to get at  
this info.


Try CFStringTransform() with kCFStringTransformToUnicodeName.

--
Adam

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]

Unicode names

2008-07-18 Thread Gerriet M. Denkmann
Is there a way (Cocoa, Carbon or whatsoever) to get the Unicode name  
of a character?


Like: unicodeName( 0x1D110 ) = "MUSICAL SYMBOL FERMATA".

Sure, I could (at least on 10.4.11) read /System/Library/Perl/5.8.6/ 
unicore/UnicodeData.txt, but as Unicode names are used in Edit ->  
Special Characters... there might be some system function to get at  
this info.


Kind regards,

Gerriet.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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] No iPhone SDK/development discussion here!!! Re: MoveMe gone?

2008-07-18 Thread Scott Anguish

iPhone SDK
--

Until an announcement is made otherwise, developers should be aware  
that the iPhone SDK is still under non-disclosure (section 5.3 of the  
iPhone Development Agreement). It can't be discussed here, or anywhere  
publicly. This includes other mailing lists, forums, and definitely  
blogs.


This situation is somewhat different than a Mac OS X release, in that  
a Mac OS X release includes a copy of the developer tools with the  
distribution. The iPhone OS 2.0 release on devices and as an upgrade  
does _not_ include the development tools. As a result, the SDK is not  
automatically considered public because the release has occurred.


Section 5.3 of the iPhone Development Agreement remains in force at  
this time, and will so remain until iPhone Developer Program members  
are specifically and personally notified by an authorized  
representative of Apple.



On 18-Jul-08, at 7:57 PM, Diop Mercer wrote:


Hi, I'm trying to download the sample project MoveMe from the dev
center website:
http://developer.apple.com/iphone/gettingstarted/docs/creatingiphoneapps.action

According to the link, it is supposed to be available here:

http://developer.apple.com/iphone/library/samplecode/MoveMe/index.html


but it isn't.   I get an error page instead.  Should I look elsewhere?



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Steve Weller


On Jul 18, 2008, at 1:55 PM, Hamish Allan wrote:


On Fri, Jul 18, 2008 at 9:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:


What would you use for adjectives -- "owned" and "unowned"?


How about "retained" and "unretained"? As in: "this method returns an
unretained object".



How about "dependent" and "independent".

It it's dependent, they you have a responsibility for it, maybe many  
times over. If it is independent, then you don't.


This also talks in terms of the relationship, not the means to  
establishing that relationship.



Steve Weller   [EMAIL PROTECTED]
Technical Writing, Editing, Developer Guides, and a little Cocoa



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Michael Ash
On Fri, Jul 18, 2008 at 7:48 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
> On Jul 18, 2008, at 6:41 PM, Michael Ash wrote:
>>
>> On Fri, Jul 18, 2008 at 4:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
>>>
>>> On Jul 18, 2008, at 3:49 PM, Michael Ash wrote:

 The better term already exists: "own". As in, "you own the return
 value" or "you do not own the return value". This tells you everything
 you need to know.
>>>
>>> Well, as I said I don't agree with the connotations of "own."
>>
>> I find that objection to be rather odd. Your objections are all corner
>> cases, or things where the English usage doesn't *quite* line up with
>> the programming usage.
>
> We'll just have to disagree on how odd the objections are.
>
> Corner case or not, we must understand that retains, wherever they occur,
> must be balanced with releases.  Therefore we must understand that the same
> object can "own" another object multiple times -- it happens all the time.
>  In fact, at the time you take ownership of something, you have no idea how
> many times you've owned it already.  IMO this is not mere hair-splitting.
>  It blows away the normal English concept of ownership, which is binary: you
> as an individual either own something or you don't.

I think it is hair splitting simply because it doesn't matter. You
only see this problem if you take a global view of the situation. But
the whole point of Cocoa memory management is to remove the
requirement to take such a global view. The concept of ownership can
be applied to the individual pointer variables, which makes this all
go away.

> This is why I never call the retain count a reference count, although it
> seems like the two terms have become interchangeable lately (I could swear
> that once upon a time the distinction mattered).  Reference counts are about
> ownership; retain counts are about bookkeeping.

I've never heard such a distinction made before. I've seen "reference
count" used to describe bookkeeping all over the place, for example in
many primitive garbage collection systems.

> As for the "has-a" connotation, I suggest you ask any non-Cocoa developer
> what they think it means for one object to own another.

If they're coming from a garbage collected language I have no doubt
they'll be confused. If they're coming from a language which requires
manual memory management then I expect that they'll understand
immediately, because it's standard usage of the term. Using
"ownership" to indicate responsibility for freeing an object is
nothing unusual. The only unusual thing Cocoa does with it is allow
multiple owners.

See for example this random LinuxDevCenter article on C++ memory management:

http://www.linuxdevcenter.com/pub/a/linux/2003/06/19/cpp_mm-1.html

Same terminology, same basic concepts, just much greater difficulty
due to ownership being singular.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: tidying HTML up

2008-07-18 Thread Marcel Weiher


On Jul 18, 2008, at 14:22 , Ivan wrote:

	Since NSXMLDocument is no longer (or never had really been) part of  
the iPhone SDK, now I find my app can't be run on my iPhone. So, I  
wonder if is there any way I could take to keep on with my  
development. Just found tidylib at sourceforge, but don't know if it  
is possible to import it in any way into my Xcode and my iPhone app  
(at least within a reasonable time/effort limits).


Objective-XML has a SAX parser (NSXMLParser-compatible) that can deal  
with untidy XML/HTML:


http://www.metaobject.com/downloads/Objective-C/Objective-XML-4.2.tar.gz

Rumor has it that it can work on small embedded devices, but I  
wouldn't know about that.


Marcel
p.s.:  tidying a document using NSXMLDocument or tidy and then parsing  
it using a SAX parser is just about pessimal from both a code- 
complexity and performance point of view.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Inverse Regex Library?

2008-07-18 Thread Marcel Weiher


On Jul 17, 2008, at 14:11 , Philip Mötteli wrote:


What I'm asking is, if you can
identify everything that is not a too-many relationship, find them  
via

a process of elimination (if it's not something I can identify, then
it must be a too-many).


But I can't make this analysis every-time an object gets serialized.  
My program would be way too slow.



You want to do the original processing every time an object gets  
serialized?   That seems...odd.  Would you care to explain what you  
are trying to accomplish by generating regexes from examples when  
serializing?  Compression?


Marcel

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: MoveMe gone?

2008-07-18 Thread Diop Mercer
Ok, answered my own question: found it under
http://developer.apple.com/iphone/library/samplecode/MoveMe

Somebody should fix that link!


-m



On Fri, Jul 18, 2008 at 7:57 PM, Diop Mercer <[EMAIL PROTECTED]> wrote:
> Hi, I'm trying to download the sample project MoveMe from the dev
> center website:
> http://developer.apple.com/iphone/gettingstarted/docs/creatingiphoneapps.action
>
> According to the link, it is supposed to be available here:
>
> http://developer.apple.com/iphone/library/samplecode/MoveMe/index.html
>
>
> but it isn't.   I get an error page instead.  Should I look elsewhere?
>
>
> Thanks,
> -m
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSViewController Binding Problem continued

2008-07-18 Thread Hamish Allan
On Fri, Jul 18, 2008 at 11:18 PM, Cathy Shive <[EMAIL PROTECTED]> wrote:

> I wonder if it would actually make a difference in this case.  Since the nib
> doesn't get loaded until the 'load view' method is called

Nor it does.

> and she's setting
> the rO directly after the initializer (before requesting the view), the
> result would be the same, right?

Indeed. In the face of that, it's not clear to me why the tableview
doesn't know that the representedObject is an arrayController, given
that the bindings can't have been set up until after the nib is
loaded.

>  Either way, the object you're binding to
> is the view controller and not the array controller that the NSTableView
> requires.

I'd definitely call that requirement a bug.

>> Or you could argue that, according to the principles of duck typing,
>> NSTableView shouldn't care, just as long as
>> representedObject.arrangedObjects.displayText quacks like an array. In
>> which case it's a bug.
>
> Seems like this is the real issue ;)
>
> I'm really curious to find a solution to this, too - one that doesn't
> involve adding another array controller to the app or moving the bindings
> setup to code.   Going to code isn't too bad, tho...

I haven't yet come across a situation in which it would be desirable
for an NSTableView and its associated NSArrayController to be in
separate nibs. I guess Apple haven't, either ;)

> I guess that it would be nice if IB would let you bind directly to
> representedObject when the File's Owner's class is set to an
> NSViewController so that when the nib is loaded, the table view gets what it
> wants.

Seems like a bit of a special case to me to circumvent something that
Apple could just fix properly! Mind you, it might be nice not to have
to type "representedObject." in front of every binding in a view
nib...

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Hamish Allan
On Fri, Jul 18, 2008 at 10:10 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

> On Jul 18, 2008, at 4:55 PM, Hamish Allan wrote:
>>
>> On Fri, Jul 18, 2008 at 9:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
>>
>>> What would you use for adjectives -- "owned" and "unowned"?
>>
>> How about "retained" and "unretained"? As in: "this method returns an
>> unretained object".
>
> Unfortunately, there's no such thing as an unretained object.  When an
> object stops being retained, it gets dealloced.

True. The idea was to encourage the caller to think in terms of their
own responsibility towards that object rather than anyone else's. But
it might be confusing.

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Hamish Allan
On Fri, Jul 18, 2008 at 9:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

> What would you use for adjectives -- "owned" and "unowned"?

How about "retained" and "unretained"? As in: "this method returns an
unretained object".

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


Background Color on WebView Load.

2008-07-18 Thread Bruce Cresanta

Hello,

	How does one change the background color from "White" when a Webview  
is loading resources?I have tried to change the view alpha's to  
0.0 and I've also subclassed WebView to re-implement drawRect..   I  
suspected that its either the documentView, webView, or frameView that  
needs to have the background changed, so I've also tried to lock focus  
on these views and repaint them; this works to avoid the white "color- 
flicker" but overpaints the view.Subclassing can touch neither the  
documentView or the frameView internal to the webView.  So far,  
nothing works.


Would you please offer assistance?


Thanks,

Bruce
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


MoveMe gone?

2008-07-18 Thread Diop Mercer
Hi, I'm trying to download the sample project MoveMe from the dev
center website:
http://developer.apple.com/iphone/gettingstarted/docs/creatingiphoneapps.action

According to the link, it is supposed to be available here:

http://developer.apple.com/iphone/library/samplecode/MoveMe/index.html


but it isn't.   I get an error page instead.  Should I look elsewhere?


Thanks,
-m
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 6:41 PM, Michael Ash wrote:

On Fri, Jul 18, 2008 at 4:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:

On Jul 18, 2008, at 3:49 PM, Michael Ash wrote:

The better term already exists: "own". As in, "you own the return
value" or "you do not own the return value". This tells you  
everything

you need to know.


Well, as I said I don't agree with the connotations of "own."


I find that objection to be rather odd. Your objections are all corner
cases, or things where the English usage doesn't *quite* line up with
the programming usage.


We'll just have to disagree on how odd the objections are.

Corner case or not, we must understand that retains, wherever they  
occur, must be balanced with releases.  Therefore we must understand  
that the same object can "own" another object multiple times -- it  
happens all the time.  In fact, at the time you take ownership of  
something, you have no idea how many times you've owned it already.   
IMO this is not mere hair-splitting.  It blows away the normal English  
concept of ownership, which is binary: you as an individual either own  
something or you don't.


This is why I never call the retain count a reference count, although  
it seems like the two terms have become interchangeable lately (I  
could swear that once upon a time the distinction mattered).   
Reference counts are about ownership; retain counts are about  
bookkeeping.


As for the "has-a" connotation, I suggest you ask any non-Cocoa  
developer what they think it means for one object to own another.



But you have no problem with "autoreleased"
even though it is just plain wrong.


Oh, I have a problem with it now -- see my more recent replies.

--Andy


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSViewController Binding Problem continued

2008-07-18 Thread Jonathan Dann

Hi Ivy,

Can you tell us what the bound object the table receives is?  If you  
could call this method (which, in its current state, would go in an  
NSTableView subclass) somewhere:


- (NSArrayController *)arrayController;
{
	return [[[self tableColumnWithIdentifier:@"myColumn"]  
infoForBinding:NSValueBinding] valueForKey:NSObservedObjectKey];	

}

then print the results to the console.  Calling it at the end of  
awakeFromNib: with a -performSelector:withObject:afterDelay: (not  
necessary but just to be sure!) should do the trick.  Is what you get  
back an array controller?


Jonathan

www.espresso-served-here.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: tidying HTML up

2008-07-18 Thread Jens Alfke


On 18 Jul '08, at 3:07 PM, Ivan wrote:

I'm asking for alternatives to NSXMLDocument to get a tidy XHTML  
document ready to be parsed with the NSXMLParser class


NSXML uses libTidy. If for some reason you can't use those, you should  
be able to build libTidy yourself and link it into your app. (Just be  
careful with licenses — if libTidy is LGPL, you can't statically link  
it into your app unless your app is also GPL.) You'd probably want to  
create a new dynamic-library target in Xcode and add the libTidy  
source files to it.


—Jens

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]

NSTableHeaderView shifting after scrolling

2008-07-18 Thread Peter Hudson
I've had similar troubles.  I fixed it by setting the min and max  
width of the column - and then an actual width as well.

Then set it non re-sizeable.

PH
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Michael Ash
On Fri, Jul 18, 2008 at 4:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
> On Jul 18, 2008, at 3:49 PM, Michael Ash wrote:
>> The better term already exists: "own". As in, "you own the return
>> value" or "you do not own the return value". This tells you everything
>> you need to know.
>
> Well, as I said I don't agree with the connotations of "own."

I find that objection to be rather odd. Your objections are all corner
cases, or things where the English usage doesn't *quite* line up with
the programming usage. But you have no problem with "autoreleased"
even though it is just plain wrong.

In any case, none of your objections appear to apply to the use of the
word "own" to describe the status of an object returned from a method.

>  I'm not even
> comfortable with "you" -- who is "you"?

This is just a bit of informality. In formal documentation I would
expect this to read as "The caller owns the return value" and "The
caller does not own the return value".

>  But once you accept the terms, "you
> own the return value" has the benefit of being concise and consistent.
>
> What would you use for adjectives -- "owned" and "unowned"?

Owned and "not owned", if you needed them. I'd try to avoid them at
least for describing return values; the sentences I propose above get
the point across better without needing them. "Returns an owned
object" is not really sensible; you need to say *who* owns it,
precisely to address the possibility of multiple owners which you
mentioned in a previous post. You can say "owned by X", but then you
might as well reverse it and get rid of the passive voice.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSViewController Binding Problem continued

2008-07-18 Thread Cathy Shive

On Jul 17, 2008, at 10:26 PM, Hamish Allan wrote:


You might wish to file an enhancement request for NSViewController to
provide an init method taking a representedObject to be set up before
attempting bindings etc., which would circumvent this issue.



I wonder if it would actually make a difference in this case.  Since  
the nib doesn't get loaded until the 'load view' method is called and  
she's setting the rO directly after the initializer (before requesting  
the view), the result would be the same, right?  Either way, the  
object you're binding to is the view controller and not the array  
controller that the NSTableView requires.



Or you could argue that, according to the principles of duck typing,
NSTableView shouldn't care, just as long as
representedObject.arrangedObjects.displayText quacks like an array. In
which case it's a bug.



Seems like this is the real issue ;)

I'm really curious to find a solution to this, too - one that doesn't  
involve adding another array controller to the app or moving the  
bindings setup to code.   Going to code isn't too bad, tho...


I guess that it would be nice if IB would let you bind directly to  
representedObject when the File's Owner's class is set to an  
NSViewController so that when the nib is loaded, the table view gets  
what it wants.


Just some wishful thinking.

Best,
Cathy


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: tidying HTML up

2008-07-18 Thread Ivan

Please Mr. Jobe, keep on-topic :-)

I'm asking for alternatives to NSXMLDocument to get a tidy XHTML  
document ready to be parsed with the NSXMLParser class, nothing to do  
with iPhone... :-)


OK, I'm sory, I'll check for another list.

Ivan.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Michael Vannorsdel
In my office we usually call objects returned directly without an  
autorelease as "short returned" and an retain-autoreleased object as  
"pooled".  Though these sound more slang than something that could be  
official.



On Jul 18, 2008, at 3:10 PM, Andy Lee wrote:

Unfortunately, there's no such thing as an unretained object.  When  
an object stops being retained, it gets dealloced.


I thought of "pre-retained" and not "not pre-retained," but those  
are ugly and probably flawed in some way too.  Anyway, I'm done  
making suggestions for now.  There will be plenty of opportunities  
the inevitable next time this topic heats up. :)


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


tidying HTML up

2008-07-18 Thread Ivan

Hi,

	I'm developing a Cocoa Touch app for the iPhone/iPod Touch and I was  
using NSXMLDocument with the tidyXHTML option to transform some web  
paged into safe XML documents that I parsed with NSXMLParser later on.


	Since NSXMLDocument is no longer (or never had really been) part of  
the iPhone SDK, now I find my app can't be run on my iPhone. So, I  
wonder if is there any way I could take to keep on with my  
development. Just found tidylib at sourceforge, but don't know if it  
is possible to import it in any way into my Xcode and my iPhone app  
(at least within a reasonable time/effort limits).


Hope someone can help!

Cheers!

Ivan.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 4:55 PM, Hamish Allan wrote:

On Fri, Jul 18, 2008 at 9:21 PM, Andy Lee <[EMAIL PROTECTED]> wrote:


What would you use for adjectives -- "owned" and "unowned"?


How about "retained" and "unretained"? As in: "this method returns an
unretained object".


Unfortunately, there's no such thing as an unretained object.  When an  
object stops being retained, it gets dealloced.


I thought of "pre-retained" and not "not pre-retained," but those are  
ugly and probably flawed in some way too.  Anyway, I'm done making  
suggestions for now.  There will be plenty of opportunities the  
inevitable next time this topic heats up. :)


--Andy


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread mmalc crawford


On Jul 18, 2008, at 1:48 PM, Andy Lee wrote:


On Jul 18, 2008, at 4:19 PM, mmalc crawford wrote:

On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:


NSString *name = [aPerson name];

[aPerson setName:@"Fido"];
NSLog(@"Old name: %@", name);


And calling the return value from -name "autoreleased" would imply  
the second implementation, which might not be the case.



Indeed.

Out of curiosity, is this what the docs mean in the few places they  
say a return value is autoreleased, or is that just someone making  
the same old mistake?


I don't know for each individual case, but I suspect it's more likely  
to be the same old mistake.  Each really ought to be investigated.



Moreover, saying that an object is "autoreleased" also implies the  
overhead of adding it to an autorelease pool, suggesting that it  
may be more expensive to retrieve the object than is actually the  
case.
Okay... I thought I had a reasonable suggestion but I see it was a  
pretty crappy one.  I'll see if I can get comfortable with the  
ownership terminology.


Looking at your earlier reply, I take the point about "ownership" --  
if someone can come up with something better, that would be great!


mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 4:19 PM, mmalc crawford wrote:

On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:

"Autoreleased" is inaccurate and is not a proper shorthand for  
"you must retain it if you want it to stick around".
To understand why, consider two possible implementations of a get  
accessor:


- (NSString *)name {
 return name;
}
- (NSString *)name {
 return [[name retain] autorelease];
}

I don't see the difference from the caller's point of view.


NSString *name = [aPerson name];
[aPerson setName:@"Fido"];
NSLog(@"Old name: %@", name);


And calling the return value from -name "autoreleased" would imply the  
second implementation, which might not be the case.


Out of curiosity, is this what the docs mean in the few places they  
say a return value is autoreleased, or is that just someone making the  
same old mistake?  It's trivial to find these instances by searching  
for "autoreleased" in Xcode.


Moreover, saying that an object is "autoreleased" also implies the  
overhead of adding it to an autorelease pool, suggesting that it may  
be more expensive to retrieve the object than is actually the case.


Okay... I thought I had a reasonable suggestion but I see it was a  
pretty crappy one.  I'll see if I can get comfortable with the  
ownership terminology.


--Andy





I don't think I have ever said method X returns an autoreleased  
object.  I was suggesting either the term could be accepted in the  
way that other people (and some Apple docs) use it, or someone  
could come up with a better term.


There is already another term -- owns.  As stated initially,  
"autorelease" is inaccurate and misleading.



There is a reason people keep using the term incorrectly


That's exactly what you're doing here.

mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSViewController Binding Problem continued

2008-07-18 Thread Jonathan Dann

Hi Ivy,

You can bind the representedObject in NIB, I do it all the time.  My  
rO is an NSPersistentDocument subclass, which is set immediately after  
the view controller is -init-ed.  The bindings in the nib are only set  
up after -loadView is called, which occurs after something in your app  
asks for the -view.  So as long as the rO is not nil when -loadView is  
called then it should bind properly.  Granted though I haven't tried  
it with an NSController subclass as the rO.


Have you tried binding it in code during -awakeFromNib?

Jonathan

www.espresso-served-here.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]

NSPopUpButton style question ... "Push" v.s. "Round Textured"

2008-07-18 Thread lbland

hi-

The default NSPopUpButton button style is Push.

But, I'm getting board of it and it looks old-style.

I think the button style of Round Textured is more "modern".

Now I see that Xcode 3.0 -> 3.1 changes the PUB button style to Round  
Textured (I think)! Looks yummy!


Is "Round Textured" PUB the way to go for new apps? (I think so, but  
I can't figure out what is "standard" for "modern").


thanks!-

-lance


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 3:49 PM, Michael Ash wrote:

I don't see any reason to use "autoreleased" in a situation where the
object in question has not, in fact, been sent the "autorelease"
method. It's just confusing.


Yes, you would have to acknowledge that you don't know whether  
autorelease has in fact been sent, which could be confusing.



The better term already exists: "own". As in, "you own the return
value" or "you do not own the return value". This tells you everything
you need to know.


Well, as I said I don't agree with the connotations of "own."  I'm not  
even comfortable with "you" -- who is "you"?  But once you accept the  
terms, "you own the return value" has the benefit of being concise and  
consistent.


What would you use for adjectives -- "owned" and "unowned"?

--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread mmalc crawford


On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:

"Autoreleased" is inaccurate and is not a proper shorthand for "you  
must retain it if you want it to stick around".
To understand why, consider two possible implementations of a get  
accessor:


- (NSString *)name {
  return name;
}
- (NSString *)name {
  return [[name retain] autorelease];
}

I don't see the difference from the caller's point of view.


NSString *name = [aPerson name];
[aPerson setName:@"Fido"];
NSLog(@"Old name: %@", name);


Moreover, saying that an object is "autoreleased" also implies the  
overhead of adding it to an autorelease pool, suggesting that it may  
be more expensive to retrieve the object than is actually the case.


I don't think I have ever said method X returns an autoreleased  
object.  I was suggesting either the term could be accepted in the  
way that other people (and some Apple docs) use it, or someone could  
come up with a better term.


There is already another term -- owns.  As stated initially,  
"autorelease" is inaccurate and misleading.



There is a reason people keep using the term incorrectly


That's exactly what you're doing here.

mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


[Moderator] Re: Controlling Preferences on iPhone

2008-07-18 Thread Scott Anguish

iPhone SDK
--

Until an announcement is made otherwise, developers should be aware  
that the iPhone SDK is still under non-disclosure (section 5.3 of the  
iPhone Development Agreement). It can't be discussed here, or anywhere  
publicly. This includes other mailing lists, forums, and definitely  
blogs.


This situation is somewhat different than a Mac OS X release, in that  
a Mac OS X release includes a copy of the developer tools with the  
distribution. The iPhone OS 2.0 release on devices and as an upgrade  
does _not_ include the development tools. As a result, the SDK is not  
automatically considered public because the release has occurred.


Section 5.3 of the iPhone Development Agreement remains in force at  
this time, and will so remain until iPhone Developer Program members  
are specifically and personally notified by an authorized  
representative of Apple.


On 18-Jul-08, at 10:07 AM, Aaron L'Heureux wrote:

I have done some preliminary searching, but as I am still relatively  
new to the platform, I've not come up with an answer to this  
question. If anyone could help me out or point me in the right  
direction, I'd really appreciate it.


Is it possible to programmatically change system preferences on the  
iPhone? Say I wanted to be able to turn location services on (at the  
request of the user of course) or to enable Bluetooth, or toggle a  
few of the sound alerts. Utilitarian stuff. Can this be done from an  
App Store 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]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Michael Ash
On Fri, Jul 18, 2008 at 3:31 PM, Andy Lee <[EMAIL PROTECTED]> wrote:
> On Jul 18, 2008, at 2:59 PM, j o a r wrote:
>>
>> On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:
>>>
>>> I don't see the difference from the caller's point of view.
>>
>>
>> There isn't any, and that was not MMalcs point. His point was that you
>> were using the term "autoreleased" incorrectly.
>
> I don't think I have ever said method X returns an autoreleased object.  I
> was suggesting either the term could be accepted in the way that other
> people (and some Apple docs) use it, or someone could come up with a better
> term.  There is a reason people keep using the term incorrectly, and it
> would be nice to help people express themselves without stumbling into the
> error.

I don't see any reason to use "autoreleased" in a situation where the
object in question has not, in fact, been sent the "autorelease"
method. It's just confusing.

The better term already exists: "own". As in, "you own the return
value" or "you do not own the return value". This tells you everything
you need to know.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: how to eliminate an annoying issue of the multi-document cocoa application?

2008-07-18 Thread Tim Isted

In your application delegate object, simply implement:

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
return NO;
}

This will prevent the new document automatically being displayed.

Tim


On 18 Jul 2008, at 16:39, Cloud Strife wrote:


Greetings everyone.
I am new to creating an new multi-doc application with Cocoa  
framework.
After I created such one using the Xcode built-in template. There  
was a

window, the new document, automatically jump out after I launched the
application. Due to the requirement of my application, this behavior  
is
rather annoying.  I am wondering is there any way to avoid this  
behavior?

In other words, I want to make the new document can only be created by
issuing the explicit command to the application, for example, by  
clicking

the "New" menu item.
If anyone knows any solution to this problem, would you please give  
me a

guidance? Any help is highly appreciated.

Thank you very much in advance.

--
Best regards.
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40timisted.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: Dispatch NSEvent to everyone

2008-07-18 Thread Michael Ash
On Fri, Jul 18, 2008 at 3:15 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote:
>
> On Jul 18, 2008, at 12:15 PM, Matthew Williamson wrote:
>
>> But really, I still have the same problem, because I don't want to use the
>> Carbon APIs (if I want my app to be 64-bit, I can't use any Carbon anyway,
>> right?).
>
>
> You can; it was mainly HIView and a lot of legacy technologies (QuickDraw,
> Pascal strings, FSSpec, etc.) that were removed from 64-bit Carbon. FSRef,
> aliases, etc. are in 64-bit Carbon.

Even easier than remembering all of this: look at the documentation.
If it doesn't say "Not available to 64-bit applications", then you can
still use it.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 2:59 PM, j o a r wrote:

On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:

I don't see the difference from the caller's point of view.



There isn't any, and that was not MMalcs point. His point was that  
you were using the term "autoreleased" incorrectly.


I don't think I have ever said method X returns an autoreleased  
object.  I was suggesting either the term could be accepted in the way  
that other people (and some Apple docs) use it, or someone could come  
up with a better term.  There is a reason people keep using the term  
incorrectly, and it would be nice to help people express themselves  
without stumbling into the error.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


how to eliminate an annoying issue of the multi-document cocoa application?

2008-07-18 Thread Cloud Strife
Greetings everyone.
I am new to creating an new multi-doc application with Cocoa framework.
After I created such one using the Xcode built-in template. There was a
window, the new document, automatically jump out after I launched the
application. Due to the requirement of my application, this behavior is
rather annoying.  I am wondering is there any way to avoid this behavior?
In other words, I want to make the new document can only be created by
issuing the explicit command to the application, for example, by clicking
the "New" menu item.
If anyone knows any solution to this problem, would you please give me a
guidance? Any help is highly appreciated.

Thank you very much in advance.

-- 
Best regards.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Inverse Regex Library?

2008-07-18 Thread Hamish Allan
On Thu, Jul 17, 2008 at 8:49 PM, Philip Mötteli
<[EMAIL PROTECTED]> wrote:

> I try to analyze objects, that have been serialized using keyed encoding.
> As long as there are only simple values, I have no problem. But the members
> of too-many IVars are usually keyed by using something like
> "IVarName[0-9]+". I have to filter those out and classify as too-many.
> But I can't count on it. Not on the name nor where the number is. Or if
> there's a number. It could also be a letter.

Have you considered clustering the strings based on their Levenshtein distances?

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSViewController Binding Problem continued

2008-07-18 Thread Hamish Allan
On Thu, Jul 17, 2008 at 8:50 PM, Ron Lue-Sang <[EMAIL PROTECTED]> wrote:

> The tableview is expecting to be bound to the arraycontroller directly. It
> doesn't know that representedObject is an arrayController.

You might wish to file an enhancement request for NSViewController to
provide an init method taking a representedObject to be set up before
attempting bindings etc., which would circumvent this issue.

Or you could argue that, according to the principles of duck typing,
NSTableView shouldn't care, just as long as
representedObject.arrangedObjects.displayText quacks like an array. In
which case it's a bug.

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: IBOutlet to same control in different nibs

2008-07-18 Thread Hamish Allan
On Thu, Jul 17, 2008 at 5:42 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:

> I'll have one instance of this class for each
> screen, one of which will be handling the "main" screen.
> [...]
> Can a single class have an IBOutlet that goes two different (though
> functionally identical) places?

It's a single class, but there are multiple instances, each with its
own storage for that IBOutlet, so each can point to different things.

Why not have a TabAController class with all the functionality for
handling tab A, and subclass it to make a TabsABCDController class
adding the functionality for the other tabs? Then just instantiate the
former three times and the latter once.

It's difficult to say whether you should instantiate the
TabAController class in AuxScreen.nib or instantiate it
programmatically and have it be the File's Owner without knowing how
these tabs' functionality will have to interrelate.

Hamish
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Inverse Regex Library?

2008-07-18 Thread John Engelhart


On Jul 17, 2008, at 10:09 AM, Philip Mötteli wrote:


Hi,


Does anybody know of a library, that takes a bunch of strings and  
produces a regex-string from them?

E. g:

"Word1"
"Word2"
"Word5"
"Word8"
"Word11"
"Word19"
"Word23"
"Word45"
"Word77"

should give "Word[0-9]{1,2}". Or I would even be more happy with  
"Word[0-9]+".

I've heard of Grail+. But are there any other options?



This is sort of a tricky problem.  Finding and building a regular  
expression that only matches a set of words is actually trivial.  For  
your particular example you could probably put something together in  
the shell like perl -e 'while(<>) { } ' to go through a list of  
words and spit out a regex that would match only those words.


The real problem is in what you haven't said.  How you're going to use  
it.  Do you need to build in dynamically at run time, or are all the  
words known in advance and static from that point on?  How fast do you  
need it to be?  Does it need to be able to handle UTF-16, or will it  
only match ASCII? Do you want a regex that matches the list of words / 
exactly/?  Or is the list of words a 'hint' and you want the 'obvious'  
regex (which would be the regexes you suggested)? Answers to those  
questions would really change which approach I would take in trying to  
solve the problem.


If you're looking for something that can construct the 'obvious' regex  
from an example 'hint' list, you're probably much better off just  
doing this by hand.  If you need to build the 'obvious' regex  
dynamically at runtime, I would suggest you rethink the problem you're  
trying to solve.  You might be able to get something that can  
heuristically get things right most of the time, but it's likely to be  
very fragile and break in unexpected ways.


Possible ideas:

Raw speed, exact match of a list of words: You could probably throw  
something together quickly that will construct a DFA for the given  
list of words.  Performance from this is O(1), but if your list of  
words is 'complicated' and large, the state tables will be huge (like,  
really really huge.  A naive implementation can easily blow through  
megabytes of state tables for complicated patterns.).


If you need to match ASCII like text, know everything in advance at  
compile time, and need blazing speed, take a look at `flex` (http://flex.sourceforge.net 
) (installed with dev tools).  It should be trivial to write a perl  
script that takes in your lists of known words and builds a .l file  
that returns a constant for each 'family' of words.


If you have a list of words, and you need to use a regex at run time,  
you could use something like 'http://search.cpan.org/~dland/Regexp-Assemble-0.34/Assemble.pm' 
 You could take your list of words, feed them in to that module, and  
it should spit out something that will a single regex that will match  
your given list of words exactly.  This is probably the closest thing  
to a /literal/ regex inversion you're likely to find.  But the regex  
output will match the input list and only the input list.


Using the mentioned perl module, you may need to do some  
'preprocessing' in the input to get more reasonable results.  You  
would probably need to do a quick scan of the list going in and spot  
by eye the 'obvious' pattern candidates.  In your example, you could  
do a simple regex search and replace of 's/[0-9]/\d/g', which would  
squash everything in to a 'Word\d' or 'Word\d\d', and the regex  
assemble package would (probably) just discard the duplicates and  
crank out something like 'Word\d{1,2}'.


Like I said, if you need to be able to generate the 'obvious' regex  
from a sample list dynamically on the fly at run time, you're probably  
going to be in for some pain.  :(  If everything is known in advance,  
at compile time, and the list of words you need to match is relatively  
small (<~30) and fairly obvious and simple, I'd just do it by hand as  
you'll probably spend more time 'automating' the process than it would  
have taken you to just do it.___


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

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

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

This email sent to [EMAIL PROTECTED]


NSTableHeaderView shifting after scrolling

2008-07-18 Thread sarven
I am reading a csv file into a dictionary and I display the data in a 
NSTableview.  I created my window in Interface builder and added a NSTableview 
with one column.  Depending on the needs of the csv file, I add columns to the 
table.  Here is the code:

-(void) awakeFromNib
{
NSTableColumn* firstColumn=[theTableView 
tableColumnWithIdentifier:@"1"];
[theTableView removeTableColumn:firstColumn];
int columns=[dataSource noOfColumns];
if (columns>0) 
{
int counter=0;
while(counterhttp://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 2:27 PM, Shawn Erickson wrote:

On Fri, Jul 18, 2008 at 10:20 AM, Andy Lee <[EMAIL PROTECTED]> wrote:
Unless Apple defines another adjective for this purpose, it seems  
to me that
"autoreleased" is a reasonable shorthand for "you must retain it if  
you want
it to stick around, or you *may* have a dangling pointer."   
Similarly,
"retained" is a reasonable shorthand for "you must balance the  
method you

just called with a release, or you'll have a memory leak."


Autorelease has a specific meaning (not the one you imply above) and
as you note few APIs document it since it really is unimportant to
know. My point was it is an implementation detail.


Oh, yes, I definitely get that whether a returned object is  
autoreleased (in the correct technical sense) is an implementation  
detail.  *My* point was that as a matter of language, there is no  
official adjective for the kind of returned object we're talking  
about.  It may be lazy, it may be sloppy, it may be inaccurate, but I  
understand why people use the word the way they do.



Apple attempts to consistently talk in terms of an object ownership.
Did you create an object or retain it, if so then you own it... if not
then you don't. If you own it then it will persist at least until you
release ownership. etc. The only issue I have with the term ownership
is that to most folks "owning" something implies a single owner but in
the case of objects you can have multiple owners at any given time. As
long as folks understand that then ownership works well to describe
this.


I actually feel more strongly about the term "ownership," and I'm glad  
you expressed a bit of misgiving about it, because I've felt sort of  
heretical about it, given how much the MemoryMgmt doc relies on the  
concept.  I would go so far as to say the word is misleading, because  
its connotations don't match what is really going on:


* As you say, an object can have multiple owners, but I agree, that is  
not necessarily so confusing.
* However, the same owner can own an object multiple times, and you  
have to disown it as many times as you own it, which is not at all  
like the plain English meaning of ownership.
* "Object ownership" to me connotes a "has-a" relationship, as in  
having something as an ivar; but  there are plenty of cases where we  
alloc/init an object that is not an ivar.


I'll try not to beat this to death; I've just been wanting to say  
something about the "ownership" concept for a while.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dispatch NSEvent to everyone

2008-07-18 Thread Nick Zitzmann


On Jul 18, 2008, at 12:15 PM, Matthew Williamson wrote:

But really, I still have the same problem, because I don't want to  
use the Carbon APIs (if I want my app to be 64-bit, I can't use any  
Carbon anyway, right?).



You can; it was mainly HIView and a lot of legacy technologies  
(QuickDraw, Pascal strings, FSSpec, etc.) that were removed from 64- 
bit Carbon. FSRef, aliases, etc. are in 64-bit Carbon.


Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: QCCompositionLayer for Manipulating other CALayers

2008-07-18 Thread David Duncan

On Jul 17, 2008, at 7:50 PM, Mike Rossetti wrote:

Before I spend a lot of time attempting the following I would  
appreciate any advice based on your experience:


I've got a drawing-like application where I'd like the user to be  
able to rotate individual elements of the drawing.  When the mouse  
is hovering over an element I draw a manipulation image (a CALayer)  
and what I'd like to do is to let the user mouse click in a little  
rotator control nubby and drag to rotate.


I'm considering using a QCCompositionLayer and pulling in a nice  
Quartz Composition I put together that behaves (at least in Quartz  
Composer) as I'd like.


Is this a foolish or a wise direction to take?



There is nothing built in to do this, so you'd have to figure out some  
way to express your render tree to the QCComposition (or at least part  
of it) so that it can output the manipulations so you can then apply  
them to the layer. I don't think this will work very well honestly,  
and I think it would likely be easier for you to replicate this  
functionality in code (both in terms of the amount of code to support  
this and the effort required to make it work correctly).

--
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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread j o a r


On Jul 18, 2008, at 11:51 AM, Andy Lee wrote:


I don't see the difference from the caller's point of view.



There isn't any, and that was not MMalcs point. His point was that you  
were using the term "autoreleased" incorrectly.


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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 2:17 PM, mmalc crawford wrote:

On Jul 18, 2008, at 1:20 PM, Andy Lee wrote:
Unless Apple defines another adjective for this purpose, it seems  
to me that "autoreleased" is a reasonable shorthand for "you must  
retain it if you want it to stick around, or you *may* have a  
dangling pointer." Similarly, "retained" is a reasonable shorthand  
for "you must balance the method you just called with a release, or  
you'll have a memory leak."


"Autoreleased" is inaccurate and is not a proper shorthand for "you  
must retain it if you want it to stick around".
To understand why, consider two possible implementations of a get  
accessor:


- (NSString *)name {
   return name;
}

- (NSString *)name {
   return [[name retain] autorelease];
}


I don't see the difference from the caller's point of view.  Suppose I  
have a silly little class that remembers a person's name.  Wouldn't I  
have to retain the return value of -name in this init method?


- (id)initWithPerson:(Person *)person
{
if ((self = [super init]))
{
_name = [[person name] retain];
}

return self;
}

I don't know how -name is implemented and I don't care, and I don't  
know if failing to retain would actually happen to be okay.  I only  
know that I have to retain it to be *sure* it'll stick around.


If you find cases where memory management is mentioned simply to  
state that a method follows the standard rules, please file a bug or  
send in feedback using the form in the documentation.


Okay, when I get a chance I'll dig up the methods that tell us a  
method returns an autoreleased object.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dispatch NSEvent to everyone

2008-07-18 Thread Shawn Erickson
On Fri, Jul 18, 2008 at 11:15 AM, Matthew Williamson <[EMAIL PROTECTED]> wrote:
> Ok, looking more at the Quartz event tap stuff, there's more there than I
> thought--tablet stuff is there, for instance. But really, I still have the
> same problem, because I don't want to use the Carbon APIs (if I want my app
> to be 64-bit, I can't use any Carbon anyway, right?).
>

CoreGraphics isn't Carbon. CoreFoundation isn't Carbon. C APIs aren't
always part of "Carbon".

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Shawn Erickson
On Fri, Jul 18, 2008 at 10:20 AM, Andy Lee <[EMAIL PROTECTED]> wrote:
> On Jul 18, 2008, at 10:49 AM, Shawn Erickson wrote:
>>
>> I should more clearly note that objectForKey: is not returning an
>> "autoreleased" object. Also even if it did it would be an
>> implementation detail (unless documented in the API docs).
>>
>> It is returning a reference to an object that the vColors dictionary
>> has a retained reference to (Cocoa collections retain what you add to
>> them). At this point in time you have know idea of the lifetime of the
>> object you get back (it could go away when the vColors dictionary goes
>> away or it could live longer). If you need something to stay around
>> outside of the method you are in (assuming no side effects down stream
>> in that method) then you must retain that object for a long as you
>> need it.
>
> When the docs say a method returns an "autoreleased" object, I assume it
> means what you say above about objectForKey:.  Otherwise, why mention it at
> all?  Taken literally, the fact that it is autoreleased tells us nothing
> about its life expectancy, and unless I'm missing something I can't imagine
> why else I'd care to know.
>
> An Xcode search for "autoreleased" turns up a few cases.  For example, the
> doc for -[IMKInputController delegate] says "The returned object is an
> autoreleased object."  So what?  We have no idea how many times the delegate
> was retained before being assigned to our IMKInputController instance.
>
> Unless Apple defines another adjective for this purpose, it seems to me that
> "autoreleased" is a reasonable shorthand for "you must retain it if you want
> it to stick around, or you *may* have a dangling pointer."  Similarly,
> "retained" is a reasonable shorthand for "you must balance the method you
> just called with a release, or you'll have a memory leak."

Autorelease has a specific meaning (not the one you imply above) and
as you note few APIs document it since it really is unimportant to
know. My point was it is an implementation detail.

Apple attempts to consistently talk in terms of an object ownership.
Did you create an object or retain it, if so then you own it... if not
then you don't. If you own it then it will persist at least until you
release ownership. etc. The only issue I have with the term ownership
is that to most folks "owning" something implies a single owner but in
the case of objects you can have multiple owners at any given time. As
long as folks understand that then ownership works well to describe
this.

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dispatch NSEvent to everyone

2008-07-18 Thread glenn andreas


On Jul 18, 2008, at 1:15 PM, Matthew Williamson wrote:

Ok, looking more at the Quartz event tap stuff, there's more there  
than I thought--tablet stuff is there, for instance. But really, I  
still have the same problem, because I don't want to use the Carbon  
APIs (if I want my app to be 64-bit, I can't use any Carbon anyway,  
right?).


I just thought that there had to be a way to do this in Cocoa...but  
everything I've seen seems to point back to using the Carbon APIs.


My basic question is still this: Can I pass an NSEvent to some top- 
level responder that will pass it on to the appropriate application  
(based on window locations, etc.), or to Dashboard, or Expose, or  
whatever needs to handle the recieved event?


No.  NSEvent includes references to things that exist only within your  
own address space.


You'll need to drop to a lower layer to work with "raw" events without  
any sort of application specific context associated with them (which  
pretty much limits you to doing what the user does - the mouse moves,  
keys are pressed and released, etc...)




Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next  
generation of fractal art




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread mmalc crawford

On Jul 18, 2008, at 1:20 PM, Andy Lee wrote:
Unless Apple defines another adjective for this purpose, it seems to  
me that "autoreleased" is a reasonable shorthand for "you must  
retain it if you want it to stick around, or you *may* have a  
dangling pointer." Similarly, "retained" is a reasonable shorthand  
for "you must balance the method you just called with a release, or  
you'll have a memory leak."


"Autoreleased" is inaccurate and is not a proper shorthand for "you  
must retain it if you want it to stick around".
To understand why, consider two possible implementations of a get  
accessor:


- (NSString *)name {
return name;
}

- (NSString *)name {
return [[name retain] autorelease];
}

...


It is typically better to talk in terms of ownership (see ).




On Jul 18, 2008, at 10:48 AM, Andy Lee wrote:

And come to think of it, why mention that method X returns an object- 
I-need-to-retain, but not mention it for method Y?  If it's assumed  
I've read the memory management rules, these should go without  
saying.  So maybe I am missing something.


In general, the documentation should not make any statements about  
memory management unless (in very rare circumstances) a method breaks  
the basic rules or where clarification may be deemed appropriate (e.g.  
.


If you find cases where memory management is mentioned simply to state  
that a method follows the standard rules, please file a bug or send in  
feedback using the form in the documentation.


mmalc

___

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

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

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

This email sent to [EMAIL PROTECTED]


assertion failure in AppKit

2008-07-18 Thread Torsten Curdt

Hey guys,

Some of my users are reporting an exception

 NSInternalInconsistencyException
 lockFocus sent to a view whose window is deferred and does not yet  
have a corresponding platform window


This is in the logs:

  *** Assertion failure in -[NSThemeFrame lockFocus], AppKit.subproj/ 
NSView.m:3248
 lockFocus sent to a view whose window is deferred and does not yet  
have a corresponding platform window


And I have absolutely no clue what this could be. The window has to be  
there. They pressed a button to start the processing. Any pointers?


In case someone wants to see the full source:

 git clone git://vafer.org/uif2iso4mac.git

cheers
--
Torsten
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dispatch NSEvent to everyone

2008-07-18 Thread Matthew Williamson
Ok, looking more at the Quartz event tap stuff, there's more there  
than I thought--tablet stuff is there, for instance. But really, I  
still have the same problem, because I don't want to use the Carbon  
APIs (if I want my app to be 64-bit, I can't use any Carbon anyway,  
right?).


I just thought that there had to be a way to do this in Cocoa...but  
everything I've seen seems to point back to using the Carbon APIs.


My basic question is still this: Can I pass an NSEvent to some top- 
level responder that will pass it on to the appropriate application  
(based on window locations, etc.), or to Dashboard, or Expose, or  
whatever needs to handle the recieved event? Without using any Carbon  
APIs? Again, this is in the context of remote control, ui automation,  
etc.


-Matt


On Jul 18, 2008, at 10:06 AM, Shawn Erickson wrote:

On Fri, Jul 18, 2008 at 8:55 AM, Matthew Williamson  
<[EMAIL PROTECTED]> wrote:


but I need to be able to send Cocoa events into the system--meaning  
CGPostMouseEvent won't cut it.


All the code examples I can find seem to use CGPostMouseEvent to  
accomplish this kind of thing. But I need to be able to do more  
kinds of events than the Carbon API provides functions for.


What do you mean by the above?

-Shawn


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Image name for drag and drop from Safari

2008-07-18 Thread Jens Alfke


On 18 Jul '08, at 12:23 AM, chaitanya pandit wrote:

In my application, i allow users to drag and drop images from  
Safari, however while receiving the drop i cannot retrieve the image  
name from the pasteboard.
If i get the data for URL pasteboard type, it gives the URL up to  
the image, and not containing the image, what i mean is,
if the image is located at suppose http://www.somesite/something/image.tiff 
, the URL pasteboard gives http://www.somesite/something/

But  i need the "image.tiff"


Safari isn't truncating the image's URL; it's actually giving you the  
URL that the image links to. (If the image isn't inside an  tag,  
you do get the URL of the image itself.)



Its the NSRTFDPboard type that contains the required data.


What that's giving you is just the filename, i.e. the last component  
of the URL. Given what I said above, you can't tack that onto the end  
of the URL you got from the pasteboard to get the image's location,  
because that URL probably points someplace else entirely. It just  
happened to work correctly in the one example you tried.


I distinctly remember filing a bug report about this back in 2005, and  
I less-distinctly remember that it was addressed in Safari 3. But I'm  
looking through the drag pasteboard now and I can't find where they  
put the image's URL. :-/


—Jens

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: substitute class at runtime?

2008-07-18 Thread Nick Zitzmann


On Jul 18, 2008, at 12:00 PM, Nathaniel Gottlieb-Graham wrote:


if ([classNameArray containsObject:nameOfClass])
{
[[[??? alloc]initWithNibName:nameOfClass] autorelease]
}

How can I get the class name into the ??? part?



Substitute the ?? with a Class data structure, which you can get  
by calling +class on any object.


Nick Zitzmann





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: substitute class at runtime?

2008-07-18 Thread Andy Lee

NSClassFromString()

--Andy

On Jul 18, 2008, at 2:00 PM, Nathaniel Gottlieb-Graham wrote:

I need to be able to initialize a class, but I don't necessarily  
know what kind of class it'll be at compile time.  Consider the  
following example in which the name of a class is checked against an  
array of class names, and if the name of the class is present in the  
array, a new instance of that class is initialized:



NSString *nameOfClass = fooViewController

NSArray *classNameArray = [NSArray arrayWithObjects:  
@"FooViewController", @"BarViewController", nil];


if ([classNameArray containsObject:nameOfClass])
{
[[[??? alloc]initWithNibName:nameOfClass] autorelease]
}

How can I get the class name into the ??? part?
___

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

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

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

This email sent to [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]


substitute class at runtime?

2008-07-18 Thread Nathaniel Gottlieb-Graham
I need to be able to initialize a class, but I don't necessarily know  
what kind of class it'll be at compile time.  Consider the following  
example in which the name of a class is checked against an array of  
class names, and if the name of the class is present in the array, a  
new instance of that class is initialized:



NSString *nameOfClass = fooViewController

NSArray *classNameArray = [NSArray arrayWithObjects:  
@"FooViewController", @"BarViewController", nil];


if ([classNameArray containsObject:nameOfClass])
{
[[[??? alloc]initWithNibName:nameOfClass] autorelease]
}

How can I get the class name into the ??? part?
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 1:20 PM, Andy Lee wrote:

On Jul 18, 2008, at 10:49 AM, Shawn Erickson wrote:

I should more clearly note that objectForKey: is not returning an
"autoreleased" object. Also even if it did it would be an
implementation detail (unless documented in the API docs).

It is returning a reference to an object that the vColors dictionary
has a retained reference to (Cocoa collections retain what you add to
them). At this point in time you have know idea of the lifetime of  
the
object you get back (it could go away when the vColors dictionary  
goes

away or it could live longer). If you need something to stay around
outside of the method you are in (assuming no side effects down  
stream

in that method) then you must retain that object for a long as you
need it.


When the docs say a method returns an "autoreleased" object, I  
assume it means what you say above about objectForKey:.  Otherwise,  
why mention it at all?  Taken literally, the fact that it is  
autoreleased tells us nothing about its life expectancy, and unless  
I'm missing something I can't imagine why else I'd care to know.


And come to think of it, why mention that method X returns an object-I- 
need-to-retain, but not mention it for method Y?  If it's assumed I've  
read the memory management rules, these should go without saying.  So  
maybe I am missing something.


--Andy





An Xcode search for "autoreleased" turns up a few cases.  For  
example, the doc for -[IMKInputController delegate] says "The  
returned object is an autoreleased object."  So what?  We have no  
idea how many times the delegate was retained before being assigned  
to our IMKInputController instance.


Unless Apple defines another adjective for this purpose, it seems to  
me that "autoreleased" is a reasonable shorthand for "you must  
retain it if you want it to stick around, or you *may* have a  
dangling pointer."  Similarly, "retained" is a reasonable shorthand  
for "you must balance the method you just called with a release, or  
you'll have a memory leak."


That said, we do need to understand exactly what is meant when we  
speak loosely this way.


--Andy

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%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]


Re: Did I reinvent the wheel?

2008-07-18 Thread Jean-Daniel Dupas
I don't think there is built-in support for this specific feature. If  
archiving, serialization and CoreData do not fit your needs, I bet you  
have to use your own method.
That said, you should avoid to use an uninitialized variable in your  
code ;-) (outCount is used in array initializer before you get  
property count).



Le 18 juil. 08 à 19:22, Jeff LaMarche a écrit :

Hey, folks. I needed an easy way to turn dictionaries into objects  
and objects into dictionaries based on their properties. I didn't  
want to have to custom code this for each of the classes i was  
using, and I couldn't find that functionality in any of the existing  
objects, but I have this sneaking suspicion that it's in there  
somewhere. I'd obviously prefer to use the delivered version if one  
exists.


So, here's what I'm using now - is this a case of solving a problem  
that didn't need to be solved?


@implementation NSObject(ToFromDict)
-(NSDictionary *)dictionaryRepresentation { 
unsigned int outCount;

	NSMutableArray *properties = [NSMutableArray  
arrayWithCapacity:outCount];
	objc_property_t *propList = class_copyPropertyList([self class],  
&outCount);

int i;

for (i=0; i < outCount; i++)
{
objc_property_t * oneProp = propList + i;
		NSString *propName = [[NSString alloc]  
initWithCString:property_getName(*oneProp)];

[properties addObject:propName];
[propName release];
}
return [self dictionaryWithValuesForKeys:properties];
}
-(id)initWithDictionary:(NSDictionary *)dict {
if (self=[self init])
{
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end


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

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: Xcode3 vs Xcode2 - two problems

2008-07-18 Thread Bill Bumgarner

On Jul 18, 2008, at 10:27 AM, Joeles Baker wrote:

Oh my god - after all those years. Thank you.
Sorry for this stupid question.

But one thing remains.
Why am I not able to drag the header of my class to the interface  
builder window?
With Xcode2/IB2 you just had to drag the header file to the  
"docwindow".
The "+" sign appears, but when i release the mouse button it doesnt  
appear.


You don't need to drag the header file to the IB window.  It doesn't  
do anything because there is nothing to be done.


IB3 parses the source files in your project and makes outlets,  
actions, and classes available as a result.


b.bum



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: Xcode3 vs Xcode2 - two problems

2008-07-18 Thread Bill Bumgarner

On Jul 18, 2008, at 10:16 AM, Joeles Baker wrote:

i just tried the following with Xcode3:

1)
read a plist in awakeFromNib
store its content in an array

NSArray* myArray = [NSPropertyListSerialization 

2)

tried to setup my tableview like so:

- (NSInteger)tableView:(UITableView *)tableView  
numberOfRowsInSection:(NSInteger)section {

return [myArray count];
}

3)
but in 2) i get an error telling me, that myArray is undeclared (it  
was declared in awakeFromNib)

What did i forget?


If a variable is declared in a method, then the variable is local to  
that method.  Turn it into an instance variable.


I would suggest reading this:


http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/chapter_1_section_1.html


Another thing:
I tried to drag the header file of the above to the interfacebuilder  
windows which includes the tableview,
but no unlike in interfacebuilder2 nothing happens (no "datasource  
box").

Whats wrong here?


In IB3, there is no need to drag the file into IB.  If an outlet or  
action isn't showing up in IB3, it is because you haven't declared it  
correctly.


As for dragging connections, it is still ctrl-drag from source  
(possibly an outlet) to destination (possibly an action).  For  
dataSource, you drag from the table view to the object that is  
intended to be the data source.


b.bum



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]

Did I reinvent the wheel?

2008-07-18 Thread Jeff LaMarche
Hey, folks. I needed an easy way to turn dictionaries into objects and  
objects into dictionaries based on their properties. I didn't want to  
have to custom code this for each of the classes i was using, and I  
couldn't find that functionality in any of the existing objects, but I  
have this sneaking suspicion that it's in there somewhere. I'd  
obviously prefer to use the delivered version if one exists.


So, here's what I'm using now - is this a case of solving a problem  
that didn't need to be solved?


@implementation NSObject(ToFromDict)
-(NSDictionary *)dictionaryRepresentation { 
unsigned int outCount;

	NSMutableArray *properties = [NSMutableArray  
arrayWithCapacity:outCount];
	objc_property_t *propList = class_copyPropertyList([self class],  
&outCount);

int i;

for (i=0; i < outCount; i++)
{
objc_property_t * oneProp = propList + i;
		NSString *propName = [[NSString alloc]  
initWithCString:property_getName(*oneProp)];

[properties addObject:propName];
[propName release];
}
return [self dictionaryWithValuesForKeys:properties];
}
-(id)initWithDictionary:(NSDictionary *)dict {
if (self=[self init])
{
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end


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: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Andy Lee

On Jul 18, 2008, at 10:49 AM, Shawn Erickson wrote:

I should more clearly note that objectForKey: is not returning an
"autoreleased" object. Also even if it did it would be an
implementation detail (unless documented in the API docs).

It is returning a reference to an object that the vColors dictionary
has a retained reference to (Cocoa collections retain what you add to
them). At this point in time you have know idea of the lifetime of the
object you get back (it could go away when the vColors dictionary goes
away or it could live longer). If you need something to stay around
outside of the method you are in (assuming no side effects down stream
in that method) then you must retain that object for a long as you
need it.


When the docs say a method returns an "autoreleased" object, I assume  
it means what you say above about objectForKey:.  Otherwise, why  
mention it at all?  Taken literally, the fact that it is autoreleased  
tells us nothing about its life expectancy, and unless I'm missing  
something I can't imagine why else I'd care to know.


An Xcode search for "autoreleased" turns up a few cases.  For example,  
the doc for -[IMKInputController delegate] says "The returned object  
is an autoreleased object."  So what?  We have no idea how many times  
the delegate was retained before being assigned to our  
IMKInputController instance.


Unless Apple defines another adjective for this purpose, it seems to  
me that "autoreleased" is a reasonable shorthand for "you must retain  
it if you want it to stick around, or you *may* have a dangling  
pointer."  Similarly, "retained" is a reasonable shorthand for "you  
must balance the method you just called with a release, or you'll have  
a memory leak."


That said, we do need to understand exactly what is meant when we  
speak loosely this way.


--Andy

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Chris Hanson

On Jul 18, 2008, at 9:55 AM, Rick Hoge wrote:

Thanks for the replies - seems like a custom view and possibly  
NSMatrix will do the job.


I strongly recommend going with a view hierarchy instead of an NSMatrix.

You don't need to create a custom view, either.  Views nest; an  
instance of NSView is just empty space in a window unless you add  
subviews to it.  So you might have a view with a couple of buttons, a  
text field, and a pop-up button in it -- you can even set something  
like this up in Interface Builder, in its own nib, and have it managed  
by an NSViewController.


  -- Chris

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Rick Hoge


Thanks for the replies - seems like a custom view and possibly  
NSMatrix will do the job.


Rick

On 18-Jul-08, at 12:38 PM, Chris Hanson wrote:


On Jul 18, 2008, at 8:39 AM, Rick Hoge wrote:

I expect this is a custom class created by Apple - does anyone know  
of an efficient way to replicate this type of view?  One thought I  
had was to create a table with a single row and add the desired  
controls as cells.


Just create a view and add sub-views to it to do what you want.   
There's no reason to worry about trying to use a single-row table  
with cells and so on -- views will be sufficient for what you want  
to do.


 -- Chris




(43092.6825)

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


[SOLVED] Image name for drag and drop from Safari

2008-07-18 Thread chaitanya pandit

Hi,
Thanks for your reply, Clipboard viewer did the trick,
Its the NSRTFDPboard type that contains the required data.

		// Get the rtfd data, get the attachment and then get the attachment  
name from it
		NSData *nameData = [[sender draggingPasteboard]  
dataForType:NSRTFDPboardType];
		NSAttributedString *string = [[[NSAttributedString alloc]  
initWithRTFD:nameData documentAttributes:nil]autorelease];
		NSTextAttachment *attachment = [string  
attribute:NSAttachmentAttributeName atIndex:0 effectiveRange:NULL];

NSString *name = [[attachment fileWrapper] filename];

-Chaitanya

On 18-Jul-08, at 10:48 AM, Gary L. Wade wrote:


Launch the Clipboard Viewer, which is in:

   /Developer/Applications/Utilities/Built\ Examples/

and drop your images onto it, and then select the Drag Clipboard,  
possibly clicking Reload to inspect the values you can get.



Hi,
In my application, i allow users to drag and drop images from Safari,
however while receiving the drop i cannot retrieve the image name  
from

the pasteboard.
If i get the data for URL pasteboard type, it gives the URL up to the
image, and not containing the image, what i mean is,

if the image is located at suppose http://www.somesite/something/image.tiff
, the URL pasteboard gives http://www.somesite/something/
But  i need the "image.tiff"

I'd appreciate any help.
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/garywade%40desisoftsystems.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/chaitanya%40expersis.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: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Chris Hanson

On Jul 18, 2008, at 8:39 AM, Rick Hoge wrote:

I expect this is a custom class created by Apple - does anyone know  
of an efficient way to replicate this type of view?  One thought I  
had was to create a table with a single row and add the desired  
controls as cells.


Just create a view and add sub-views to it to do what you want.   
There's no reason to worry about trying to use a single-row table with  
cells and so on -- views will be sufficient for what you want to do.


  -- Chris


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [SOLVED] NSButton alternate image problem - not redrawing

2008-07-18 Thread P Teeson

I solved it - thanks for not replying so I had to find out for myself.
Seriously I appreciate it because I read more in Cocoa Drawing Guide  
and learned quite bit.


respect

Peter

On 17-Jul-08, at 1:19 PM, P Teeson wrote:


I posted about this issue but so far only one response.
For the full details please see earlier in this thread.

This is a summary:
Initially the button has blank icons for both image and alternate  
image.
User clicks on button, action method is called, in that method a  
different alternate image is set by,

[sender setAlternateImage:theXiconImage];
then the button is disabled by,
[sender setEnabled:NO];
the action method is exited, and button is redrawn showing the new  
image.


However after doing this when the game is over:
[cell0 setAlternateImage:theBlankImage]; // send messages via IBOutlet

  [cell0 setImage:theBlankImage]; // Added this line

[cell0 setEnabled:YES];
to restore the button to it's original state, clicking on the  
button is
not guaranteed to result in drawing the alternate image as before  
even though

going through same action method.
Sometimes it does; sometimes it doesn't -just draws blank image.

Why this unexpected behavour? Does this imply no dynamic setting of  
alternate image?
But it works when first loaded from nib. Why not when button state  
is reset programmatically?


I'd appreciate some help on debugging this.

Thanks...

Peter

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dispatch NSEvent to everyone

2008-07-18 Thread Shawn Erickson
On Fri, Jul 18, 2008 at 8:55 AM, Matthew Williamson <[EMAIL PROTECTED]> wrote:

> but I need to be able to send Cocoa events into the system--meaning 
> CGPostMouseEvent won't cut it.

> All the code examples I can find seem to use CGPostMouseEvent to accomplish 
> this kind of thing. But I need to be able to do more kinds of events than the 
> Carbon API provides functions for.

What do you mean by the above?

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dispatch NSEvent to everyone

2008-07-18 Thread Jean-Daniel Dupas


Le 18 juil. 08 à 17:55, Matthew Williamson a écrit :


Hello list,

Ok, I'm completely new to Cocoa programming, but I've been  
programming for 10 years, so I think I can figure this out.


I'm trying to do something remotely similar to a VNC server (pun  
intended :-) ), but I need to be able to send Cocoa events into the  
system--meaning CGPostMouseEvent won't cut it. I've seen  
NSApplication postEvent:atStart: and sendEvent: , but from what I  
can tell these only dispatch events to the current application. Is  
there a way to dispatch an event to be handled by the whole  
windowing system?


All the code examples I can find seem to use CGPostMouseEvent to  
accomplish this kind of thing. But I need to be able to do more  
kinds of events than the Carbon API provides functions for. It seems  
like there should be a way to do this...and without resorting to  
something like objc_sendMsg :-).


Or am I missing something fundamental about the event messaging  
system?


Thanks in advance!

-Matt


You may have more lick using CGEvent API (especially CGEventCreate...  
family functions and CGEventPost).


http://developer.apple.com/documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Problem compiling first Cocoa app

2008-07-18 Thread Matt Neuburg
On Fri, 18 Jul 2008 07:34:56 -0700, "Paul Denlinger"
<[EMAIL PROTECTED]> said:
>I'm working on my first Cocoa lesson at
>http://www.cocoadevcentral.com/d/learn_cocoa/
>Everything works fine until I try to compile the app. I get error code 71.
>Can you tell me what's wrong? Here is the error message:
>
>*error: can't exec
>'/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/c
opystrings'
>(No such file or directory)*

http://www.cocoabuilder.com/archive/message/xcode/2008/6/11/6

?

m.

-- 
matt neuburg, phd = [EMAIL PROTECTED], 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Jean-Daniel Dupas

Le 18 juil. 08 à 17:39, Rick Hoge a écrit :



I would like to include a view divider similar to the one used in  
Xcode at the top of the editor window (contains forward and back  
buttons, popups for selection of source file and function, as well  
as pulldowns for a number of functions).


I expect this is a custom class created by Apple - does anyone know  
of an efficient way to replicate this type of view?  One thought I  
had was to create a table with a single row and add the desired  
controls as cells.


Any suggestions would be greatly appreciated -



If this is just to embed cells, you may use an NSMatrix (and call  
putCell:atRow:column:). It will be more appropriate IMHO.



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


Dispatch NSEvent to everyone

2008-07-18 Thread Matthew Williamson

Hello list,

Ok, I'm completely new to Cocoa programming, but I've been programming  
for 10 years, so I think I can figure this out.


I'm trying to do something remotely similar to a VNC server (pun  
intended :-) ), but I need to be able to send Cocoa events into the  
system--meaning CGPostMouseEvent won't cut it. I've seen NSApplication  
postEvent:atStart: and sendEvent: , but from what I can tell these  
only dispatch events to the current application. Is there a way to  
dispatch an event to be handled by the whole windowing system?


All the code examples I can find seem to use CGPostMouseEvent to  
accomplish this kind of thing. But I need to be able to do more kinds  
of events than the Carbon API provides functions for. It seems like  
there should be a way to do this...and without resorting to something  
like objc_sendMsg :-).


Or am I missing something fundamental about the event messaging system?

Thanks in advance!

-Matt

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Authentication only for non admin login.

2008-07-18 Thread Gary L. Wade
Sorry, I didn't read your original post too carefully; it looks like you 
haven't even gotten to that point of authenticating.  Check for examples using 
SFAuthorizationView; it creates the OS-standard lock/unlock icon and label and 
can prompt the user in the way you want.

If you still need the username after that, see my first post.

>If you have already gotten an AuthorizationRef that's been authenticated, you 
>can "copy info" from it that holds the "Username" (see the related 
>documentation for those keywords).  If you want the Unix username, start with 
>"getuid" and work from there.
>
>>hi,
>>I think I have precisely mentioned what I want to do in the first 2 lines of
>>my previous post. To add to it my current implementation is asking for a
>>user name and password for admin as well as standard user login i want it to
>>ask for a user name and password only for and only for  standard user login.
>>
>>Can anyone tell me a way to identify which user(root/admin/standard) has
>>logged?
>>
>>On Fri, Jul 18, 2008 at 12:35 AM, Mike <[EMAIL PROTECTED]>
>>wrote:
>>
>>> No one is going to help you if you don't describe exactly what it is you
>>> are trying to do. Authentication is a very difficult subject on OS X.
>>> Without a concise, clear explanation, you're not going to get any help.
>>>
>>> ninad walvekar wrote:
>>>
 hi,

 I want to run an application such that it will pop-up for the admin user
 name and password(authentication) when run by nonadmin (standard )login.

 let me explain what i am doing:-
 - (BOOL)Authenticate {

AuthorizationRights myRights;
AuthorizationItem   myItems[1];
AuthorizationRefauthorizationRef;
OSStatuserr;
AuthorizationFlagsauthFlags =
 kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
BOOLbRet;

myItems[0].name = kAuthorizationRightExecute;
myItems[0].valueLength = 0;
myItems[0].value = NULL;
myItems[0].flags = 0;

char *  rmArgs[2];
 //int status;

rmArgs[0] = "-l";
rmArgs[1] = NULL;
 //rmArgs[2] = NULL;


myRights.count = sizeof(myItems) / sizeof(myItems[0]);
myRights.items = myItems;


err = AuthorizationCreate(&myRights, kAuthorizationEmptyEnvironment,
 authFlags, &authorizationRef);

return bRet;

 }
 Can anyone tell the required modification so that i can make it work the
 way
 mentioned above or some other way by which i can achieve the needful.

 thanks in advance
___

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

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

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

This email sent to [EMAIL PROTECTED]


Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Rick Hoge


I would like to include a view divider similar to the one used in  
Xcode at the top of the editor window (contains forward and back  
buttons, popups for selection of source file and function, as well as  
pulldowns for a number of functions).


I expect this is a custom class created by Apple - does anyone know of  
an efficient way to replicate this type of view?  One thought I had  
was to create a table with a single row and add the desired controls  
as cells.


Any suggestions would be greatly appreciated -

Rick

(43092.6825)

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Authentication only for non admin login.

2008-07-18 Thread Michael Ash
On Fri, Jul 18, 2008 at 4:02 AM, ninad walvekar <[EMAIL PROTECTED]> wrote:
> hi,
> I think I have precisely mentioned what I want to do in the first 2 lines of
> my previous post. To add to it my current implementation is asking for a
> user name and password for admin as well as standard user login i want it to
> ask for a user name and password only for and only for  standard user login.
>
> Can anyone tell me a way to identify which user(root/admin/standard) has
> logged?

The simplest and most reliable technique is to simply attempt whatever
it is you're doing without authorizing. If it worked then you already
have the permissions you need. If it fails then authorize and try it
again.

Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


  1   2   >