Re: Core Data Multiuser

2012-07-15 Thread Eli Bach2

On Jul 14, 2012, at 5:18 AM, Alexander Spohr wrote:

 
 Am 13.07.2012 um 21:38 schrieb Flavio Donadio:
 
 What do you guys think about it? Is it a bad idea? I've studied a lot of 
 alternatives (BaseTen, ODBC, Web Services), but I can't wrap my head around 
 them...
 
 Use WebObjects and EOF (the big mature brother of CoreData) on the server!
 
 We feed multiple hundred thousand iOS devices daily with it - as does Apple 
 with iTunes and the Store.

Um, what?  Hasn't WebObjects effectively been orphaned [as in, Apple may still 
be using it internally, but they are no longer publicly updating it or 
providing support for it]?

And yes, I agree it was kickass technology that I wish Apple would at least 
sell to somebody else to make a product out of instead just letting it die.

As for the OP's request, might I suggest using the BaseTen framework.  Its an 
open-source PostgreSQL-backed database framework that works like CoreData [it 
even uses the CoreData database layout file to configure PostgreSQL].

Eli


___

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

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

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

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


Re: Binding NSTableView to NSSet

2012-07-15 Thread Willeke
Op 14 jul 2012, om 04:46 heeft Koen van der Drift het volgende geschreven:

 A follow up question: how do I now sort the data in the table? I am showing 
 three values in the table, and like to sort based on either one of them. The 
 original data is in an unordered NSSet (from my CD model). I could create an 
 NSArray in my view controller: NSArray *myArray = [myTagsSet allObjects], and 
 bind that to the NSArrayController, instead of to the NSSet; then I can sort 
 the values in the table based on the array using sortDescriptors as explained 
 here: 
 https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TableView/SortingTableViews/SortingTableViews.html#//apple_ref/doc/uid/1026i-CH10-SW1.
 Would that be a good approach?
 
 Other alternatives?

Can't you just set the sortDescriptors of the array controller?

Willeke



___

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

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

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

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


Re: Core Data Multiuser

2012-07-15 Thread Alexander Spohr

Am 15.07.2012 um 08:12 schrieb Eli Bach2:

 On Jul 14, 2012, at 5:18 AM, Alexander Spohr wrote:
 
 Am 13.07.2012 um 21:38 schrieb Flavio Donadio:
 
 Use WebObjects and EOF (the big mature brother of CoreData) on the server!
 
 We feed multiple hundred thousand iOS devices daily with it - as does Apple 
 with iTunes and the Store.
 
 Um, what?  Apple may still be using it internally, but they are no longer 
 publicly updating it or providing support for it?


Support is here:
http://www.wocommunity.org/

We started our current project a year ago. WebObjects still does fine with 
heavy workloads.

atze


___

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

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

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

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


Sandbox Unit Testing

2012-07-15 Thread Rainer Standke
Hello,

I have an app that is sandboxed that I want to perform some unit testing with. 
When I run the test, I get something like:

no suitable image found... open() failed with errno=1 IDEBundleInjection.c: 
Error loading bundle '

When I turn off Entitlements in the application target's Summary then the test 
performs as expected.

Is there some magic sauce I can add to this, so that I can run the unit tests 
while sandboxed?

Thanks for any hints,

Rainer
___

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

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

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

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


Re: Core Data book for OSX

2012-07-15 Thread Chuck Soper
Koen,

CoreData for iOS and Mac are mostly the same, but the biggest difference
is that iOS doesn't support bindings. Bindings are important and for that
reason I don't think that an iOS Core Data book would be sufficient for
you. 


I recommend Cocoa Programming: A Quick-Start Guide for Developers by
Daniel H Steinberg. The book is aimed at experienced programmers who are
new to Cocoa. It only supports Xcode 3, but I don't think that's a
problem. Specifically, I would read chapters 19-Key Value Coding, 20-Key
Value Observing, 21-Cocoa Bindings and 22-Core Data. Supplement this with
reading Apple documentation which is referred to in the book.

 http://pragprog.com/book/dscpq/cocoa-programming

The Pragmatic web site says that it's out of print, but I found it on
Amazon:
 http://www.amazon.com/Cocoa-Programming-Quick-Start-Developers-Programmers
/dp/1934356301/



Also, stackoverflow.com can be a good resource:
http://stackoverflow.com/questions/tagged/core-data

And I've found Tim Isted's blog to be useful. I was just reviewing this
post on Multiple Windows with Core Data. It's from July, 2008 so parts of
it may be out of date.
http://www.timisted.net/blog/archive/multiple-windows-with-core-data/

Chuck


On 7/14/12 5:06 AM, Koen van der Drift koenvanderdr...@gmail.com wrote:

I really want to learn more about CoreData on the Mac and am looking to
get a book, besides the Apple docs.  I already get the basics, but there
are still many things that make me scratch my head.

Often recommended is the book by Marcus Zarra, but this is out of print,
and I wouldn't be surprised if they are working on an update, but no idea
when that's going to be on the market. Is it still relevant, or already
outdated when using (M)Lion?  I can find a copy through Abebooks if
needed.

Or am I better off getting a more recent book about CoreData for iOS
(there are several on the market, e.g. Imsted  Harrington)? I would
guess that in the core (no pun) it is the same for OSX and iOS, so I may
go that route.  Or is a book about CoreData on iOS completely useless
when developing for OSX?

Thanks for any input,

- Koen.



___

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

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

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/chucks%40veladg.com

This email sent to chu...@veladg.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


CA crossfade

2012-07-15 Thread Fritz Anderson
10.7 SDK, 10.7 target. The content view of the window is layer-hosting, 
containing only a CALayer.

I'm trying to crossfade the contents image of the CALayer from Image A (the 
existing contents) to Image B (the new contents). Surely this is simple. I'm 
thrashing.

Here is an excerpt from my controller object's set-image method. I've seen the 
following code (more or less) in responses on the Web, and it has always met 
with apparent satisfaction, but it does not work as I intend: Image A is 
instantly replaced by Image B, then the crossfade from A to B runs. Image B 
remains.

=
//  Initialize nsImage with the new contents.
CABasicAnimation *  crossfade;
crossfade = [CABasicAnimation animationWithKeyPath: @contents];

crossfade.duration = 0.75;
crossfade.removedOnCompletion = YES;
crossfade.fromValue = self.backgroundLayer.contents;
crossfade.toValue = nsImage;
[self.backgroundLayer addAnimation: crossfade forKey: nil];

self.backgroundLayer.contents = nsImage;
=

Commenting-out the assignments to .fromValue and .toValue yields the same 
effect.

Okay, try this: add

crossfade.delegate = self;

before the addAnimation:, and delete

self.backgroundLayer.contents = nsImage;

Add the delegate method:

- (void) animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
NSImage *   newImage = [(CABasicAnimation *)anim toValue];
self.backgroundLayer.contents = newImage;
}

Printing the nsImage pointer in the set-image method and newImage in the 
animationDidStop: method shows that the two pointers are equal.

In this case, the animation runs from Image A to Image B, then jumps to Image 
A, then jumps to Image B.

In all cases, self.backgroundLayer.actions is nil.

I'm thrashing at a task that ought to be simple and obvious. What am I missing?

— 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: CA crossfade

2012-07-15 Thread Fritz Anderson
I'm an adventurer, so I tried this:

===
self.backgroundLayer.contents = nsImage;

CABasicAnimation *  crossfade;
crossfade = [CABasicAnimation animationWithKeyPath: @contents];
crossfade.duration = 2.0;
crossfade.removedOnCompletion = YES;
[self.backgroundLayer addAnimation: crossfade forKey: nil];
===

This works as I expect: The contents of the layer transition smoothly, without 
flicker.

— F


On 15 Jul 2012, at 4:08 PM, Fritz Anderson wrote:

 10.7 SDK, 10.7 target. The content view of the window is layer-hosting, 
 containing only a CALayer.
 
 I'm trying to crossfade the contents image of the CALayer from Image A (the 
 existing contents) to Image B (the new contents). Surely this is simple. I'm 
 thrashing.
 
 Here is an excerpt from my controller object's set-image method. I've seen 
 the following code (more or less) in responses on the Web, and it has always 
 met with apparent satisfaction, but it does not work as I intend: Image A is 
 instantly replaced by Image B, then the crossfade from A to B runs. Image B 
 remains.
 
 =
 //  Initialize nsImage with the new contents.
 CABasicAnimation *crossfade;
 crossfade = [CABasicAnimation animationWithKeyPath: @contents];
 
 crossfade.duration = 0.75;
 crossfade.removedOnCompletion = YES;
 crossfade.fromValue = self.backgroundLayer.contents;
 crossfade.toValue = nsImage;
 [self.backgroundLayer addAnimation: crossfade forKey: nil];
 
 self.backgroundLayer.contents = nsImage;
 =
 
 Commenting-out the assignments to .fromValue and .toValue yields the same 
 effect.
 
 Okay, try this: add
 
 crossfade.delegate = self;
 
 before the addAnimation:, and delete
 
 self.backgroundLayer.contents = nsImage;
 
 Add the delegate method:
 
 - (void) animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
 {
NSImage *   newImage = [(CABasicAnimation *)anim toValue];
self.backgroundLayer.contents = newImage;
 }
 
 Printing the nsImage pointer in the set-image method and newImage in the 
 animationDidStop: method shows that the two pointers are equal.
 
 In this case, the animation runs from Image A to Image B, then jumps to Image 
 A, then jumps to Image B.
 
 In all cases, self.backgroundLayer.actions is nil.
 
 I'm thrashing at a task that ought to be simple and obvious. What am I 
 missing?
 
   — 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:
 https://lists.apple.com/mailman/options/cocoa-dev/fritza%40manoverboard.org
 
 This email sent to fri...@manoverboard.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
Hi,

I have a subclass of NSAttachmentCell which draws itself into an NSTextView. 
Its y-location is wrong though when drawing the cell using 

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView 
characterIndex:(NSUInteger)charIndex layoutManager: (NSLayoutManager 
*)layoutManager

How do I determine the correct origin for cellFrame to ensure that the baseline 
of the text inside the NSTextView matches that of the text inside the cell to 
be drawn in the textview? In above call I use 

[self.displayWord drawInRect:cellFrame withAttributes:stringAttributes];

to draw the string which in turn uses boundingRectWithSize to figure out the 
NSRect dimensions to accommodate the string?

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
I think I found it in, at least it looks correct:

CGFloat gb = [[NSTypesetter sharedSystemTypesetter] 
baselineOffsetInLayoutManager:[(NSTextView *)controlView layoutManager] 
glyphIndex:charIndex];

NSRect useFrame = cellFrame;
useFrame.origin.y += gb;

Thanks
  

Am 15.07.2012 um 23:40 schrieb Alexander Reichstadt:

 Hi,
 
 I have a subclass of NSAttachmentCell which draws itself into an NSTextView. 
 Its y-location is wrong though when drawing the cell using 
 
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView 
 characterIndex:(NSUInteger)charIndex layoutManager: (NSLayoutManager 
 *)layoutManager
 
 How do I determine the correct origin for cellFrame to ensure that the 
 baseline of the text inside the NSTextView matches that of the text inside 
 the cell to be drawn in the textview? In above call I use 
 
 [self.displayWord drawInRect:cellFrame withAttributes:stringAttributes];
 
 to draw the string which in turn uses boundingRectWithSize to figure out the 
 NSRect dimensions to accommodate the string?
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/lxr%40mac.com
 
 This email sent to l...@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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


+bundleForClass: category question

2012-07-15 Thread Graham Cox


If I create a category on a standard framework class as part of another 
framework, and I use +[NSBundle bundleForClass:] to load an image resource for 
use by that category, does that work, i.e. does it load the bundle of the 
framework containing the category, or the bundle containing the original class 
being extended?


--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Cocoa-dev Digest, Vol 9, Issue 488

2012-07-15 Thread Flavio Donadio
On Jul 14, 2012, at 4:00 PM, Alexander Spohr wrote:

 Am 15.07.2012 um 08:12 schrieb Eli Bach2:
 
 On Jul 14, 2012, at 5:18 AM, Alexander Spohr wrote:
 
 Use WebObjects and EOF (the big mature brother of CoreData) on the server!
 
 Um, what?  Apple may still be using it internally, but they are no longer 
 publicly updating it or providing support for it?
 
 Support is here:
 http://www.wocommunity.org

Yeah, I know about the new Eclipse-based tools provided by WOCommunity, but I 
don't know jack about Java and, at this moment, I don't really want to learn 
about Java's particularities...

I could create a web service using WO and then a Cocoa client, maybe using Core 
Data's NSIncrementalStore, which seems a perfect fit for the task.

About BaseTen: I was really impressed with it. But I haven't seen any progress 
on the project page for a long time. I can build it for Lion 64-bit, but I feel 
insecure about the project's future.


Best regards,

Flavio Donadio
---
Codeprint - Soluções em identificação e captura de dados
E-mail: fdona...@codeprint.com.br.
Tel.: (11) 2119-3006

Enviado de meu iPhone

___

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

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

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

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

Re: +bundleForClass: category question

2012-07-15 Thread David Duncan
On Jul 15, 2012, at 7:30 PM, Graham Cox graham@bigpond.com wrote:

 If I create a category on a standard framework class as part of another 
 framework, and I use +[NSBundle bundleForClass:] to load an image resource 
 for use by that category, does that work, i.e. does it load the bundle of the 
 framework containing the category, or the bundle containing the original 
 class being extended?


The category is a method on the class you specify, therefore [self class] will 
be that class (whatever it is) and you will get the bundle for that class. In 
this case, it means your bundle will be the framework bundle.
--
David Duncan


___

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

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

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

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


Re: +bundleForClass: category question

2012-07-15 Thread Graham Cox

On 16/07/2012, at 1:29 PM, David Duncan wrote:

 In this case, it means your bundle will be the framework bundle.


Just to be clear, you mean the bundle for the *original* framework (AppKit, 
say) and not my framework which contains the category?

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: +bundleForClass: category question

2012-07-15 Thread David Duncan
On Jul 15, 2012, at 9:07 PM, Graham Cox graham@bigpond.com wrote:

 
 On 16/07/2012, at 1:29 PM, David Duncan wrote:
 
 In this case, it means your bundle will be the framework bundle.
 
 Just to be clear, you mean the bundle for the *original* framework (AppKit, 
 say) and not my framework which contains the category?

Yup.
--
David Duncan


___

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

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

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

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