Re: Nib Loading Crash on Tiger only

2009-09-29 Thread Graham Cox


On 30/09/2009, at 4:45 PM, Steve Cronin wrote:


I'm using .xib files but I don't what I should even be looking for.

What is this trying to tell me?



Looks like your nib contains a Leopard-only class, and therefore it  
can't dearchive it on Tiger. Seems to be some sort of private image  
rep class - are you using an image templae only available on Leopard?


Have you set the deployment target for the nib file in IB? That might  
pick up what the problem is.


--Graham


___

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

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

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

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


Nib Loading Crash on Tiger only

2009-09-29 Thread Steve Cronin

Folks;

I have converted to using SL; XC3.2; IB 3.2.
I have an app with a deployment target of 10.4
There are no IB warnings; the dev target is IB 3.2

Things have been working reasonably well but now when I test on a  
Tiger I crash immediately

Leopard and Snow Leopard are fine

2009-09-30 01:34:18.529 XYZ[8852] An uncaught exception was raised
2009-09-30 01:34:18.530 XYZ[8852] *** -[NSKeyedUnarchiver  
decodeObjectForKey:]: cannot decode object of class (NSCoreUIImageRep)
2009-09-30 01:34:18.530 XYZ[8852] *** Uncaught exception:  
 *** -[NSKeyedUnarchiver  
decodeObjectForKey:]: cannot decode object of class (NSCoreUIImageRep)


I'm using .xib files but I don't what I should even be looking for.

What is this trying to tell me?
Steve
___

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

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

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

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


Re: The principle of the "iTunes Syncing"?

2009-09-29 Thread Kyle Sluder
2009/9/29 James :
>   Now I am developing an cocoa application. One of the app's function is to
> synchronize the audio and video files to the iPod/iPhone. The function is same
> as the "iTunes Syncing" function.

You have no access to the user's iTunes or iPod libraries.

>   So I want to know about the principle of the "iTunes Syncing". And is there
> any framework to implement the "Syncing" function?

No.  You will have to implement your own syncing functionality over
the air (WiFi or cellular).  The SDK does not give access to syncing
over the wire with iTunes.

Please file bugs about this at http://bugreport.apple.com.  We would
all benefit from access to at least over-the-wire syncing.

--Kyle Sluder
___

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

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

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

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


The principle of the "iTunes Syncing"?

2009-09-29 Thread James
Hi all,
   Now I am developing an cocoa application. One of the app's function is to 
synchronize the audio and video files to the iPod/iPhone. The function is same
as the "iTunes Syncing" function.
   So I want to know about the principle of the "iTunes Syncing". And is there
any framework to implement the "Syncing" function?
   I have refered to the developer.apple.com and other BBS. But there is little
infomation about the principle of iTunes Syncing.
   Could anyone point me some clues about it?
   Thanks in advance!
James
___

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

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

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

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

Re: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread Ken Ferry
On Tue, Sep 29, 2009 at 5:35 PM, jon  wrote:

> oh,  i was thinking that method was inherited from the NSControl class...
>
> great,  so now i still can't figure out why my custom Cell methods are not
> firing  still looking for the problem..
>

+cellClass is consulted whenever an NSControl needs to make an NSCell from
scratch for itself.

Nib unarchiving is an interesting case where NSControl *doesn't* need to
make a cell, so +cellClass doesn't get called.  Why?  Because the cell was
already created, at design time in the nib.  It's just unarchived.

If that's the case you're in, select the cell in IB and change its
class.


-Ken


>
> Jon.
>
>
>
> On Sep 29, 2009, at 6:28 PM, Jens Alfke wrote:
>
>
>> On Sep 29, 2009, at 5:19 PM, jon wrote:
>>
>>   [fsBrowser setCellClass: [FSBrowserCell class]];
>>>
>>> fsBrowser is an instance,
>>>
>>>  IBOutlet NSBrowser*fsBrowser;
>>>
>>> yet isn't setCellClass a class method?
>>>
>>
>> No, it's a regular instance method; just look in NSBrowser.h:
>>
>> - (void)setCellClass:(Class)factoryId;
>>
>> —Jens
>>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
> This email sent to kenfe...@gmail.com
>
___

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

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

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

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


Re: NSView clicking through to superview

2009-09-29 Thread PCWiz

Thanks

On 2009-09-29, at 9:49 PM, Kyle Sluder  wrote:


Just don't propagate it.

This is what the NSResponder implementation of -mouseDown: looks like:

- (void)mouseDown:(NSEvent *)theEvent
{
 [[self nextResponder] mouseDown:theEvent];
}

All you have to do is *not* do that line, and *not* call super's  
implementation.


--Kyle Sluder

___

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

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

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

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


Re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)

2009-09-29 Thread Quincey Morris

On Sep 29, 2009, at 21:56, Luke Evans wrote:

Well, I'm more than happy to file a bug, as it has been tricky to  
figure out (and I would probably still be at it without your  
interjection).




...

On 2009-09-29, at 8:16 PM, Ben Trumbull wrote:

...



I don't think anyone has cared enough to file a bug on this.


I don't get it. There's an open manhole in the street with the manhole  
cover lying right next to it, and the problem is that no one cared  
enough to call the Department of Works to complain?



___

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

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

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

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


Re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)

2009-09-29 Thread Luke Evans
Well, I'm more than happy to file a bug, as it has been tricky to  
figure out (and I would probably still be at it without your  
interjection).
There are several ways to frame the problem of course: it could be a  
documentation bug... things aren't as simple as might first appear in  
the docs/guide, or maybe something can be done to have deleted object  
behave in a 'friendlier' manner w.r.t. their defunct relationships.  I  
suppose I can just find a general form of words and let you good folks  
figure out what it really means in practice :-)


I still think I might have something more to figure out here too.  At  
the end of my testing, as an experiment I had a main thread timer fire  
periodically to perform a save on the main thread's MOC (without  
performing any changes on the main thread's MOC at all).  This induced  
the same problem, and I'm still curious as to how the main thread's  
copy of the graph might have the nil in the relationship under these  
conditions.  AFAICS there shouldn't have been any chance for either  
MOC to be in this condition at any time.  I assume the merge operation  
from the other thread is 'atomic' somehow and activity on another  
thread (like a save) should not be able to catch that MOC in some kind  
of in-between state?


Aside from this 'stress' test though, I haven't (yet) got it to fall  
over - essentially under the conditions where only one thread (albeit  
one of several threads on any occasion) is making changes and saving  
at a time.


Cheers

-- Luke


On 2009-09-29, at 8:16 PM, Ben Trumbull wrote:



On Sep 29, 2009, at 8:22 PM, Luke Evans wrote:


Hello Ben.

What happens if you add a call to -processPendingChanges in  
between #2 and #3 ?


... well then everything works wonderfully (oh joy!!) :-)

OK.  I need to get a proper mental picture of why this is needed in  
this case.
I guess I was vaguely aware of this method from previous passes  
though the Core Data docs, but...


- The method documentation itself doesn't _really_ suggest it may  
be essential in some cases.   Rather, the talk is about getting the  
undo manager into step, and even then the statement is made that  
this is done by default at the end of the run loop.
- deleteObject docs, or indeed the guide section on deleting  
(Creating and Deleting Managed Objects) makes no mention of a need  
to call this method
- I had tried manually setting the old deleted objects 'back  
relationship' to nil, before deleting it, and before setting A's  
relationship to the new B.  This hadn't worked, but was my attempt  
to keep the relationships consistent - at least in in the MOC that  
induced the change.


It's tempting to just think that you should _always_ do a - 
processPendingChanges before a -save:, but I'd prefer to understand  
what's really happening here.


It's not before the save.  It's in between the deletion and the re- 
assignment of the relationship of the surviving object to a new  
object.  The problem is reassigning the relationship before delete  
propagation runs.  Delete propagation, as well as the change  
notifications and several other aspects of object graph change  
tracking are coalesced and run later.   Calling  
processPendingChanges is one of those later times.  The application  
event loop also calls it, which is the default timing.  Executing a  
fetch, or a save will also call it.


Manually setting the deleted object's relationship instead of  
calling processPendingChanges between steps #2 & #3 should also work.


I don't think anyone has cared enough to file a bug on this.

- Ben



If you have insights on the above, then that would be great.   
Regardless, you've just improved my humour by several degrees ;-)


-- Luke


On 2009-09-29, at 3:59 PM, Ben Trumbull wrote:


Now, I have some code that changes the value of the 'B enumeration
value' that A is using.  This does the following:
1. Create a new instance of the B subentity that represents the  
value

we want (in the same MOC as A)
2. Delete the old B object that A was pointing to, i.e. [moc
deleteObject:B];
3. Set A's to-one relationship to point to the new B object (and  
for

good measure, set B's inverse relationship - though this should be
done automagically).
4. Save the moc

4. is where badness happens (failed to save).  The error tells me  
that
A's relationship property to B is nil... but just before I do the  
save
I log the value of the object referenced by this relationship and  
it's

the new 'B' object!
I have no idea what I've done to upset Core Data such that it  
claims a

relationship is nil when I save, but the line before the [moc
save:&err], the relationship shows as referencing a perfectly good
object.


So you delete B, which has an inverse relationship to A.  Then you  
set a new B on A.  Then you save, and delete propagation cleans up  
the graph, nullifying the old B's inverse relationship ?


What happens if you add a call to -processPendingChanges in  
between #2 and #3 ?

Re: NSView clicking through to superview

2009-09-29 Thread Kyle Sluder
Just don't propagate it.

This is what the NSResponder implementation of -mouseDown: looks like:

- (void)mouseDown:(NSEvent *)theEvent
{
  [[self nextResponder] mouseDown:theEvent];
}

All you have to do is *not* do that line, and *not* call super's implementation.

--Kyle Sluder
___

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

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

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

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


Re: NSView clicking through to superview

2009-09-29 Thread PCWiz
Earlier I did try mouseDown:, and it did capture all the clicks (which  
is what I wanted), but I was not sure on how to implement it. How  
would I override it so that clicks would not pass through to the  
superview?


On 2009-09-28, at 8:07 PM, Kyle Sluder wrote:

On Sun, Sep 27, 2009 at 7:36 PM, PCWiz   
wrote:
I have a transparent black NSView that I layer over my window using  
NSView's
addSubview method. This works fine, but I want to make it so that  
all clicks
are captured by the NSView, because right now I can click through  
to the
superview underneath. I've already tried returning NO for  
acceptsFirstMouse

and it has no effect.


-acceptsFirstMouse: (note the colon) has nothing to do with this.
That determines whether clicking on the control when the window is not
main will cause the event to be dispatched to that view or if it will
simply be dropped on the floor when the window activates.  Typically,
UI controls that could cause destructive changes (like a Delete
toolbar item) return NO, whereas non-destructive controls (like the
toolbar show/hide widget in the titlebar) return YES.

Have you followed Mike Abdullah's advice and overridden -mouseDown:?
The documentation for this method describes exactly why you are seeing
what you are seeing.  In fact, I would have expected that to be the
first thing you would have tried.  If it wasn't, maybe it's worth
seeing if the documentation can be improved to nudge people in this
direction in the future.

--Kyle Sluder


___

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

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

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

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


Re: NSTokenField token color/control

2009-09-29 Thread Brandon Walkin
I wrote some code a while back to customize the appearance of a token  
field. Feel free to use it. It does use some private API, though, so  
beware.


http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTokenFieldCell.m
http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTokenAttachmentCell.m

Brandon

On 2009-09-28, at 7:01 AM, JECKER Frédéric wrote:

It seems that my last post hooked up somewhere (sorry for the  
repost) :

Hi,
Is it possible to control the background color of NSTokenField  
tokens ?

Googling this topic didn't returned me any interesting results.
Could anyone give me some urls covering this topic / give me some  
trails to

follow (subclass NSTokenField cell ?)

Thanks a lo
___

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

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

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

This email sent to bwal...@gmail.com


___

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

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

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

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


Re: Populating NSTokenField

2009-09-29 Thread Matthew Lindfield Seager
http://www.lmgtfy.com/?q=populate+contents+nstokenField
http://lists.apple.com/archives/Cocoa-dev/2005/May/msg00551.html

2009/9/30 vince :
> Thanks for the assistance ...
> How can I populate the contents of a tokenField object with multiple tags at
> application startup?
>
> -v.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/matthew%40sagacity.com.au
>
> This email sent to matt...@sagacity.com.au
>



-- 


Safe, comfortable and satisfied? Consider supporting some people who aren't!
I'm riding 100 kilometres to raise funds for refugees!
http://my.e2rm.com/personalPage.aspx?registrationID=750445
___

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

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

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

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


Populating NSTokenField

2009-09-29 Thread vince
Thanks for the assistance ...
How can I populate the contents of a tokenField object with multiple tags at
application startup?

-v.
___

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

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

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

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


Re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)

2009-09-29 Thread Ben Trumbull


On Sep 29, 2009, at 8:22 PM, Luke Evans wrote:


Hello Ben.

What happens if you add a call to -processPendingChanges in between  
#2 and #3 ?


... well then everything works wonderfully (oh joy!!) :-)

OK.  I need to get a proper mental picture of why this is needed in  
this case.
I guess I was vaguely aware of this method from previous passes  
though the Core Data docs, but...


- The method documentation itself doesn't _really_ suggest it may be  
essential in some cases.   Rather, the talk is about getting the  
undo manager into step, and even then the statement is made that  
this is done by default at the end of the run loop.
- deleteObject docs, or indeed the guide section on deleting  
(Creating and Deleting Managed Objects) makes no mention of a need  
to call this method
- I had tried manually setting the old deleted objects 'back  
relationship' to nil, before deleting it, and before setting A's  
relationship to the new B.  This hadn't worked, but was my attempt  
to keep the relationships consistent - at least in in the MOC that  
induced the change.


It's tempting to just think that you should _always_ do a - 
processPendingChanges before a -save:, but I'd prefer to understand  
what's really happening here.


It's not before the save.  It's in between the deletion and the re- 
assignment of the relationship of the surviving object to a new  
object.  The problem is reassigning the relationship before delete  
propagation runs.  Delete propagation, as well as the change  
notifications and several other aspects of object graph change  
tracking are coalesced and run later.   Calling processPendingChanges  
is one of those later times.  The application event loop also calls  
it, which is the default timing.  Executing a fetch, or a save will  
also call it.


Manually setting the deleted object's relationship instead of calling  
processPendingChanges between steps #2 & #3 should also work.


I don't think anyone has cared enough to file a bug on this.

- Ben



If you have insights on the above, then that would be great.   
Regardless, you've just improved my humour by several degrees ;-)


-- Luke


On 2009-09-29, at 3:59 PM, Ben Trumbull wrote:


Now, I have some code that changes the value of the 'B enumeration
value' that A is using.  This does the following:
1. Create a new instance of the B subentity that represents the  
value

we want (in the same MOC as A)
2. Delete the old B object that A was pointing to, i.e. [moc
deleteObject:B];
3. Set A's to-one relationship to point to the new B object (and for
good measure, set B's inverse relationship - though this should be
done automagically).
4. Save the moc

4. is where badness happens (failed to save).  The error tells me  
that
A's relationship property to B is nil... but just before I do the  
save
I log the value of the object referenced by this relationship and  
it's

the new 'B' object!
I have no idea what I've done to upset Core Data such that it  
claims a

relationship is nil when I save, but the line before the [moc
save:&err], the relationship shows as referencing a perfectly good
object.


So you delete B, which has an inverse relationship to A.  Then you  
set a new B on A.  Then you save, and delete propagation cleans up  
the graph, nullifying the old B's inverse relationship ?


What happens if you add a call to -processPendingChanges in between  
#2 and #3 ?


- Ben


___

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

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

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

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


[SOLVED] (again) How to observe every child entity

2009-09-29 Thread Matthew Lindfield Seager
Jim Correia wrote:

> What you are talking about is not observing child entities. You wish to
> observe related instances (NSManagedObject or subclass thereof). The entity
> describes the instance, but is not the instance.
>
You're right and I don't think that's overly pedantic. OTOH I was just
trying for a succinct subject that covered my intent. I think my usage was
appropriate in the actual content of the post.

Jerry Krinock wrote:

> I don't think you want to do that.  When I had similar issues a few months
> ago [1] I decided that the solution was Custom Setters.

 Thanks Jerry! To work around the bug you pointed out I'm now storing the
balance property as a regular attribute and updating it every time the
transactions relationship or a related transaction amount changes (using
custom setters).


FWIW, my original question bit me again but eventually I figured out what I
was doing wrong (and slapped myself)... When I originally asked why
add/removeTransactionsObject: and add/removeTransactions: weren't getting
called by the array controller I completely overlooked the inverse of that
relationship.

The inverse relationship was getting set by a "child" object and Core Data
was automagically taking care of the parent's to-many relationship without
calling my custom
setters. I bet you that behaviour is even documented somewhere! ;-)

Thanks everyone!
Matt



Safe, comfortable and satisfied? Consider supporting some people who aren't!
I'm riding 100 kilometres to raise funds for refugees!
http://my.e2rm.com/personalPage.aspx?registrationID=750445
___

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

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

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

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


Re: NSTableColumn value binding + keypath over a relationship

2009-09-29 Thread Stamenkovic Florijan


On Sep 29, 2009, at 19:21, Quincey Morris wrote:


On Sep 29, 2009, at 15:27, Stamenkovic Florijan wrote:


// the group dragged to
		NSManagedObject* group = [((NSTreeNode*)proposedParentItem)  
representedObject];


// the URIs of Notes being dragged
NSArray* noteURIs = [NSKeyedUnarchiver
			 unarchiveObjectWithData:[pboard  
dataForType:FSNoteIDURIsArrayPBType]];


NSUndoManager* um = [[group managedObjectContext] undoManager];

// relate the notes to the group dragged into
// do it as a single undoable op
[um beginUndoGrouping];
for(NSURL* noteURI in noteURIs){
			// app delegate is the where the managed object URI -> managed  
object reference logic resides

FSNote* note = (FSNote*)[appDelegate 
objectForURI:noteURI];
note.group = group;
}
[um endUndoGrouping];


I dunno, this is where my head starts to hurt.

According to your error message, there was an observer of a Note  
(well, FSNote) object for key path "group.name".


I figured that out. And I am fairly sure it is a binding mediator  
between the column and the array controller, because if I remove that  
column, I don't get the error.


However, your binding is via arrangedObjects. Now, although the  
array controller may be KVO compliant for the property  
"arrangedObjects", the arrangedObjects array isn't itself KVO  
compliant for anything, because arrays just aren't. So although  
'note.group = group;' is generating the correct notification, maybe  
it just isn't "flowing through" the array controller to the binding  
mechanism.


Hm... I am thinking something similar. However, it seems to me that  
every item in the contents of an array controller is observed for  
relevant paths. Which can be witnessed when binding a table column's  
value to an attribute of an item in the controller. For example,  
"arrangedObjects.firstName" in a Person. So, it seems that an array  
controller provides KVO compliance for it's contents (arrangedObjects)  
as well as for the properties of items in that array. My situation  
seems to imply this too. If I bind to "arrangedObjects.group", and use  
a value transformer, I get both the correct behavior and updates in  
the NSTableView resulting when I change a Note's group relationship.  
Where it seems to fail is when stretching that path. Somehow the array  
controller seems to be able to handle "itemNoX.relationship", but not  
"itemNoX.relationship.attribute".


I'm going to take a stab in the dark and predict that you *don't*  
have "rearranges content automatically" checked for the array  
controller,


I do.


and that checking it will cause the error message to go away.


It does not.

(Or, equivalently, you could send a "rearrangeObjects" message to  
the array controller immediately after 'note.group = group;'.)


I am not sure where you are going with this, but I have tried it, and  
it does not change the behavior.


F

if nobody comes up with a "you are doing this wrong, do it like this"  
by tomorrow I will try to isolate this in a small case. Maybe I am  
causing this somewhere else in my code. I think not, but best to check.

___

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

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

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

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


Re: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon
ahh,  that was it,   thanks a lot,   that made perfect sense once i  
looked inside IB

I was also surprised that IB knew about my custom cell class...

I was thinking code code code...   and i just needed that shove in the  
correct direction...

you made my day,  after a very long day...

thanks,
Jon.


On Sep 29, 2009, at 7:58 PM, Kyle Sluder wrote:


+setCellClass: just tells the view "Hey next time you initialize
yourself, make a cell of this class."  Since your ImageTextField
instance was created inside of IB, this is never going to happen.
Instead you need to change the class of the cell from within IB, under
the Identity inspector.  It might be helpful to switch to the
hierarchical view so you can get easy access to the text field's cell.


___

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

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

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

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


Re: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread Kyle Sluder
+setCellClass: just tells the view "Hey next time you initialize
yourself, make a cell of this class."  Since your ImageTextField
instance was created inside of IB, this is never going to happen.
Instead you need to change the class of the cell from within IB, under
the Identity inspector.  It might be helpful to switch to the
hierarchical view so you can get easy access to the text field's cell.

--Kyle Sluder
___

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

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

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

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


Re: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon

hmmm,  well i'm trying hard to do it...here is what i've done...

in a header:

IBOutlet ImageTextField *addressBar;

i've created this pointer to this instance...

and then in the awakefromNib method,  i have this...

[ImageTextField setCellClass:[ImageTextFieldCell class]];

this set's the class so it's cell is "correct"... for the class...   
but


but maybe this is too late for the instance addressBar.  which was set  
in the header and IB???


I don't know how to check this instance to see if it is using the  
custom cell,   and i don't know how to set the instance  
specifically... (if this class method didn't do it)?


Jon.







On Sep 29, 2009, at 7:06 PM, Matt Neuburg wrote:


On or about 9/29/09 4:43 PM, thus spake "jon" :

is properly using my custom textfield,  but the custom textfield  
doesn't

appear to be using the custom cell


Then you have to *make* the custom textfield use the custom cell. :)  
Use
whips and chains if necessary. Actually, I think what I said before  
may

cover this sufficiently:


On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:
What I do is have the textfield replace its cell by a custom cell  
that
implements drawInteriorWithFrame, such as to inset its frame rect  
as it

calls super. m.


As the first part states, an instance of your cell class must *be*  
this text

field instance's cell. You have to make that happen... m.

--
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com





___

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

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

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

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


Re: Fast transition between two graphics

2009-09-29 Thread Matt Neuburg
On Wed, 30 Sep 2009 10:24:47 +1000, Rob Keniger  said:
>
>On 30/09/2009, at 4:16 AM, Chilton Webb wrote:
>
>> So now I'm experimenting with using an overlay window with layer
>> backed views, loading the images into the views, showing the window,
>> and drawing the animation by then translating the two views at the
>> same time. Is this the fastest way to do this?
>
>
>You could do it this way, although normally for something like this
>I'd use Core Image. Make two CIImages and use an animated transition
>CIFilter.

Right, that indeed is precisely the solution I ended up using for JACTVocab
2.0. My implementation is very similar to what the OP described: I'm
covering my window with a "glass" child window where I can use layers, and
calling setContent on a layer with an animated transition. (The app gives
the user a choice of transitions, and one of them is a push transition.) I
discussed my thinking in an earlier thread here as I was developing the
animation.

At the time, Uli Kusterer suggested it might have been better to swap views
and animate *that*. And I might still rewrite it that way. m.

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



___

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

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

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

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


Re: Core Data Calculated Properties

2009-09-29 Thread Matthew Lindfield Seager
John,
The info you are after is at:
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/KeyValueObserving/Concepts/DependentKeys.html

Specifically, keyPathsForValuesAffectingValueForKey:

Regards,
Matthew

Safe, comfortable and satisfied? Consider supporting some people who aren't!
I'm riding 100 kilometres to raise funds for refugees!
http://my.e2rm.com/personalPage.aspx?registrationID=750445
___

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

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

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

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


Re: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread Matt Neuburg
On or about 9/29/09 4:43 PM, thus spake "jon" :

> is properly using my custom textfield,  but the custom textfield doesn't
> appear to be using the custom cell

Then you have to *make* the custom textfield use the custom cell. :) Use
whips and chains if necessary. Actually, I think what I said before may
cover this sufficiently:

> On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:
>> What I do is have the textfield replace its cell by a custom cell that
>> implements drawInteriorWithFrame, such as to inset its frame rect as it
>> calls super. m.

As the first part states, an instance of your cell class must *be* this text
field instance's cell. You have to make that happen... m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com



___

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

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

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

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


Re: Fast transition between two graphics

2009-09-29 Thread Rob Keniger


On 30/09/2009, at 10:33 AM, Chilton Webb wrote:

I will take a shot at this. My concern is that I've seen CoreImage  
transitions bog down initially, I guess in their loading phase or  
something. 	I have an early model G5 that I use for testing the low  
end of the Leopard range (and it still looks strange to say G5 and  
Low End in the same sentence). On that machine, apps that use  
CoreImage tend to have a visual stutter initially, and I'm not sure  
if that's a CI thing or an app specific thing. Is there a 'push'  
effect for CI though?


Hmm, actually I don't think there is. There is one if you want to use  
the private CoreGraphics filters:


http://lipidity.com/apple/core-graphics-meet-core-image-demo-app
http://lipidity.com/apple/the-ultimate-core-graphics-resource

However, it's probably not a good idea for a shipping app.

CoreImage uses the GPU, so if the GPU is a bit feeble or you are using  
really large images then it may have frame rate issues, however Core  
Animation can have these issues too.


--
Rob Keniger



___

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

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

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

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


Don't understand NSBrowser's setReusesColumns:

2009-09-29 Thread Philip White

Hello,
  I posted a question a few days ago about the NSBrowser delegate  
method:


- (void)browser:(NSBrowser *)sender createRowsForColumn:(NSInteger) 
column inMatrix:(NSMatrix *)matrix


I was having problems where this was getting called with the matrix  
argument equal to nil. I ended up finding out that this only happens  
when I have the NSBrowser set up to reuse columns (by calling  
setReusesColumns:).
 Would someone explain to me exactly why enabling that setting causes  
this behavior? If you have this set are you expected to keep the  
matrix from the first time it is passed to your delegate.?If so why  
doesn't it just get passed again for convenience's sake?


Thanks for your time,
 Philip White

P.S. Unless I'm mistaken (that's not unheard of), this behavior was  
not present under Leopard, just Snow Leopard.

___

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

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

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

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


Re: Some more questions on NSOpenPanel

2009-09-29 Thread David M. Cotter
Just before we put up the dialog, we enable undo, cut, copy, paste,  
clear, and select all.  these items all have the correct HICommand  
assigned (eg: "select all" has kHICommandSelectAll as it's "tag")


Tag?  kHICommandSelectAll?  This is the cocoa-dev list.  ;-)


okye, well yes:

[nsMenuItem setTag: kHICommandSelectAll];


The Select All item needs a target of First Responder and an action of
-selectAll:.


okay fine.
so just before i put up the OS dialog, i now set the action to  
selectAll and the target to nil (first reponder, right?)


[nsMenuItem setAction:@selector(selectAll:)];
[nsMenuItem setTarget:nil];


i also enable the menu item
then i put up my NSPanel (the save dialog)

however the edit menu is completely disabled, specifically the  
SelectAll command is still disabled.


what else could i possibly be missing


___

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

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

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

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


Re: Static Analyzer Question

2009-09-29 Thread Steve Cronin

Gentlemen;

YES Bingo!   + newWidgetID

I love how Cocoa can so drive you crazy and then when insight happens  
it's often nearly painful in its elegance and simplicity…

Breathtaking sometimes….

Thank-you all,
Steve



On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote:

"…. Object with +0 retain counts returned to caller where a +1  
(owning) retain count is expected"

this is shown at the end of a particular method.


I think this means the method has a name that by convention  
indicates that it returns a reference the caller must release — i.e.  
a prefix of "alloc" or "copy" or "mutableCopy"



+ (NSString *) fooBar {
NSString *result = @"";
…..
if (x) {
result = @"1";
...
} else {
result = @"2";
}
return result;
}


What's the actual name (not 'fooBar')?

Why does Clang believe that an 'owning retain count is expected' if  
the method is never called?


Objective-C is a dynamic enough language that there is no way to  
tell at compile time whether a method is reachable or not. Even if  
that selector never appears in your code, it could be constructed at  
runtime, or your code could load a plugin bundle that calls that  
selector.


—Jens


___

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

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

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

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


Re: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread jon
oh,  i was thinking that method was inherited from the NSControl  
class...


great,  so now i still can't figure out why my custom Cell methods are  
not firing  still looking for the problem..


Jon.


On Sep 29, 2009, at 6:28 PM, Jens Alfke wrote:



On Sep 29, 2009, at 5:19 PM, jon wrote:


  [fsBrowser setCellClass: [FSBrowserCell class]];

fsBrowser is an instance,

  IBOutlet NSBrowser*fsBrowser;

yet isn't setCellClass a class method?


No, it's a regular instance method; just look in NSBrowser.h:

- (void)setCellClass:(Class)factoryId;

—Jens


___

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

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

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

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


Re: Fast transition between two graphics

2009-09-29 Thread Chilton Webb

Hi Rob!

Thank you for writing. I suppose the only way I'll know for sure is to  
test this with both.


On Sep 29, 2009, at 7:24 PM, Rob Keniger wrote:
You could do it this way, although normally for something like this  
I'd use Core Image. Make two CIImages and use an animated transition  
CIFilter.


I will take a shot at this. My concern is that I've seen CoreImage  
transitions bog down initially, I guess in their loading phase or  
something. 	I have an early model G5 that I use for testing the low  
end of the Leopard range (and it still looks strange to say G5 and Low  
End in the same sentence). On that machine, apps that use CoreImage  
tend to have a visual stutter initially, and I'm not sure if that's a  
CI thing or an app specific thing. Is there a 'push' effect for CI  
though?


That said, CoreImage would theoretically work with Tiger as well, and  
providing backwards compatibility is something I'm considering anyway.  
Hmmm. I'll have to test both. Excellent suggestion!


Thank you!
-Chilton
___

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

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

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

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


Re: Static Analyzer Question

2009-09-29 Thread Jens Alfke


On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote:

"…. Object with +0 retain counts returned to caller where a +1  
(owning) retain count is expected"

this is shown at the end of a particular method.


I think this means the method has a name that by convention indicates  
that it returns a reference the caller must release — i.e. a prefix of  
"alloc" or "copy" or "mutableCopy"



+ (NSString *) fooBar {
NSString *result = @"";
…..
if (x) {
result = @"1";
...
} else {
result = @"2";
}
return result;
}


What's the actual name (not 'fooBar')?

Why does Clang believe that an 'owning retain count is expected' if  
the method is never called?


Objective-C is a dynamic enough language that there is no way to tell  
at compile time whether a method is reachable or not. Even if that  
selector never appears in your code, it could be constructed at  
runtime, or your code could load a plugin bundle that calls that  
selector.


—Jens___

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

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

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

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


Re: Static Analyzer Question

2009-09-29 Thread Wim Lewis


On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote:

This is the only method that Clang has an issue with…

Why does Clang believe that an 'owning retain count is expected' if  
the method is never called?
Why is Clang picking on this one method which mirrors the mechanics  
of so many others?


Clang-sa decides what the retain behavior should be based on the  
method's name. Does the method name by any chance contain a substring  
like "new" or "copy"?


There are some macros in some header or other which you can use to  
tell Clang that a method should have some other behavior than what it  
guesses from the name, although they aren't as flexible as I might like.



___

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

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

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

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


Re: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread Jens Alfke


On Sep 29, 2009, at 5:19 PM, jon wrote:


   [fsBrowser setCellClass: [FSBrowserCell class]];

fsBrowser is an instance,

   IBOutlet NSBrowser*fsBrowser;

yet isn't setCellClass a class method?


No, it's a regular instance method; just look in NSBrowser.h:

- (void)setCellClass:(Class)factoryId;

—Jens___

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

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

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

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


Re: Static Analyzer Question

2009-09-29 Thread Greg Parker

On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote:
"…. Object with +0 retain counts returned to caller where a +1  
(owning) retain count is expected"

this is shown at the end of a particular method.

The deal is that, over time, I have isolated this method and at this  
moment there are NO methods which call it.
I cannot leave it like this - this isolation is a result of honing  
in on the Clang issue...


A very common pattern for my application looks like this:

+ (NSString *) fooBar {
NSString *result = @"";
…..
if (x) {
result = @"1";
...
} else {
result = @"2";
}
return result;
}

Yes this is a class method - I use this pattern for both class and  
instance methods.


This is the only method that Clang has an issue with…

Why does Clang believe that an 'owning retain count is expected' if  
the method is never called?
Why is Clang picking on this one method which mirrors the mechanics  
of so many others?


The static analyzer tries to enforce Cocoa's memory management  
convention, where the retain-edness of the return value depends on the  
name of the method. By that convention, if the method name contains  
"new" or "copy" or "alloc" then the return value is retained and the  
caller is expected to release it; otherwise the return value is  
autoreleased and the caller is not expected to release it.


What exactly is the name of the method the analyzer complains about?  
I'm guessing that name includes "new" or "copy" or "alloc", and the  
similar methods that the analyzer likes do not.



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


___

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

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

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

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


Re: Setting BorderThickness moves resize widget?!?

2009-09-29 Thread Gregory Weston

Knut Lorenzen wrote:


Dear List,

please take a look at this image:


(Picture shows my App in front of Safari before/after)

I would like to have a Statusbar in my App and I am using

[mainWindow setContentBorderThickness: 16.0 forEdge: NSMinYEdge];

and

[mainWindow setContentBorderThickness:0.0 forEdge: NSMinYEdge];

respectively, in order to switch between both.

It works fine, but the resize widget moves up 2 pixels when setting
ContentBorderThickness.
Please also note, that the rectangular corner becomes rounded when
setting ContentBorderThickness and restores to rectangular when
setting ContentBorderThickness back to 0.


This really should be promoted to the main docs somewhere, but it's in  
the release notes for AppKit in 10.5 (when this method was added).





"The behavior of -setContentBorderThickness:forEdge:NSMinYEdge and - 
setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge for  
non-textured windows will do the following: The top gradient will be  
repeated in the bottom border, separator lines will be drawn between  
the content and the bottom border, and the bottom corner will be  
rounded."

___

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

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

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

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


Re: Static Analyzer Question

2009-09-29 Thread Roland King

what's the name of the actual method it's complaining about?

Steve Cronin wrote:

Folks;

I have a Clang issue that is making me a little crazy.

I have a modestly complex Core Data application with several thousand  
lines of code.

I've run Clang and at this point I have only one issue:

"…. Object with +0 retain counts returned to caller where a +1  (owning) 
retain count is expected"

this is shown at the end of a particular method.

The deal is that, over time, I have isolated this method and at this  
moment there are NO methods which call it.
I cannot leave it like this - this isolation is a result of honing in  
on the Clang issue...


A very common pattern for my application looks like this:

+ (NSString *) fooBar {
NSString *result = @"";
…..
if (x) {
result = @"1";
...
} else {
result = @"2";
}
return result;
}

Yes this is a class method - I use this pattern for both class and  
instance methods.


This is the only method that Clang has an issue with…

Why does Clang believe that an 'owning retain count is expected' if  the 
method is never called?
Why is Clang picking on this one method which mirrors the mechanics of  
so many others?


Any thoughts appreciated!
Steve


___

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

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

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

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

___

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

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

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

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


Re: Fast transition between two graphics

2009-09-29 Thread Rob Keniger


On 30/09/2009, at 4:16 AM, Chilton Webb wrote:

So now I'm experimenting with using an overlay window with layer  
backed views, loading the images into the views, showing the window,  
and drawing the animation by then translating the two views at the  
same time. Is this the fastest way to do this?



You could do it this way, although normally for something like this  
I'd use Core Image. Make two CIImages and use an animated transition  
CIFilter.


--
Rob Keniger



___

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

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

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

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


Re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)

2009-09-29 Thread Luke Evans

Hello Ben.

What happens if you add a call to -processPendingChanges in between  
#2 and #3 ?


... well then everything works wonderfully (oh joy!!) :-)

OK.  I need to get a proper mental picture of why this is needed in  
this case.
I guess I was vaguely aware of this method from previous passes though  
the Core Data docs, but...


- The method documentation itself doesn't _really_ suggest it may be  
essential in some cases.   Rather, the talk is about getting the undo  
manager into step, and even then the statement is made that this is  
done by default at the end of the run loop.
- deleteObject docs, or indeed the guide section on deleting (Creating  
and Deleting Managed Objects) makes no mention of a need to call this  
method
- I had tried manually setting the old deleted objects 'back  
relationship' to nil, before deleting it, and before setting A's  
relationship to the new B.  This hadn't worked, but was my attempt to  
keep the relationships consistent - at least in in the MOC that  
induced the change.


It's tempting to just think that you should _always_ do a - 
processPendingChanges before a -save:, but I'd prefer to understand  
what's really happening here.


If you have insights on the above, then that would be great.   
Regardless, you've just improved my humour by several degrees ;-)


-- Luke


On 2009-09-29, at 3:59 PM, Ben Trumbull wrote:


Now, I have some code that changes the value of the 'B enumeration
value' that A is using.  This does the following:
1. Create a new instance of the B subentity that represents the value
we want (in the same MOC as A)
2. Delete the old B object that A was pointing to, i.e. [moc
deleteObject:B];
3. Set A's to-one relationship to point to the new B object (and for
good measure, set B's inverse relationship - though this should be
done automagically).
4. Save the moc

4. is where badness happens (failed to save).  The error tells me  
that
A's relationship property to B is nil... but just before I do the  
save
I log the value of the object referenced by this relationship and  
it's

the new 'B' object!
I have no idea what I've done to upset Core Data such that it  
claims a

relationship is nil when I save, but the line before the [moc
save:&err], the relationship shows as referencing a perfectly good
object.


So you delete B, which has an inverse relationship to A.  Then you  
set a new B on A.  Then you save, and delete propagation cleans up  
the graph, nullifying the old B's inverse relationship ?


What happens if you add a call to -processPendingChanges in between  
#2 and #3 ?


- Ben






___

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

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

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

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


simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread jon

how is the simpleBrowser example that is provided with xcode doing this?

[fsBrowser setCellClass: [FSBrowserCell class]];

fsBrowser is an instance,

IBOutlet NSBrowser*fsBrowser;

yet isn't setCellClass a class method?

i tried the same thing and got a warning?

thanks,
Jon.


___

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

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

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

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


Static Analyzer Question

2009-09-29 Thread Steve Cronin

Folks;

I have a Clang issue that is making me a little crazy.

I have a modestly complex Core Data application with several thousand  
lines of code.

I've run Clang and at this point I have only one issue:

"…. Object with +0 retain counts returned to caller where a +1  
(owning) retain count is expected"

this is shown at the end of a particular method.

The deal is that, over time, I have isolated this method and at this  
moment there are NO methods which call it.
I cannot leave it like this - this isolation is a result of honing in  
on the Clang issue...


A very common pattern for my application looks like this:

+ (NSString *) fooBar {
NSString *result = @"";
…..
if (x) {
result = @"1";
...
} else {
result = @"2";
}
return result;
}

Yes this is a class method - I use this pattern for both class and  
instance methods.


This is the only method that Clang has an issue with…

Why does Clang believe that an 'owning retain count is expected' if  
the method is never called?
Why is Clang picking on this one method which mirrors the mechanics of  
so many others?


Any thoughts appreciated!
Steve


___

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

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

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

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


Re: CoreRecipes Sample Code Data Model Error

2009-09-29 Thread Richard Somers

On Sep 23, 2009, at 4:41 PM, Richard Somers wrote:

Apple's CoreRecipes Sample Code Version 1.0 produces the following  
error.


Couldn’t open “/Users/ ... /CoreRecipes/Sample Applications/ 
CoreRecipesApp/MainApplication/Models/CoreRecipes.xcdatamodel”.


Reason: *** -[NSKeyedUnarchiver initForReadingWithData:]:  
incomprehensible archive (0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30,  
0x30).


Does anyone know how to get the data model to work for the  
CoreRecipiesApp?


The elements and layout files in the CoreRecipes.xcdatamodel package  
as currently downloaded from Apple are corrupted. Non-corrupted files  
can be found on the internet.


http://archive.mildmanneredindustries.com/archive/CoreRecipes/20070728/expanded/CoreRecipes/Sample%20Applications/CoreRecipesApp/MainApplication/Models/CoreRecipes.xcdatamodel/

Richard

___

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

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

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

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


Re: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon

i've got something i think is close...

i've got a custom cell,  and a custom textfield,

i've got an override implementation of "drawInteriorWithFrame"  that i  
think will work.


but i'm confused as to where to call "drawInteriorWithFrame",   right  
now it is inside the custom Cell,   but the custom textfield never  
calls it as i believe it should?


right now
---
IBOutlet ImageTextField *addressBar;
---

[addressBar setStringValue:urlString];
is properly using my custom textfield,  but the custom textfield  
doesn't appear to be using the custom cell...  (or atleast the new  
drawInteriorWithFrame is not being called)


(i have not overriden the "setStringValue")  Maybe this isn't the  
right call, and it is bypassing "drawInteriorWithFrame"?


the only connection between custom textfield and the custom cell is

#import "ImageTextFieldCell.h"

 is inside the header of the custom textfield.

does there need to more connection to it?   or how would i get this  
call to the new drawInteriorWithFrame?


the running app shows the text field filled in properly (just not  
offset, as the override implementation of drawInteriorWithFrame would  
have done) ,   so it must have called the super of it somewhere.


thanks for the help in advance.
Jon.




On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:


On Mon, 28 Sep 2009 19:37:00 -0600, jon  said:

i've got a textfield defined...
but i don't want to draw the text that is in the field right up
against the left boarder of the bounding box of this defined field in
IB,

I want to start the text like 20 pixels to the right of the left
boarder  and still have the nicely defined frame of the field in it's
original place...


What I do is have the textfield replace its cell by a custom cell that
implements drawInteriorWithFrame, such as to inset its frame rect as  
it

calls super. m.

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





___

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

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

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

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


Re: Splitting controller logic

2009-09-29 Thread Quincey Morris

On Sep 29, 2009, at 15:15, Chase Meadors wrote:

I'm having some conceptual trouble concerning using multiple windows  
with multiple controllers in a project. Where exactly is the line as  
to what a window controller subclass should manage, and what the App  
controller should manage?


Say I have a window with a fair amount of controls and setup  
required, so I create a window controller that manages it. I  
implement awakeFromNib on it to do the setup, and it implements any  
IBActions needed for controls in that particular window.


My app controller contains properties that are needed by every  
window in the app for modification or bindings. It seems to me, to  
avoid mixing windows with other controllers than their own, that I  
should declare an IBOutlet id mainAppController in each of the  
window controllers, and modify/bind to properties in the app  
controller by binding to myController.mainAppController.aProperty.


There's nothing obviously wrong with this. If it's window specific,  
the window controller should take care of it. If it's not window  
specific (and common to all windows), a singleton controller should  
take care of it.


However, I think you might be focused too much on controllers, and not  
enough on data models. Unless your requirements are very simple, you  
might want to move the application-wide properties to a singleton data  
model object (or object hierarchy).


Similarly, you should consider whether you should move the properties  
that individual windows depend on to data model objects. If you can  
conceptualize opening multiple windows on the *same* data (whether or  
not you ever actually intend to do that), then you probably need to  
abstract your data model from your window controllers.



___

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

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

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

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


NSLayoutManager and best override point for temporary attributes

2009-09-29 Thread Keith Blount
Hello,

I have certain custom text attributes that are used in my NSTextStorage to 
which I would like to add temporary attributes via the NSLayoutManager. For 
example, say I have a custom "NoteColor" text attribute associated with an 
NSColor object ([text addAttribute:@"NoteColor value:[NSColor redColor] 
range:range]); any range of text with this attribute I want to be drawn using a 
temporary attribute - for instance, having its NSForegroundAttributeName using 
the colour associated with the attribute.

What is the best and most efficient way of doing this?

In the past, I have reapplied the temporary attributes manually using 
NSLayoutManager's -setTemporaryAttribute:... every time the text is changed, 
for instance. That obviously isn't ideal, and more recently I have taken to 
overriding NSLayoutManager's 
-temporaryAttributesAtCharacterIndex:effectiveRange: to do this. For instance:

- (NSDictionary *)temporaryAttributesAtCharacterIndex:(unsigned)charIndex 
effectiveRange:(NSRangePointer)effectiveCharRange
{
NSDictionary *result = [super 
temporaryAttributesAtCharacterIndex:charIndex 
effectiveRange:effectiveCharRange];

NSTextStorage *textStorage = [self textStorage];
NSUInteger textLength = [textStorage length];

if (charIndex >= textLength)
return result;

NSMutableDictionary *mutableResult = nil;

NSDictionary *attribs = [textStorage attributesAtIndex:charIndex 
effectiveRange:NULL];

NSColor *color = [attribs objectForKey:@"NoteColor"];

if (color != nil)
{
mutableResult = [NSMutableDictionary 
dictionaryWithDictionary:result];
[mutableResult setObject:color 
forKey:NSForegroundColorAttributeName];
result = mutableResult;
}

return result;
}

(The above typed in my e-mail program as an example.)

However, this too seems incredibly inefficient. The above example would work 
fine, but as soon as I've checked for three or four custom attributes, typing 
slows down.

Is there a better way of doing this?

Thanks and all the best,
Keith


  
___

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

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

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

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


Re: NSTableColumn value binding + keypath over a relationship

2009-09-29 Thread Quincey Morris

On Sep 29, 2009, at 15:27, Stamenkovic Florijan wrote:


// the group dragged to
		NSManagedObject* group = [((NSTreeNode*)proposedParentItem)  
representedObject];


// the URIs of Notes being dragged
NSArray* noteURIs = [NSKeyedUnarchiver
			 unarchiveObjectWithData:[pboard  
dataForType:FSNoteIDURIsArrayPBType]];


NSUndoManager* um = [[group managedObjectContext] undoManager];

// relate the notes to the group dragged into
// do it as a single undoable op
[um beginUndoGrouping];
for(NSURL* noteURI in noteURIs){
			// app delegate is the where the managed object URI -> managed  
object reference logic resides

FSNote* note = (FSNote*)[appDelegate 
objectForURI:noteURI];
note.group = group;
}
[um endUndoGrouping];


I dunno, this is where my head starts to hurt.

According to your error message, there was an observer of a Note  
(well, FSNote) object for key path "group.name". However, your binding  
is via arrangedObjects. Now, although the array controller may be KVO  
compliant for the property "arrangedObjects", the arrangedObjects  
array isn't itself KVO compliant for anything, because arrays just  
aren't. So although 'note.group = group;' is generating the correct  
notification, maybe it just isn't "flowing through" the array  
controller to the binding mechanism.


I'm going to take a stab in the dark and predict that you *don't* have  
"rearranges content automatically" checked for the array controller,  
and that checking it will cause the error message to go away. (Or,  
equivalently, you could send a "rearrangeObjects" message to the array  
controller immediately after 'note.group = group;'.)


Alternatively, you could move to a small island in the Pacific and  
forget you ever heard of NSArrayController. ;)



___

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

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

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

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


Re: Some more questions on NSOpenPanel

2009-09-29 Thread Kyle Sluder
On Tue, Sep 29, 2009 at 3:52 PM, David M. Cotter  wrote:
> Just before we put up the dialog, we enable undo, cut, copy, paste, clear,
> and select all.  these items all have the correct HICommand assigned (eg:
> "select all" has kHICommandSelectAll as it's "tag")

Tag?  kHICommandSelectAll?  This is the cocoa-dev list.  ;-)

The Select All item needs a target of First Responder and an action of
-selectAll:.

--Kyle Sluder
___

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

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

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

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


Re: Core Data Calculated Properties [solved]

2009-09-29 Thread John McIntosh
After more research, I found my solution in the NSPersistentDocument
Tutorial. If anyone else has this problem, I needed to implement the
following method in the subclass for my entity:

+ (NSSet *)keyPathsForValuesAffectingProperty3{
return [NSSet setWithObjects:@"property1", @"property2", nil];
}

Also, declare the property in the entity's subclass header like this:

@property (nonatomic, readonly) NSString * property3;




On Tue, Sep 29, 2009 at 1:32 PM, John McIntosh
 wrote:
> Hi all. I am working on a core data application and am having some
> difficulty understanding how to configure a particular aspect of it.
>
> I am using an nstable to display a selection of properties from my
> core data managed object. I have the properties bound to the columns
> in the table and set to Continuously Updates Value. For most
> properties this works as expected.
>
> For example, I have a button that loads a value into property1. When
> pressed, the value is automatically updated in the table. I have
> another button that loads a different value into property2. Again,
> this is automatically updated. Lastly, the value of property3 should
> be the result of a function based on properties1 and 2. I have
> declared property3 as a transient value and have subclassed my entity.
> In the .m file for my subclass I have the following function:
>
> -(NSString *)property3{
>        NSString *p1 = [self valueForKey:@"property1"];
>        NSString *p2 = [self valueForKey:@"property2"];
>
>        NSMutableString *result = "";
>        [result stringByAppendingString[p1]];
>        [result stringByAppendingString[p2]];
>
>        return result;
> }
>
> In the GUI, when I press the buttons, the columns for property1 and
> property2 update immediately. However, the column with property3 only
> updates when something else changes in the table. For example,
> clicking a row or making another entry.
>
> Is this the correct setup for having a calculated value? If so, is
> there a way I can force the table to retrieve the new calculated value
> any time another property changes?
>
___

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

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

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

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


Core Data Calculated Properties

2009-09-29 Thread John McIntosh
Hi all. I am working on a core data application and am having some
difficulty understanding how to configure a particular aspect of it.

I am using an nstable to display a selection of properties from my
core data managed object. I have the properties bound to the columns
in the table and set to Continuously Updates Value. For most
properties this works as expected.

For example, I have a button that loads a value into property1. When
pressed, the value is automatically updated in the table. I have
another button that loads a different value into property2. Again,
this is automatically updated. Lastly, the value of property3 should
be the result of a function based on properties1 and 2. I have
declared property3 as a transient value and have subclassed my entity.
In the .m file for my subclass I have the following function:

-(NSString *)property3{
NSString *p1 = [self valueForKey:@"property1"];
NSString *p2 = [self valueForKey:@"property2"];

NSMutableString *result = "";
[result stringByAppendingString[p1]];
[result stringByAppendingString[p2]];

return result;
}

In the GUI, when I press the buttons, the columns for property1 and
property2 update immediately. However, the column with property3 only
updates when something else changes in the table. For example,
clicking a row or making another entry.

Is this the correct setup for having a calculated value? If so, is
there a way I can force the table to retrieve the new calculated value
any time another property changes?
___

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

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

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

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


re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)

2009-09-29 Thread Ben Trumbull

Now, I have some code that changes the value of the 'B enumeration
value' that A is using.  This does the following:
1. Create a new instance of the B subentity that represents the value
we want (in the same MOC as A)
2. Delete the old B object that A was pointing to, i.e. [moc
deleteObject:B];
3. Set A's to-one relationship to point to the new B object (and for
good measure, set B's inverse relationship - though this should be
done automagically).
4. Save the moc

4. is where badness happens (failed to save).  The error tells me that
A's relationship property to B is nil... but just before I do the save
I log the value of the object referenced by this relationship and it's
the new 'B' object!
I have no idea what I've done to upset Core Data such that it claims a
relationship is nil when I save, but the line before the [moc
save:&err], the relationship shows as referencing a perfectly good
object.


So you delete B, which has an inverse relationship to A.  Then you set  
a new B on A.  Then you save, and delete propagation cleans up the  
graph, nullifying the old B's inverse relationship ?


What happens if you add a call to -processPendingChanges in between #2  
and #3 ?


- Ben



___

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

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

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

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


Re: Some more questions on NSOpenPanel

2009-09-29 Thread David M. Cotter

originally from Frameworks IT list:

Vlad:
For some reason cmd-A does not work in our NSOpenPanel to select  
the current contents of the browser but navigation keystrokes do  
work. Is there something obvious that I am missing? Any clues?



Corbin:
Do you have an edit menu with Select All (Cmd-A)? If not..you  
might have to add one. Others may chime in if there is a different  
work around.


Vlad:
Our app does have Select All in Edit menu but since NSOpenModal is  
run as modal dialog, it is disabled with the rest of menu commands.  
I did a quick (far from exhaustive) survey and see that Apple apps  
enable Select All when modal dialog is up but non-Apple apps  
disable it.


The fully disabled Edit menu worked fine with NavServices (select  
all did select files in Open dialog) but is different in Cocoa.



Are you saying that if Select All is enabled when NSOpenPanel is  
up, then it will magically work? How does NSOpenPanel know that  
this command is selected if it is processed by the app’s event  
handling system? Sorry if it is something obvious but I am not sure  
I understand how it is supposed to work.


Corbin:
Yes -- it will work. The reason why, is because the command is sent  
up the responder chain.


Me:

well, sadly it still does not work.

Just before we put up the dialog, we enable undo, cut, copy, paste,  
clear, and select all.  these items all have the correct HICommand  
assigned (eg: "select all" has kHICommandSelectAll as it's "tag")


the only possibly different thing is that these items have their  
"action" set to something other than default.  would this make a  
difference?
other than that, what could be causing this to fail?  all items end up  
disabled, and it's not us disabling them.___


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

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

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

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


Re: Suggestions for debugging “EXC_BAD _ACCESS” - followup

2009-09-29 Thread Bob Barnes

Nick,

   Thanks, I suspected as much.

Bob

On Sep 29, 2009, at 3:27 PM, Nick Zitzmann wrote:



On Sep 29, 2009, at 4:18 PM, Bob Barnes wrote:

I wanted to follow up my email from last week with some additional  
questions about the leaks instrument and what it is or isn't trying  
to tell me. When running the leaks instrument with NSZombieEnabled  
several lines of the following code are flagged as leaked memory...


When running the leaks instrument with NSZombieEnabled, _everything_  
is flagged as leaked memory, because technically zombies count as  
leaks. To do proper leak checking, you need to turn off zombies.


Nick Zitzmann




___

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

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

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

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


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

2009-09-29 Thread Luke Evans

Mmmm, the plot thickens...

I think this has to do with two MOCs being out of synchronisation,  
despite my best efforts.  The specific situation is that I have two  
threads - the main thread and one other.  I've created a new test  
harness to try to isolate the problem, which does the following:


- Setup on Thread 1 (the main thread):
	- Create an instance of A, and a connected instance of B (of  
subentity 1).  Save.

- On Thread 2:
	- Swap A's object B for a new instance (of subentity 2), save, swap  
A's object B for a new instance (of subentity 3), save

- On Thread 1 (the main thread):
	- Swap A's object B for a new instance (of subentity 2), save, swap  
object B for a new instance (of subentity 3), save


All these actions are serial (using  
"performSelector:onThread:withObject:waitUntilDone:YES in the case of  
running things on Thread 2).  So there's no actual concurrency  
involved here, only MOC synchronisation.


The swapping actions above are performed by the same method, but  
naturally this method obtains its own copy of the A object against  
which it will make the changes.  This is done by resolving the  
permanent ID of the A object we're playing with in the MOC being used  
exclusively for the thread.
I have code that listens for NSManagedObjectContextDidSaveNotification  
on either MOC, and posts those changes to the other MOC, using - 
mergeChangesFromContextDidSaveNotification.  Note this is done on the  
thread to which this notification is dispatched (the main thread), but  
I'm assured on this list that this is OK (i.e. - 
mergeChangesFromContextDidSaveNotification bends the rules about  
changing MOCs across threads).


The test reproduces the problem when Thread 1 attempts to make its  
first save.  In this step, I log the object that A points to (which B)  
BEFORE I do the first swap, and AFTER this.  I find that its BEFORE  
state is an instance of subentity 3 (so this look to be correctly  
propagated from the change on thread 2).
After the swap, the logged output shows that this has been changed to  
an instance of subentity 2... then it is the subsequent save that fails.


So far all the things I have traced look right - the MOC instances for  
the two threads, the same instances in the  
NSManagedObjectContextDidSaveNotification, the right (opposite)  
instances being sent the mergeChangesFromContextDidSaveNotification  
message.   Everything looks consistent - the MOC the original A is in,  
the strict correlation of this MOC to the thread, etc.


At the moment, I'm just not seeing how things can work up the point of  
failure, including the last change being (locally) correct, and then  
somehow the save deems that the relationship I've just checked on an  
object in that moc is suddenly nil.


I'm left wondering whether there's anything more I'm supposed to do to  
get a MOC properly synchronised with a set of changes from another,  
other than by sending it -mergeChangesFromContextDidSaveNotification  
with the changes send in the changed MOC's notification.
I'm about to play with the merge policies on the MOCs to see if I can  
induce a change in behaviour (at least).  At the moment, I have both  
my MOCs set up with NSMergeByPropertyObjectTrumpMergePolicy, which  
seemed reasonable given the description.


-- Luke




On 2009-09-29, at 8:16 AM, cocoa-dev-requ...@lists.apple.com wrote:


On Sep 28, 2009, at 17:20, Luke Evans wrote:

I have an entity (A) that has a to-one relationship with another  
very simple abstract entity (B),  a kind of an enumeration, whose  
mere type represents the value.  As a kind of enumeration value,  
the B entity has a fixed number of concrete subentities, with no  
properties, and the B entity has a single relationship property  
pointing back to A (i.e. this inverse relationship).  The  
relationship from A to B is set as required (non-optional) as I  
want to make sure that any saved A, is defined properly with a  
particular B enumeration value which controls behaviour.


None of that is _probably_ relevant, but it provides a little  
background.


Now, I have some code that changes the value of the 'B enumeration  
value' that A is using.  This does the following:
1. Create a new instance of the B subentity that represents the  
value we want (in the same MOC as A)
2. Delete the old B object that A was pointing to, i.e. [moc  
deleteObject:B];
3. Set A's to-one relationship to point to the new B object (and  
for good measure, set B's inverse relationship - though this should  
be done automagically).

4. Save the moc

4. is where badness happens (failed to save).  The error tells me  
that A's relationship property to B is nil... but just before I do  
the save I log the value of the object referenced by this  
relationship and it's the new 'B' object!
I have no idea what I've done to upset Core Data such that it  
claims a relationship is nil when I save, but the line before the  
[moc save:&err], the relationship shows as re

Re: Timer and RunLoop question

2009-09-29 Thread Mike Abdullah


On 29 Sep 2009, at 22:30, Wim Lewis wrote:

And what about two timers, i.e., what happens, if one of them fires  
while the method associated with the other one is till executing?


It won't be able to fire until control returns to the runloop in  
some way.


Which is why NSTime only guarantees that a timer will not fire before  
the date you set for it. If the thread it's scheduled on is blocked  
then it can potentially fire much later.


___

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

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

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

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


Re: NSTableColumn value binding + keypath over a relationship

2009-09-29 Thread Stamenkovic Florijan

On Sep 29, 2009, at 17:37, Bryan Matteson wrote:

Cannot remove an observer  for the key path  
"group.name" from , most likely because the value  
for the key "group" has changed without an appropriate KVO  
notification being sent. Check the KVO-compliance of the FSNote  
class.


Means exactly what it says. Somewhere you changed the value of a  
group object without using KVC.


So, I am wondering, am I doing something wrong? It seems a  
reasonable thing to do, binding a column's value to the  
"arrangedObjects.relationship.attribute" key path, but maybe that  
is not allowed?


It IS allowed, and the best way to go about it.

I have managed to work around this by binding the column to  
"arrangedObjects.group", and using a custom value transformer. This  
provides me with exactly the functionality I need, but I am still  
wondering about the mechanics, and if I am doing something wrong.


This is probably not correct.

Check your outlineView's delegate methods where you have implemented  
drag and drop. Somewhere along the way you are changing a value  
without using the mutators. If you can't find it, post the relevant  
code (i.e. the all drag-and-drop related code from the outline view)  
and I'll help you spot it.



Bryan, Quincey,

Thanks for your replies. As for the "group.name" vs. "group.title"  
that Quincy mentions, it's a typo in the email, not in the project.


As for messing up / not using KVO properly, I suppose that somehow I  
am not, but I don't see how. I have read most of the CoreData docs and  
have experience with similar technologies (WebObjects), and am fairly  
certain I am not doing anything obviously wrong... Also what is  
interesting is that I can


As for what Bryan mentions, that I am changing an attribute in a non- 
KVO-compliant way, I do not think so. In that sense the message I am  
getting is a bit misleading (also note that it says "...most likely  
because...")...


Bryan, you say that my workaround is "probably not correct". Why? I  
understand it is a long and not the-right-way, but the-right-way does  
not seem to work for me at the moment.


As for the code in the outline view data source, here it is, I am not  
changing the value without using the mutators, but perhaps it is  
relevant:


- (BOOL)outlineView:(NSOutlineView*)outlineView
 acceptDrop:(id )info
   item:(id)proposedParentItem
 childIndex:(NSInteger)proposedChildIndex
{
NSPasteboard* pboard = [info draggingPasteboard];
NSArray* pboardTypes = [pboard types];

// Notes being dragged
if([pboardTypes containsObject:FSNoteIDURIsArrayPBType]){

// the group dragged to
		NSManagedObject* group = [((NSTreeNode*)proposedParentItem)  
representedObject];


// the URIs of Notes being dragged
NSArray* noteURIs = [NSKeyedUnarchiver
			 unarchiveObjectWithData:[pboard  
dataForType:FSNoteIDURIsArrayPBType]];


NSUndoManager* um = [[group managedObjectContext] undoManager];

// relate the notes to the group dragged into
// do it as a single undoable op
[um beginUndoGrouping];
for(NSURL* noteURI in noteURIs){
			// app delegate is the where the managed object URI -> managed  
object reference logic resides

FSNote* note = (FSNote*)[appDelegate 
objectForURI:noteURI];
note.group = group;
}
[um endUndoGrouping];

return YES;
}

// accepting also other drag types (reordering of Groups contained in  
the outline view), code that does that is here

___

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

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

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

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


Re: Suggestions for debugging “EXC_BAD _ACCESS” - followup

2009-09-29 Thread Nick Zitzmann


On Sep 29, 2009, at 4:18 PM, Bob Barnes wrote:

I wanted to follow up my email from last week with some additional  
questions about the leaks instrument and what it is or isn't trying  
to tell me. When running the leaks instrument with NSZombieEnabled  
several lines of the following code are flagged as leaked memory...


When running the leaks instrument with NSZombieEnabled, _everything_  
is flagged as leaked memory, because technically zombies count as  
leaks. To do proper leak checking, you need to turn off zombies.


Nick Zitzmann


___

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

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

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

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


Suggestions for debugging “EXC_BAD_ACCES S” - followup

2009-09-29 Thread Bob Barnes

all,

   I wanted to follow up my email from last week with some additional  
questions about the leaks instrument and what it is or isn't trying to  
tell me. When running the leaks instrument with NSZombieEnabled  
several lines of the following code are flagged as leaked memory...


NSString*filename;
NSString*keyString;
NSString*descriptionFilename;
NSString*description;
NSDictionary*descriptionDictionary;
NSData  *descriptionData;
NSFileHandle*descriptionFile;
const char  *buffer;

filename = [path stringByAppendingPathComponent:file];
buffer = [filename cStringUsingEncoding:NSUTF8StringEncoding];
keyString = [[filename lastPathComponent]  
stringByDeletingPathExtension];
descriptionFilename = [keyString  
stringByAppendingPathExtension:@"desc"];
descriptionFile = [NSFileHandle fileHandleForReadingAtPath:[path  
stringByAppendingPathComponent:descriptionFilename]];

if(descriptionFile != nil) {
descriptionData = [descriptionFile readDataToEndOfFile];
description = [[NSString alloc] initWithData:descriptionData  
encoding:NSUTF8StringEncoding];
descriptionDictionary = [description  
propertyListFromStringsFileFormat];

[descriptionFile closeFile];
[description release];
}

   Nearly every NSString* as well as the NSDictionary*, NSData* and  
NSFileHandle* are flagged as memory leaks despite the fact that the  
only object created with alloc, new or something with 'copy' in it is  
the NSString* description, which I do release. Note that leaks  
identifies it as a leak as well. Am I misinterpreting the leaks output  
or am I still missing something fundamental?


tia,

Bob
___

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

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

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

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


Splitting controller logic

2009-09-29 Thread Chase Meadors

Hi All,

I'm having some conceptual trouble concerning using multiple windows  
with multiple controllers in a project. Where exactly is the line as  
to what a window controller subclass should manage, and what the App  
controller should manage?


Say I have a window with a fair amount of controls and setup required,  
so I create a window controller that manages it. I implement  
awakeFromNib on it to do the setup, and it implements any IBActions  
needed for controls in that particular window.


My app controller contains properties that are needed by every window  
in the app for modification or bindings. It seems to me, to avoid  
mixing windows with other controllers than their own, that I should  
declare an IBOutlet id mainAppController in each of the window  
controllers, and modify/bind to properties in the app controller by  
binding to myController.mainAppController.aProperty.


I'm just trying to get a conceptual check as to whether this is the  
correct approach. Any feedback appreciated!

___

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

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

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

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


Re: Setting BorderThickness moves resize widget?!?

2009-09-29 Thread Quincey Morris

On Sep 29, 2009, at 14:55, Knut Lorenzen wrote:


please take a look at this image:


(Picture shows my App in front of Safari before/after)

I would like to have a Statusbar in my App and I am using

[mainWindow setContentBorderThickness: 16.0 forEdge: NSMinYEdge];

and

[mainWindow setContentBorderThickness:0.0 forEdge: NSMinYEdge];

respectively, in order to switch between both.

It works fine, but the resize widget moves up 2 pixels when setting  
ContentBorderThickness.
Please also note, that the rectangular corner becomes rounded when  
setting ContentBorderThickness and restores to rectangular when  
setting ContentBorderThickness back to 0.


Well, you don't actually ask a question here, so I'll have to make up  
my own:


Q. Should it move away from the rounded corner?
A. Apparently.

Q. Is that a bug?
A. Apparently not.

Q. Do I want it to do that?
A. We can't help you with that one.

___

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

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

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

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


[iPhone] Core Data Application with multiple TableViewControllers

2009-09-29 Thread Paul Archibald

Hey,

I am working on an iPhone app to manage project files which consist of  
names, equipment, and tasks. I want to use Core Data with SQLite as  
the backing store.


Our prototype has a bunch of tableview pages that allow the user to  
create, edit and delete projects and project elements.I have 6  
different tableview controllers, each of which handles a different  
part of the project records.


Modeling my app on the Locations tutorial app, I am thinking that my  
app delegate itself should own the managed object model/context and  
persistent store coordinator, as well as the working object array used  
to populate the various tableviews. This would be slightly different  
from Locations, which has its working array owned by its single  
tableview controller.


It seems to me the data should be globally accessible from any one of  
my tableviews, so each tableview could work on the part of the data it  
is designed for, but I am unsure how to accomplish that. Is it as  
simple as passing the appropriate pointer(s) to each tableview as it  
is loaded, and operating on the project data via that pointer? If so,  
should it just be the pointer to the working array, or the managed  
object context, or both?


If there is a better way to accomplish this, I would be grateful for  
any advice, and especially of any pointers to tutorials or sample code  
that might be helpful. This is my first iPhone app, and my first shot  
at Core Data, so I have a lot to learn.


Thanks,
Paul 
___


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

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

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

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


Setting BorderThickness moves resize widget?!?

2009-09-29 Thread Knut Lorenzen

Dear List,

please take a look at this image:


(Picture shows my App in front of Safari before/after)

I would like to have a Statusbar in my App and I am using

[mainWindow setContentBorderThickness: 16.0 forEdge: NSMinYEdge];

and

[mainWindow setContentBorderThickness:0.0 forEdge: NSMinYEdge];

respectively, in order to switch between both.

It works fine, but the resize widget moves up 2 pixels when setting  
ContentBorderThickness.
Please also note, that the rectangular corner becomes rounded when  
setting ContentBorderThickness and restores to rectangular when  
setting ContentBorderThickness back to 0.


Cheers,

Knut

___
Dipl.-Phys. Knut Lorenzen





___

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

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

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

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


Re: NSTableColumn value binding + keypath over a relationship

2009-09-29 Thread Quincey Morris

On Sep 29, 2009, at 14:18, Stamenkovic Florijan wrote:

A CoreData app. I have a table and one of it's columns' value bound  
to an array controller's "arrangedObjects.group.title". The  
controller contains objects of the Note entity. Note relates to a  
Group (to-one), and the Group entity has a "title" attribute.  
Straightforward. Next to the table I have an outline view containing  
Groups. I have implemented drag and drop so that Notes can be  
dragged from their table to a different group in the outline view.  
However, when I have the above described table column present in the  
table, I get an error after dragging that says:


Cannot remove an observer  for the key path "group.name 
" from , most likely because the value for the key  
"group" has changed without an appropriate KVO notification being  
sent. Check the KVO-compliance of the FSNote class.


I am quite certain that the Note class is KVO compliant for "group",  
since I don't do anything to prevent it being, and it's a CoreData  
entity with @dynamic property generation.


So, I am wondering, am I doing something wrong? It seems a  
reasonable thing to do, binding a column's value to the  
"arrangedObjects.relationship.attribute" key path, but maybe that is  
not allowed?


The error message specifies "group.name", not "group.title". Do you  
maybe have a typo in one of your bindings in IB?


KVO compliance doesn't necessarily come automatically, if you "don't  
do anything to prevent it". In the case of a simple property, yes,  
*if* you update the property through the proper setter, the KVO  
notifications will occur automatically, but it's easy to get into a  
situation where the update doesn't happen when or as you think. It  
only gets more complicated when key paths are involved, instead of  
single keys.


Also, keep in mind that a path like "arrangedObjects.group.title" is a  
fiction. arrangedObjects is an array, and each row of the column is  
bound to a different element of the array. "arrangedObjects" is the  
key path to the array property, "group.title" is the key path to each  
element. The binding is what bridges that difference -- there is more  
going on behind the scenes than just KVC.


(Because of convenience behavior in NSArray, a key path like  
"someArray.somePropertyOfEachArrayElement" will actually return an  
array of property values when accessed via KVC, but that reference is  
not in itself KVO compliant.)



___

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

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

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

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


Re: Timer and RunLoop question

2009-09-29 Thread Wim Lewis


On Sep 29, 2009, at 2:09 PM, Gabriel Zachmann wrote:
I've got an app that handles keyboard input (-keyDown:) and has a  
repeating timer that causes the runloop to call repeatedly a method  
in my app (called timerFireMethod:).


Could it happen that keyDown: and timerFireMethod: are running at  
the same time?


No. A run loop lives in a particular thread (or, I guess, each thread  
has an associated run loop), and it invokes things serially, in its  
thread. There happens to be one "main" run loop that receives all the  
UI events and so on.


This has pluses and minuses, of course: on the one hand, you can't  
take advantage of parallelism as easily; on the other hand, event-loop  
programming is much easier to do correctly than full multithreaded  
programming, since you know that other code will only run in between  
events (or if you recursively invoke the run-loop, as in a modal panel).


And what about two timers, i.e., what happens, if one of them fires  
while the method associated with the other one is till executing?


It won't be able to fire until control returns to the runloop in some  
way.



___

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

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

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

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


NSTableColumn value binding + keypath over a relationship

2009-09-29 Thread Stamenkovic Florijan

Hi all,

I have been experiencing an error in my app that does not make  
sense... Here is the situation:


A CoreData app. I have a table and one of it's columns' value bound to  
an array controller's "arrangedObjects.group.title". The controller  
contains objects of the Note entity. Note relates to a Group (to-one),  
and the Group entity has a "title" attribute. Straightforward. Next to  
the table I have an outline view containing Groups. I have implemented  
drag and drop so that Notes can be dragged from their table to a  
different group in the outline view. However, when I have the above  
described table column present in the table, I get an error after  
dragging that says:


Cannot remove an observer  for the key path  
"group.name" from , most likely because the value for  
the key "group" has changed without an appropriate KVO notification  
being sent. Check the KVO-compliance of the FSNote class.


I am quite certain that the Note class is KVO compliant for "group",  
since I don't do anything to prevent it being, and it's a CoreData  
entity with @dynamic property generation.


So, I am wondering, am I doing something wrong? It seems a reasonable  
thing to do, binding a column's value to the  
"arrangedObjects.relationship.attribute" key path, but maybe that is  
not allowed?


I have managed to work around this by binding the column to  
"arrangedObjects.group", and using a custom value transformer. This  
provides me with exactly the functionality I need, but I am still  
wondering about the mechanics, and if I am doing something wrong.


Thanks in advance,
F
___

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

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

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

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


Timer and RunLoop question

2009-09-29 Thread Gabriel Zachmann
I've got an app that handles keyboard input (-keyDown:) and has a  
repeating timer that causes the runloop to call repeatedly a method in  
my app (called timerFireMethod:).


Could it happen that keyDown: and timerFireMethod: are running at the  
same time?


In other words: does the runloop execute the two methods of my app in  
different threads?

Or is there an easy way to find out?

And what about two timers, i.e., what happens, if one of them fires  
while the method associated with the other one is till executing?



Best regards,
Gabriel.




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

System Configuration framework question re airport

2009-09-29 Thread Bill Cheeseman

Not sure what list to send this to

I've written a Cocoa method using the System Configuration framework  
to detect whether the AirPort card is powered on. I first test for a  
network interface of type kSCNetworkInterfaceTypeIEEE80211 (AirPort).  
Then, if one is present, I get its configuration dictionary and  
extract the value associated with its "PowerEnabled" key. A user is  
reporting that this returns nil. I thought it was illegal for a  
kSCNetworkInterfaceTypeIEEE80211 interface to have a configuration  
dictionary that does NOT contain the "PowerEnabled" key, so i didn't  
test for nil.


Can a kSCNetworkInterfaceTypeIEEE80211 interface configuration  
dictionary lawfully omit a "PowerEnabled" key? Under what  
circumstances? Can anybody point me to documentation?



--

Bill Cheeseman
b...@cheeseman.name

___

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

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

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

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


Re: Can an app query the values in its own Info.plist?

2009-09-29 Thread Ken Ferry
On Sun, Sep 27, 2009 at 10:24 PM, Scott Anguish  wrote:

>
> On Sep 28, 2009, at 1:16 AM, Kyle Sluder wrote:
>
>  On Sun, Sep 27, 2009 at 10:02 PM, Scott Anguish 
>> wrote:
>>
>>> Why do it? It's easy enough to add your own.
>>>
>>
>> It's also easy to add them to Info.plist… it seems like an appropriate
>> place to do so.
>>
>> Perhaps Apple should clarify whether adding custom keys to Info.plist
>> is condoned.
>>
>
> Perhaps. I honestly don't think we have a best-practices position on this.
>
> I guess I'll point you to bugreporter.apple.com, you being a good citizen
> and all. :-)


Not that this is a "guideline", but it does feel a little weird to me to see
certain sorts of information in the Info.plist.  To my mind, it's for
information consumed by processes other than your own.

-Ken

>
___

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

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

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

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


Fast transition between two graphics

2009-09-29 Thread Chilton Webb

Hi,

I have two full screen graphics that I'd like to transition between,  
using a 'push' effect, so that one appears to visually push the other  
off the side of the screen.


The window I actually need to use this for cannot use layer backed  
views, due to a few still open bugs.


So now I'm experimenting with using an overlay window with layer  
backed views, loading the images into the views, showing the window,  
and drawing the animation by then translating the two views at the  
same time. Is this the fastest way to do this?


Thank you!
-Chilton Webb
___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread Jens Alfke


On Sep 29, 2009, at 7:38 AM, Pascal Harris wrote:

I have an application with an NSArray of NSDictionary (with 18 keys)  
which
populates an NSTableView.  I am concerned that my method of  
accessing the
contents of my array are sub-optimal and I'm therefore seeking  
advice from

the experts.


Is your concern based on an actual slowdown? Have you loaded up a big  
data-set and measured the search time? Or do you know your algorithms  
well enough to be able to predict really bad behavior (like O(n^2)  
time) with large data?


If not, I would ignore this optimization until and unless it becomes  
necessary. Modern CPUs are insanely fast.
If so, profile your code to see where the time is going; sometimes the  
results are unintuitive.


Using predicates isn't likely to help any, because they're just a  
higher-level way of doing the same kind of search you'd write by hand,  
only a bit slower because they're interpreted. CoreData can in some  
cases be faster if it can do the search at the underling SQL layer.  
There are other ways you can change your data structures slightly and  
get a speedup, such as keeping your arrays sorted and doing a binary  
search.


—Jens___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread I. Savant

On Sep 29, 2009, at 1:21 PM, Todd Heberlein wrote:

Don't forget, Google yields different results for different people  
based on a variety of factors.


  Good point. My intention, however, is not to instruct on how to use  
Google, but rather to use it in the first place.


--
I.S.




___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread Todd Heberlein
 By the way, a quick google search of, "nspredicateeditor example"  
yields a very helpful first result ...


Don't forget, Google yields different results for different people  
based on a variety of factors.


Todd

___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread I. Savant

On Sep 29, 2009, at 12:53 PM, Oftenwrong Soong wrote:

is Predicate Editor (in IB) related in some way? And if so, what is  
it supposed to do?


  By the way, a quick google search of, "nspredicateeditor example"  
yields a very helpful first result ...


--
I.S.




___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread I. Savant

On Sep 29, 2009, at 12:53 PM, Oftenwrong Soong wrote:

IIUC, what you're saying is that NSPredicate is used as a filter. Is  
that correct?


  Well, it's more of a (unit of a) query. You can create compound  
predicates, etc. to build a more complex query.




If so, is Predicate Editor (in IB) related in some way?


  Well ... yes ... it is an editor control for predicates. :-)


And if so, what is it supposed to do? Honestly I could never  
understand the docs on this particular control. :)



  If you have specific questions, you need to ask those instead of  
"what is it supposed to do"?


  What don't you understand? The Overview section of the  
NSPredicateEditor reference is incredibly clear. The very first  
sentence even tells you what it's a subclass of, which, if you follow  
the link and read *its* overview, will give you even more information.  
Further, the related "Companion Guide" about predicates is highly  
relevant.


  Are you saying you're unsure how to actually use it / set it up? I  
*think* that's covered between it and its superclass's documentation,  
but admittedly I've never read in depth for that specific information.


--
I.S.




___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread Oftenwrong Soong
Hi all,

IIUC, what you're saying is that NSPredicate is used as a filter. Is that 
correct? If so, is Predicate Editor (in IB) related in some way? And if so, 
what is it supposed to do? Honestly I could never understand the docs on this 
particular control. :)

Thanks,
Soong



On Sept 29, 2009 at  7:48:41 AM, I. Savant wrote:

>On Sep 29, 2009, at 10:38 AM, Pascal Harris wrote:
>
>> My current method is to iterate through the array, searching for a match for

>
>  Two points:
>
>1 - The examples are found by searching in XCode's documentation window or the 
>ADC web site.
>
>2 - You can use NSPredicate (without Core Data). Read up on it and craft the 
>appropriate predicate, then (hint: search keywords to follow) filter the array 
>using the predicate.



  
___

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

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

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

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


Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Kyle Sluder
On Sep 29, 2009, at 7:10 AM, "Timothy Reaves" > wrote:


What makes you think you can?  Logically, you shouldn't be  
able.  I'd

imagine selectedObjects is always going to return an index set; it'd
just be empty with no selection.  I did try comparing it to
NSNoSelectionMarker just in case, and that doesn't work.



Perhaps instead of imagining it would be more helpful to read the  
documentation. -[NSObjectController selectedObjects] returns the  
actual objects.


You also don't seem to understand how bindings work. Even if - 
selectedObjects did return an NSIndexPath, it's a KVO-compliant  
property and therefore perfectly suitable for binding to.


--Kyle Sluder



___

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

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

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

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


Re: UIControl touchInside property

2009-09-29 Thread Ricky Sharp

I believe there is some "slop" area for controls in general.

For example, the Edit button in the nav bar in Mail when in a list of  
messages. The initial tap must be within the defined bounds. But when  
tracking off or back in, the bounds used to determine in vs out is  
larger. That property appears to know another the larger area.


Sent from my iPhone

On Sep 29, 2009, at 9:31 AM, Roland King  wrote:

cocoa touch question - I have searched devforums with the usual  
total lack of result.


UIControl has a 'touchInside' readonly property which, according to  
the documentation returns
   A Boolean value that indicates whether a touch is inside the  
bounds of the receiver. (read-only)



but it doesn't really seem to do that. Experiments calling it each  
time I get called on continueTrackingWithTouch:withEvent: shows that  
it stays YES until the touch moves quite some distance from the  
control (like about an inch on the iphone screen). Logging  
touchInside along with a hitTest on the event, the touchInside and  
hitTest are both YES inside the control, the hitTest instantly moves  
to NO as I cross the border but touchInside stays YES for some  
distance, eventually they both become NO. (code and output below).


Should I consider 'touchInside' to be more of a 'user-interface'  
flag which is telling me that a touch has moved far enough from the  
control that standard control behavior says we're now far enough  
away to be considered 'outside' and 'inside' is really an area both  
inside and some distance from the control? I'm fine with that if  
that means my controls will act like the standard controls.


Anyone come across this and had similar thoughts? I'm happy to file  
a documentation radar if I think I understand what's really going on  
here.




-(BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent  
*)event

{
   CGPoint locInView = [ touch locationInView:self ];
   NSLog( @"continue tracking: %d : %d", [ self isTouchInside ],  
[ self hitTest:locInView withEvent:nil ] == self );

   return YES;
}

2009-09-29 22:16:26.525 Buttonz[62084:207] begin tracking: 0 : 1
2009-09-29 22:16:28.754 Buttonz[62084:207] continue tracking: 1 : 1
2009-09-29 22:16:28.887 Buttonz[62084:207] continue tracking: 1 : 1
2009-09-29 22:16:29.188 Buttonz[62084:207] continue tracking: 1 : 1

... move to the edge ...

2009-09-29 22:16:31.126 Buttonz[62084:207] continue tracking: 1 : 0
2009-09-29 22:16:32.697 Buttonz[62084:207] continue tracking: 1 : 0
2009-09-29 22:16:32.763 Buttonz[62084:207] continue tracking: 1 : 0

... keep moving until about 1" away from the edge ...

2009-09-29 22:16:36.254 Buttonz[62084:207] continue tracking: 0 : 0
2009-09-29 22:16:36.272 Buttonz[62084:207] continue tracking: 0 : 0

... finger up ...

2009-09-29 22:16:36.472 Buttonz[62084:207] continue tracking: 0 : 0
2009-09-29 22:16:36.757 Buttonz[62084:207] end tracking: 0

___

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

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

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

This email sent to rsh...@mac.com

___

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

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

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

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


Re: Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread I. Savant

On Sep 29, 2009, at 10:38 AM, Pascal Harris wrote:

My current method is to iterate through the array, searching for a  
match for
a particular key.  I suspect that there may be a faster way - but I  
cannot
find a tutorial (especially since all the example code seems to have  
gone

AWOL in Snow Leopard).



  Two points:

1 - The examples are found by searching in XCode's documentation  
window or the ADC web site.


2 - You can use NSPredicate (without Core Data). Read up on it and  
craft the appropriate predicate, then (hint: search keywords to  
follow) filter the array using the predicate.



At this stage I would rather not use Core Data (even if this is the  
most

optimal method) because I don't yet have a manual for it.


  Core Data has nothing specifically to do with this problem. The  
core technology that makes this easy is a mix of Cocoa Bindings and  
NSPredicate.


--
I.S.


___

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

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

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

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


Efficient searching of an NSArray of NSDictionary

2009-09-29 Thread Pascal Harris
I have an application with an NSArray of NSDictionary (with 18 keys) which
populates an NSTableView.  I am concerned that my method of accessing the
contents of my array are sub-optimal and I'm therefore seeking advice from
the experts.

My current method is to iterate through the array, searching for a match for
a particular key.  I suspect that there may be a faster way - but I cannot
find a tutorial (especially since all the example code seems to have gone
AWOL in Snow Leopard).

This has come to a particular head because I need to implement an
NSSearchField and I would like to be able to search for any instance of a
string in any key of any array entry.

At this stage I would rather not use Core Data (even if this is the most
optimal method) because I don't yet have a manual for it.

Help!  And thanks, in advance.
___

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

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

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

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


UIControl touchInside property

2009-09-29 Thread Roland King
cocoa touch question - I have searched devforums with the usual total  
lack of result.


UIControl has a 'touchInside' readonly property which, according to  
the documentation returns
	A Boolean value that indicates whether a touch is inside the bounds  
of the receiver. (read-only)



but it doesn't really seem to do that. Experiments calling it each  
time I get called on continueTrackingWithTouch:withEvent: shows that  
it stays YES until the touch moves quite some distance from the  
control (like about an inch on the iphone screen). Logging touchInside  
along with a hitTest on the event, the touchInside and hitTest are  
both YES inside the control, the hitTest instantly moves to NO as I  
cross the border but touchInside stays YES for some distance,  
eventually they both become NO. (code and output below).


Should I consider 'touchInside' to be more of a 'user-interface' flag  
which is telling me that a touch has moved far enough from the control  
that standard control behavior says we're now far enough away to be  
considered 'outside' and 'inside' is really an area both inside and  
some distance from the control? I'm fine with that if that means my  
controls will act like the standard controls.


Anyone come across this and had similar thoughts? I'm happy to file a  
documentation radar if I think I understand what's really going on here.




-(BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *) 
event

{
CGPoint locInView = [ touch locationInView:self ];
	NSLog( @"continue tracking: %d : %d", [ self isTouchInside ], [ self  
hitTest:locInView withEvent:nil ] == self );

return YES;
}

2009-09-29 22:16:26.525 Buttonz[62084:207] begin tracking: 0 : 1
2009-09-29 22:16:28.754 Buttonz[62084:207] continue tracking: 1 : 1
2009-09-29 22:16:28.887 Buttonz[62084:207] continue tracking: 1 : 1
2009-09-29 22:16:29.188 Buttonz[62084:207] continue tracking: 1 : 1

... move to the edge ...

2009-09-29 22:16:31.126 Buttonz[62084:207] continue tracking: 1 : 0
2009-09-29 22:16:32.697 Buttonz[62084:207] continue tracking: 1 : 0
2009-09-29 22:16:32.763 Buttonz[62084:207] continue tracking: 1 : 0

... keep moving until about 1" away from the edge ...

2009-09-29 22:16:36.254 Buttonz[62084:207] continue tracking: 0 : 0
2009-09-29 22:16:36.272 Buttonz[62084:207] continue tracking: 0 : 0

... finger up ...

2009-09-29 22:16:36.472 Buttonz[62084:207] continue tracking: 0 : 0
2009-09-29 22:16:36.757 Buttonz[62084:207] end tracking: 0

___

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

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

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

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


Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Timothy Reaves
> On Sep 28, 2009, at 18:11, Kyle Sluder wrote:
>
>> On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves
>>  wrote:
>>> Well, I was hoping to bind buttons enabled property.  If I use a
>>> regular NSArray backed controller this works.  And you can't bind (at
>>> least I don't know how) with selectedObjects.  But you can with
>>> selection, and an NSNotNil value transformer.
>>
>> What makes you think that you can't bind to selectedObjects?
>>
>> Also, have you tried comparing the selection proxy to
>> NSNoSelectionMarker?
>>
>> --Kyle Sluder
>
> I may have missed something earlier in the thread, but the standard
> "canRemove" property amounts (for an array controller) pretty much to
> "is anything selected?" It's not a ridiculous choice for a binding to
> control other button enable states, even though I guess there's a
> semantic difference.
>
> Perhaps there's a valid reason not to conflate the two, but it's just
> a suggestion.
>
> FWIW
>
>

Oohh... good idea.  I didn't know that about canRemove:  Thanks.

___

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

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

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

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


Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Timothy Reaves
> On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves
>  wrote:
>>     Well, I was hoping to bind buttons enabled property.  If I use a
>> regular NSArray backed controller this works.  And you can't bind (at
>> least I don't know how) with selectedObjects.  But you can with
>> selection, and an NSNotNil value transformer.
>
> What makes you think that you can't bind to selectedObjects?
>
> Also, have you tried comparing the selection proxy to NSNoSelectionMarker?
>
> --Kyle Sluder
>
>


 What makes you think you can?  Logically, you shouldn't be able.  I'd
imagine selectedObjects is always going to return an index set; it'd
just be empty with no selection.  I did try comparing it to
NSNoSelectionMarker just in case, and that doesn't work.

___

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

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

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

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


Severeal Views, One Webview in MainMenu.xib

2009-09-29 Thread Philip Juel Borges

Hi!

In my app I have tailored the ViewController app from Apple to fit my  
needs. The MainMenu.xib contains the custom view where my other views  
are swapped in. I have 3 views in all now. All these views contain  
each 1-3 NSTableViews and one WebView. However, instead of having 3  
WebViews I'd like to have just one in MainMenu.xib where all the data  
from the tableviews of my 3 views are displayed.


Is this possible? I hope it's clear what I mean.

--Philip
___

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

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

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

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


Re: Separate WebViews?

2009-09-29 Thread Izidor Jerebic


On 29.9.2009, at 7:16, Jens Alfke wrote:



On Sep 28, 2009, at 1:49 AM, charlie dropbox wrote:

I was looking around for cookie state or some separation of data  
sharing between WebViews.


There's a singleton NSHTTPCookieStorage object that you can use to  
interact with cookie storage. But the design is such that there is  
one single set of cookies shared by all WebViews, and actually by  
all apps that use the NSURLxxx classes or CFNetwork. In short, I  
don't think you can have two WebViews with different login states at  
the same time.


Some websites check for cookies and if they are disabled, they pass  
info via url parameters. You could disable cookies and check if  
website will pass session state via url parameters.



izidor

___

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

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

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

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


Re: Separate WebViews?

2009-09-29 Thread charlie dropbox
Thanks Jens.
It has helped me find the other two articles which will help me with this.

http://stackoverflow.com/questions/364219/how-can-i-have-multiple-instances-of-webkit-without-sharing-cookies
http://lists.apple.com/archives/Webkitsdk-dev/2008/Jan/msg00018.html

charlie


On Mon, Sep 28, 2009 at 11:16 PM, Jens Alfke  wrote:

>
> On Sep 28, 2009, at 1:49 AM, charlie dropbox wrote:
>
>  I was looking around for cookie state or some separation of data sharing
>> between WebViews.
>>
>
> There's a singleton NSHTTPCookieStorage object that you can use to interact
> with cookie storage. But the design is such that there is one single set of
> cookies shared by all WebViews, and actually by all apps that use the
> NSURLxxx classes or CFNetwork. In short, I don't think you can have two
> WebViews with different login states at the same time.
>
> —Jens
___

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

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

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

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