Re: NSTextView redraw while resigning first responder

2010-08-07 Thread vincent habchi
Thanks again Kyle.
Vincent

PS: Since NSText is a superclass of NSTextView, it would not break 
compatibility to change the return type to NSTextView anyhow, no? Unless some 
method is overriden...___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTextView redraw while resigning first responder

2010-08-07 Thread Kyle Sluder
On Sat, Aug 7, 2010 at 10:15 PM, vincent habchi  wrote:
> By the way, can anybody explain me why the call [window fieldEditor: 
> forObject:] returns a NSText *, while the documentation explicitly states it 
> returns a NSTextView * (so I had to cast it to get access to the 
> -layoutManager method)?

According to one old-timer, it's an artifact from when NSText used to
be the only public class in the text system, probably left over for
source compatibility.

--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: NSTextView redraw while resigning first responder

2010-08-07 Thread vincent habchi
Le 7 août 2010 à 22:35, Kyle Sluder a écrit :

> Please describe your text system setup. Is it possible your custom glyph 
> generator is only being used for the field editor, not for the text field's 
> layout manager?

Of course Kyle, you're a genius! I wonder what this list would be without your 
ongoing support. The code was this:

glyphChanger = [[GlyphChanger alloc] init];
[[(NSTextView *)[myWindow fieldEditor:YES forObject:nil] layoutManager] 
setGlyphGenerator:glyphChanger];

so no wonder it went away when the text field resigned first responder status.

By the way, can anybody explain me why the call [window fieldEditor: 
forObject:] returns a NSText *, while the documentation explicitly states it 
returns a NSTextView * (so I had to cast it to get access to the -layoutManager 
method)?

Thanks again,
Vincent___

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

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

2010-08-07 Thread vincent habchi
Aki,

> No, it doesn't chunk based on word boundary. 
> It could callback in chunks in order to prevent allocating too large buffer, 
> though. 
> 
> So, you should be prepare to insert whatever requested. 

In fact, you're (of course) right. What I see is that it does cut as long as I 
keep typing in the field. But, when the field looses and regains first 
responder status, all the text is sent at once.

Since I have to identify keywords in a flow of chars, I do the surgery (or 
butcher ;)) operation myself in my custom 
-(void)generateGlyphsForGlyphStorage:… method, generating multiple calls (one 
for each chunk) to the shared instance NSGlyphGenerator 
-(void)generateGlyphsForGlyphStorage:…, and I analyse the return product.

Yet, I assume that – more or less in accordance to what the documentation says 
–, the shared instance glyph generator does a basic one to one translation 
between unicode and glyph, so that the length parameter in the callback 
-(void)insertGlyphs: length: is valid not only for the glyph buffer, but also 
for the original string. Is that hypothesis correct?

Thanks a lot (and thanks also for the very informative talk you gave, without 
which I surely wouldn't have been able to figure out all this)!

Vincent___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Scroller With CATiledLayer Running out of Memory

2010-08-07 Thread Kyle Sluder
On Sat, Aug 7, 2010 at 8:19 PM, David Duncan  wrote:
> The simplest method would likely be to take the same approach that 
> UITableView takes. Create a subclass of UIScrollView that lays out some small 
> number of views that you render parts of your text into. This is very similar 
> to what ScrollViewSuite does.

I think it might be important to point out that layers with no content
have no backing store. So if you take the UITableView approach, you
don't have to worry about your view's layer being the appropriate
height as long as it has no content of its own. No reimplementation of
UIScrollView needed.

--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: Scroller With CATiledLayer Running out of Memory

2010-08-07 Thread David Duncan
On Aug 7, 2010, at 11:51 AM, Gordon Apple wrote:

> So, are you saying that the backing layer will always be the size of the
> view?  Or that there there will always be enough tiles to cover the view?

A CALayer keeps a single backing store. By default the backing store created 
when -display is called is the size of the layer in pixels (bounds.size * 
contentsScale). A CATiledLayer's backing store is rather more complex, and only 
stores enough tiles to cover the area currently visible plus some recently used 
tiles.

> If that is the case, then it sounds like what you are advocating is to
> create my own scroller or somehow tie the scroller to another (overlaid)
> view with a fixed frame but scrollable bounds, so that it only creates tiles
> (or a single CALayer) needed to display within its frame?


The simplest method would likely be to take the same approach that UITableView 
takes. Create a subclass of UIScrollView that lays out some small number of 
views that you render parts of your text into. This is very similar to what 
ScrollViewSuite does.

I think to some degree you may need to take a step back and think carefully 
about what you are trying to accomplish and what your bottlenecks really are, 
because I think part of your issue may be due to assumptions about where your 
bottlenecks are.
--
David Duncan

___

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

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

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

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


Re: Hiding Document Files from iTunes

2010-08-07 Thread David Duncan
On Aug 7, 2010, at 12:26 PM, Gordon Apple wrote:

> I want iTunes inport/export file sharing.  However, I have a number of
> internal document files and folders which I do not want shared or visible in
> iTunes, because they can be accessed and (accidentally) deleted by the user.
> I've tried hiding the files and folders, to no avail -- they still show up
> in iTunes.  Is there any way to prevent this?


http://developer.apple.com/iphone/library/qa/qa2010/qa1699.html
--
David Duncan

___

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

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

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

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


Re: How to implement lazy loading with a proxied array

2010-08-07 Thread Ken Thomases
On Aug 7, 2010, at 12:04 PM, Kyle Sluder wrote:

> On Aug 7, 2010, at 9:42 AM, Dave DeLong  wrote:
> 
>> Let's say that I have an object that encapsulates a Google search.  I feed 
>> this object my query string, set some options, and then execute it.  
>> Ideally, I'd like to get back an NSArray of all the results, but 1) that 
>> isn't practical and 2) the Google API doesn't support that.
>> 
>> So what if I use an NSProxy?  Can I return an NSProxy in place of the array 
>> that knows how many total results there are, and then as the user asks for 
>> more and more results, it just silently executes "paged" searches to get the 
>> next batch?
> 
> This sounds like a bad idea. It might work, but it will introduce 
> hard-to-follow network access. What if someone asks the array for 
> -lastObject? Or -reverseObjectEnumerator?
> 
> Since I guarantee at some point clients of your searching logic are going to 
> need to be aware of the nature of Google API searching (in other words, your 
> abstraction will leak), it would be best to expose on your Google-searching 
> controller object specific API for paging through results. It might be as 
> simple as a -loadMore method and a resultsSoFar NSArray property.

Agreed, but also:

Even for the original vision, you don't want a proxy object.  You would have 
just wanted a custom array class.  What would the proxy have been a proxy for?

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


Re: Extra menu item in a bound NSPopUpButton menu

2010-08-07 Thread Jerry Krinock

On 2010 Aug 07, at 14:39, John Ackert wrote:

> I have an NSPopUpButton bound to an NSArrayController which manages the 
> content of the NSPopUpButton menu. Now I want some extra menu items at the 
> end of the dynamic content separated by a separator menu item. 
> What is the best way to do this?

Cocoa Bindings are great code-savers for some things, but not for menus.  I 
would recommend that you forget about bindings, delete the array controller, 
and populate the menu in code.  My recommendation is strengthened by the fact 
that you have "dynamic content" (see -menuNeedsUpdate), and also that no one 
has come up with a way to put a separator menu item into an array controller in 
the five hours since you posted your message.  I suspect that if this was 
possible, it wouldn't be any fun.

___

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

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

2010-08-07 Thread Douglas Davidson
My recommendation would be that anyone who has needs of this sort should file a 
bug giving details of the particular needs you have for your application.

Douglas Davidson

___

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

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

2010-08-07 Thread Ben Trumbull
> Sorry.  I see I've created confusion by putting "Multiuser" in the subject.  
> I should have said "Multiprocess"

yeah.

>> Yes, several Apple frameworks use Core Data databases from multiple 
>> processes simultaneously with a single user account and single physical 
>> machine.
> 
> Later, a reference is made to the iCal, Mail and Address Book apps. 
> 
> That's what I'm interested in.  Specifically, an app + a background process, 
> same Mac, same user, sharing a non-document sqlite file.  So it appears that 
> all should work, presumably as described in the "Change Management" section 
> of "Core Data Programming Guide".

yes, that works out of the box.

> One thing still bothers me.  Twice in that document, it mentions "managed 
> object contexts in the *same application*".  What if they are in *different 
> processes*?  Possibly the author just wasn't thinking of that?

On the same physical machine and local file system, the behavior between MOCs 
in the same process but with different PSCs and MOCs in different processes is 
effectively the same.

> I've done some more testing since my original post and it appear does appear 
> to work ˆ the errors I was seeing yesterday were "Could not merge changes" 
> errors (133020 in NSCocoaErrorDomain), and I presume these were due to the 
> fact that I had not set a merge policy on these managed object contexts.  

yes.  That's correct.

> But I have yet to reproduce and prove this.  Any additional assurance that 
> what I'm doing should work would be appreciated.

There are a few things to be mindful of:

(1) creating the db originally requires additional coordination (like your own 
NSDistributedLock).  Basically, there can be a race condition between the 2 
processes creating the file.  After creating the db, you'll want to save 
immediately to force the schema and UUID to get persisted so other processes 
see the same one at that path

(2) store metadata does not have optimistic concurrency control like the 
managed objects do (e.g. no version tracking).  you'll want to minimize any 
custom metadata, and perhaps store it in an entity with a single row.

(3) you may want to refresh data more aggressively.  If so, you should NEVER 
use -refreshObject:mergeChanges:NO on objects that are -isInserted, -isUpdated, 
or -isDeleted.  You should use -refreshObject:mergeChanges:YES on any dirty 
managed objects.

Depending on how much data you want merged into the other process, you may wish 
to send a little IPC or NSDistributedNotification with bread crumbs to only 
refresh the changed objects of importance.  It's a common mistake to post a 
generic notification to the other process that says "world changed; have fun".

(4) As with multi-threading, deleting data out from underneath the other MOCs 
can create challenges (faults that throw because the requested data has been 
nuked into oblivion).  You'll probably want to use prefetching and 
setReturnsObjectsAsFaults:NO more than usual as well as this method added in 
10.6 instead of -objectWithID:

/* returns the object for the specified ID if it is already registered in the 
context, or faults the object into the context.  It might perform I/O if the 
data is uncached.  If the object cannot be fetched, or does not exist, or 
cannot be faulted, it returns nil.  Unlike -objectWithID: it never returns a 
fault.  */
- (NSManagedObject*)existingObjectWithID:(NSManagedObjectID*)objectID 
error:(NSError**)error __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);


- 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: settings computer name, host name, & local host name

2010-08-07 Thread Jeremy Matthews
Stephen,

Thanks - I had just dipped into the framework to get info, but the SCPrefs are 
definitely a little more work..funny thing about NSHot is that most the methods 
are deprecatedbummer.

-j

On Aug 6, 2010, at 10:52 PM, Stephen J. Butler wrote:

> On Fri, Aug 6, 2010 at 4:22 PM, Jeremy Matthews  
> wrote:
>> So, I know there are a number of ways to GET computer name, local host name, 
>> and host name (this one only by scutil??) - is there a method folks out 
>> there are using to SET each of these?
>> Other than NSTask and scutil???
> 
> Not Cocoa, but I'll answer this anyway. The 'sc' in 'scutil' stands
> for SystemConfiguration, and there's a whole framework for that:
> 
> 
> 
> In your case, you want SCPreferencesSetComputerName() and
> SCPreferencesSetLocalHostName(). I think there's also something in
> there for setting the hostname in SCNetwork.
> 
> 

___

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

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


Disregard: Dynamic loading .. wrong list.

2010-08-07 Thread jonat...@mugginsoft.com
Sorry

Wrong list.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.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


Dynamic loading of a third party .dylib

2010-08-07 Thread jonat...@mugginsoft.com
My Cocoa app would very much like to link to a third party dylib.

The dylib is created using an external make file and I don't really want to 
start modifying the build script to change the deployment INSTALL_PATH.

I know that I can wield install_name_tool in a build phase but I thought about 
using dlopen().
I know where my dylib is in my bundle so I can target it okay.

1. In Xcode I link to my dylib and mark it as weak.
2. In my app I call dlopen() before accessing any of the library symbols.

But the symbol doesn't get resolved.

The crash log reports:

Dyld Error Message:
  can't resolve symbol _G__main in /Nuzzle/And/Scratch/MacOS/Contents/boo 
because dependent dylib #5 could not be loaded

Do I have to manually call dlsym() or am I missing a weak attribute somewhere.

Or am I just lost in the weeds.

some code:

NSString *dylibPath = [path 
stringByAppendingPathComponent:@"lib/libCint.dylib"];
const char *libPath = [dylibPath 
cStringUsingEncoding:NSUTF8StringEncoding];
void *dl = dlopen(libPath, RTLD_NOW);
const char *dlErr = dlerror();
if (dlErr) {
NSLog(@"dlerror() =  %s", dlErr);
} else {
NSLog(@"dylib path is %s, dl = %p", libPath, dl);
}
G__main(0, NULL);   // in libCint.dylib

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.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: CGImage / UIImage non destructive scaling possible

2010-08-07 Thread Quincey Morris
On Aug 7, 2010, at 15:13, Philip Mobley wrote:

> Reading up on the docs for both CGImage and UIImage, I see that there is a 
> scale property, but there doesn't appear to be any way to modify the scale 
> factor of an CGImage without resampling (and therefore changing the pixels).
> 
> Below is a comment from the UIImage.scale (property) read-only, and if I want 
> to modify the scale of an open CGImage is to save it to disk, and reopen it 
> using the scale factor tag as described below... is this the only way?

How about +imageWithCGImage:scale:orientation:?

I don't see anything in the documentation about CGImages having a scale -- the 
scale is in the UIImage.


___

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

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


CGImage / UIImage non destructive scaling possible

2010-08-07 Thread Philip Mobley
Reading up on the docs for both CGImage and UIImage, I see that there is a 
scale property, but there doesn't appear to be any way to modify the scale 
factor of an CGImage without resampling (and therefore changing the pixels).

Below is a comment from the UIImage.scale (property) read-only, and if I want 
to modify the scale of an open CGImage is to save it to disk, and reopen it 
using the scale factor tag as described below... is this the only way?

iPhone 4.0 Library notes from UIImage.scale:

> "If you load an image from a file whose name includes the @2x modifier, the 
> scale is set to 2.0. If the filename does not include the modifier but is in 
> the PNG or JPEG format and has an associated DPI value, a corresponding scale 
> factor is computed and reflected in this property. You can also specify an 
> explicit scale factor when initializing an image from a Core Graphics image. 
> All other images are assumed to have a scale factor of 1.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


Extra menu item in a bound NSPopUpButton menu

2010-08-07 Thread John Ackert
Hi,

I have an NSPopUpButton bound to an NSArrayController which manages the content 
of the NSPopUpButton menu. Now I want some extra menu items at the end of the 
dynamic content separated by a separator menu item. 
What is the best way to do this?

Thank you,
John___

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

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

2010-08-07 Thread Aki Inoue
No, it doesn't chunk based on word boundary. 

It could callback in chunks in order to prevent allocating too large buffer, 
though. 

So, you should be prepare to insert whatever requested. 

Aki From iPhone


On 2010/08/07, at 9:14, vincent habchi  wrote:

> Hi there,
> 
> There is little documentation available on the working of NSGlyphGenerator 
> (or concrete subclasses thereof). If there is any guru lurking around, I'd 
> like to know if it is expected that, upon sending a string for glyph 
> generation through
> -(void)generateGlyphsForGlyphStorage: desiredNumberOfCharacters: glyphIndex: 
> characterIndex:, the callback (-(void)insertGlyphs: length: 
> forStartingGlyphAtIndex: characterIndex:) gets invoked more than once with 
> chunks of the original string corresponding to words or spaces (that is to 
> say, the shared NSGlyphGenerator splits the string into words and spaces)?
> 
> Actually, that's more than fine for my purpose, but, precisely, it seems even 
> too fine to be true, so I'm a bit cautious! :)
> 
> Thanks!
> Vincent___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com
> 
> This email sent to a...@apple.com
___

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

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

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

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


Re: Core Data : Multiuser ?

2010-08-07 Thread Brad Gibbs
It's Session 117 - Building a Server-Driven User Experience.  About half-way 
through they move to a discussion involving Core Data.  It's clear that at 
least some people at Apple have spent some time thinking about this.



On Aug 7, 2010, at 8:53 AM, Hunter Hillegas wrote:

> Which session are we talking about? I'd like to go watch that video and I 
> don't recall seeing it.
> 
> As for the second bit, I'm not so sure... If they had wanted to port EOF they 
> would have just ported EOF. Of course, I could be wrong but I'm not holding 
> my breath for robust, multi-user Core Data.
> 
> Hunter
> 
> On Aug 7, 2010, at 8:43 AM, Brad Gibbs wrote:
> 
>> Also, I attended a session at WWDC this year that describes extending Core 
>> Data for use in a multi-user environment. I'd have to watch the video again 
>> to get the specifics, but, I think the gist of it was to keep a local copy 
>> of the data and sync with the server.
>> 
>> I hope rampant speculation about an unannounced OS doesn't run afoul of any 
>> NDAs, but, I've got to believe that Apple is working on extending Core Data 
>> for use in a multi-user environment.  With iPhone, iPad and desktop users 
>> and Apple's recent push into SMB, accessing a central database from each of 
>> these devices via Core Data just makes too much sense.  Maybe it isn't 
>> exactly Core Data and maybe it's some tie-in to FileMaker, but, I've got to 
>> believe it's a priority for them.  It's just too big of a nut to ignore.  
> 

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTextView redraw while resigning first responder

2010-08-07 Thread Kyle Sluder
On Aug 7, 2010, at 1:25 PM, vincent habchi  wrote:

> 
> But, when my NSTextField resigns first responder status, it seems the 
> NSAttributedText is redrawn without going through the normal process (the 
> "standard" layout process chain): the keywords go back to lowercase and I 
> don't see any NSGlyphGenerator call to layout this "inactive" print.

Please describe your text system setup. Is it possible your custom glyph 
generator is only being used for the field editor, not for the text field's 
layout manager?

--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 : Multiuser ?

2010-08-07 Thread Ben Trumbull

On Aug 7, 2010, at 8:43 AM, Brad Gibbs wrote:

> I've been developing an app meant to run strictly on a local network.  I'd 
> like to have the capacity to run 50 clients and a single server (although 
> most installations will have fewer than 20 clients).  My plan has been to 
> have each client maintain its own Core Data database and sync with the Core 
> Data db on the server.  I've been using BLIP to message over TCP.

Yes, that's fine.  The problem is trying to share the db file directly via a 
network file system.  The network file systems are not designed to keep the 
client machine's OS caches coherent in real time.

- Ben

> 
> Communication should work like this:
> 
> 1.  Client sends command to server
> 2.  Server updates its CD db
> 3.  On a didSave notification, server messages changes to all connected 
> clients
> 4.  Connected clients receive the update message and update their db's 
> accordingly
> 5.  If a client is offline for a period of time, when it rejoins the network, 
> it asks the server for a batch update (I haven't decided whether this will 
> request the entire data file as it stands at that moment, or just ask for 
> incremental changes since the client's last save, but I'm leaning towards 
> re-sending the entire db, which is typically smaller than 1 MB)
> 
> In my app, objects are infrequently being created and destroyed.  The changes 
> are primarily just attributes of existing objects being updated.
> 
> I don't believe this runs afoul of the patterns Ben is describing, does it?  
> I'm not sharing the Core Data db, I'm just keeping several Core Data db's in 
> sync by providing methods on the server that each client can call remotely.
> 
> Also, I attended a session at WWDC this year that describes extending Core 
> Data for use in a multi-user environment.  I'd have to watch the video again 
> to get the specifics, but, I think the gist of it was to keep a local copy of 
> the data and sync with the server.
> 
> I hope rampant speculation about an unannounced OS doesn't run afoul of any 
> NDAs, but, I've got to believe that Apple is working on extending Core Data 
> for use in a multi-user environment.  With iPhone, iPad and desktop users and 
> Apple's recent push into SMB, accessing a central database from each of these 
> devices via Core Data just makes too much sense.  Maybe it isn't exactly Core 
> Data and maybe it's some tie-in to FileMaker, but, I've got to believe it's a 
> priority for them.  It's just too big of a nut to ignore.  
> 
> 
> Brad
> 
> 
> 
> On Aug 6, 2010, at 11:38 PM, Ben Trumbull wrote:
> 
>>> Can more than one process be accessing the same Core Data sqlite file?
>>> 
>>> This post from author Marcus Zarra says "no"∑
>>> 
>>> http://forums.pragprog.com/forums/90/topics/1476
>>> 
>>> But this post from Ben Trumbull seems to say "yes", as long as the two 
>>> processes are accessing it via the same filesystem:
>>> 
>>> http://www.cocoabuilder.com/archive/cocoa/184606-core-data-file-sharing-via-an-afp-alias.html
>>> 
>>> Which one am I misunderstanding?
>> 
>> There is a big difference between multiple processes accessing the same Core 
>> Data file and multiple machines.  Multiple processes on the same local 
>> machine work fine.  Several Apple products do this.  Multiple processes 
>> across multiple physical machines will not work well (AFP) or at all (NFS).
>> 
>> So we don't recommend targeting a multi-user configuration.  As I mentioned 
>> in that earlier post, your best bet is probably write the proper service 
>> that uses Core Data, and vends to your client processes via IPC (like a web 
>> service).   The client processes might independently use Core Data for local 
>> caching (replication).
>> 
>> It possible, but inefficient, for a very limited number of clients to share 
>> over AFP.  NFS doesn't work correctly at all.  This is restricted by file 
>> caching issues underneath us.  There are a lot of limitations and sharp 
>> edges here, so we actively recommend against multiple computers 
>> simultaneously accessing the same db.  Support for it is disabled by default 
>> for projects built with a deployment target >= 10.6
>> 
>> - 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/bradgibbs%40mac.com
>> 
>> This email sent to bradgi...@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-a

NSTextView redraw while resigning first responder

2010-08-07 Thread vincent habchi
Hi there again, sorry for being a bit too verbose tonight (it's 10:18 pm here).

Just something strange, or something I misunderstood. I have an NSTextField 
that serves as a semi-assisted SQL editor: it colors keywords and operators, 
and also changes their glyphs on-the-fly to make them look uppercase (albeit 
casing is unaltered in the underlying NSAttributedText).

But, when my NSTextField resigns first responder status, it seems the 
NSAttributedText is redrawn without going through the normal process (the 
"standard" layout process chain): the keywords go back to lowercase and I don't 
see any NSGlyphGenerator call to layout this "inactive" print.

Is that normal?

Thanks, have a great week-end
Vincent___

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

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

2010-08-07 Thread vincent habchi

Le 7 août 2010 à 21:26, Gordon Apple a écrit :

> I want iTunes inport/export file sharing.  However, I have a number of
> internal document files and folders which I do not want shared or visible in
> iTunes, because they can be accessed and (accidentally) deleted by the user.
> I've tried hiding the files and folders, to no avail -- they still show up
> in iTunes.  Is there any way to prevent this?

If I am not mistaken, and I have correctly understood what you meant, you can 
put it in the library/cache folder of the app sandbox. It does not get 
synchronized. 

Vincent___

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

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

2010-08-07 Thread Ben Trumbull
When you add the persistent store to the coordinator, in the store options 
dictionary, use the option NSSQLitePragmasOption (which is a sub dictionary of 
pragma keys & values) to pass the  @"lock_proxy_file" key with a value of 
NSNull.

- Ben

On Aug 7, 2010, at 7:17 AM, Hunter Hillegas wrote:

> Given those limitations, how does one enable support for a 10.6+ target?
> 
> On Aug 6, 2010, at 11:38 PM, Ben Trumbull wrote:
> 
>> It possible, but inefficient, for a very limited number of clients to share 
>> over AFP.  NFS doesn't work correctly at all.  This is restricted by file 
>> caching issues underneath us.  There are a lot of limitations and sharp 
>> edges here, so we actively recommend against multiple computers 
>> simultaneously accessing the same db.  Support for it is disabled by default 
>> for projects built with a deployment target >= 10.6
> 


___

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

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


Hiding Document Files from iTunes

2010-08-07 Thread Gordon Apple
I want iTunes inport/export file sharing.  However, I have a number of
internal document files and folders which I do not want shared or visible in
iTunes, because they can be accessed and (accidentally) deleted by the user.
I've tried hiding the files and folders, to no avail -- they still show up
in iTunes.  Is there any way to prevent this?


___

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

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


rest framework

2010-08-07 Thread Erik Colson
Hi,

I've been looking for a REST framework, which should be usable on iOS and 
MacOSX.
There are several libraries available, but I don't know which one to choose.

Which one would you recommend ?

Thanks

--
Erik Colson___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Scroller With CATiledLayer Running out of Memory

2010-08-07 Thread Gordon Apple
So, are you saying that the backing layer will always be the size of the
view?  Or that there there will always be enough tiles to cover the view?

If that is the case, then it sounds like what you are advocating is to
create my own scroller or somehow tie the scroller to another (overlaid)
view with a fixed frame but scrollable bounds, so that it only creates tiles
(or a single CALayer) needed to display within its frame?


On 8/7/10 12:57 PM, "David Duncan"  wrote:

> On Aug 6, 2010, at 6:07 PM, Gordon Apple wrote:
> 
>> I thought that was what the scroller was supposed to do for you, at least if
>> you actually optimized drawing to use the "rect" in drawRect, which is what
>> I am currently trying to do.
> 
> 
> That's how it works on AppKit in non-layer backed mode. In UIKit and in AppKit
> under layer backed mode however a layer will retain backing store for its
> entire content area (generally bounds.size * contentsScale). You can ask for
> partial draws, but if the content isn't going to change then that may not be
> worth it.
> --
> David Duncan
> 



___

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

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

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

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


Re: Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Rick Mann

On Aug 7, 2010, at 02:44:45, Philippe Devallois wrote:

> 
> On 7 août 2010, at 11:34, Rick Mann wrote:
> 
>> I think you misunderstand (or I do). I don't want to specify a file of a 
>> particular type(s). I want to specify that a *file* is what I accept (as 
>> opposed to the contents of that file).
>> 
>> On Aug 7, 2010, at 02:29:47, Philippe Devallois wrote:
>> 
> 
> Ah ok, you just want "file" dragged types.
> 
> You should use public.data for files and public.directory if you want to 
> handle bundles

Thanks to the docs and Joar, I found that kUTTypeFileURL is what I want. Thanks 
for the link to the list of public types. For some reason, I couldn't find that 
when I looked for it before.

-- 
Rick


___

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

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

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

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


Re: Scroller With CATiledLayer Running out of Memory

2010-08-07 Thread David Duncan
On Aug 6, 2010, at 6:07 PM, Gordon Apple wrote:

> I thought that was what the scroller was supposed to do for you, at least if
> you actually optimized drawing to use the "rect" in drawRect, which is what
> I am currently trying to do.


That's how it works on AppKit in non-layer backed mode. In UIKit and in AppKit 
under layer backed mode however a layer will retain backing store for its 
entire content area (generally bounds.size * contentsScale). You can ask for 
partial draws, but if the content isn't going to change then that may not be 
worth it.
--
David Duncan

___

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

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

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

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


-[NSMoveHelper _doAnimation] hangs

2010-08-07 Thread Marco Cassinerio

Hi,
i've fallen in a weird bug...
In my app i display a sheet window and it hangs in random occasions,  
just after sending - 
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:  
(it never returns from here).


Here's the trace:

#0  0x95af0266 in mach_msg_trap
#1  0x95af7a5c in mach_msg
#2  0x951e6e7e in CFRunLoopRunSpecific
#3  0x951e7aa8 in CFRunLoopRunInMode
#4  0x944e00ce in -[NSMoveHelper _doAnimation]
#5  0x944deb8d in -[NSMoveHelper(NSSheets) _moveParent:andOpenSheet:]
#6  0x944de47c in -[NSWindow(NSSheets) _orderFrontRelativeToWindow:]
#7	0x9433a6d7 in -[NSWindow  
_reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
#8	0x9437c567 in -[NSApplication  
_orderFrontModalWindow:relativeToWindow:]
#9	0x9437bfd1 in -[NSApplication  
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo 
:]


It shouldn't be a logic problem in my code, because passing  
modalForWindow as nil it works.

I'm running OSX 10.5.8.

Any suggestions?

Thanks
Marco

___

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

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

2010-08-07 Thread Brian Postow

On Aug 7, 2010, at 1:31 PM, Kyle Sluder wrote:

> On Aug 7, 2010, at 10:19 AM, Brian Postow  wrote:
> 
>> There doesn't seem to be a separate Interface Builder list, so hopefully 
>> someone here can help:
> 
> Tools questions typically belong on xcode-users, but this looks like it might 
> be a framework bug.
> 
> 
>> 
>> I have a cocoa program that I have I am writing on a 10.6 system, but 
>> targeting to 10.5.
>> 
>> On the 10.6 system, it works fine. However, when I run it on the 10.5 
>> machine, I get:
> 
> What do you mean by "get?" Is this in IB or when your app is running? Is it a 
> console message or an alert?
> 
> If it's a console message in your own code, try breaking on NSLog() and 
> working the backtrace to see who the sender and receiver are.


It's a console message when running. I get it inside the loadNibNamed: 
method... 

the entire message is:

2010-08-07 13:04:52.747 DocKeep[8178:813] The sender of menu item actions is 
now the NSMenuItem, not an NSMatrix.  A menu item action method appears to be 
trying to send the NSMatrix method 'accessibilityIsIgnored' to its sender.  
This is no longer valid.  Please change the code.
2010-08-07 13:04:52.749 DocKeep[8178:813] *** -[NSMenuItem 
accessibilityIsIgnored]: unrecognized selector sent to instance 0x146ac0
2010-08-07 13:04:52.750 DocKeep[8178:813] An uncaught exception was raised
2010-08-07 13:04:52.752 DocKeep[8178:813] *** -[NSMenuItem 
accessibilityIsIgnored]: unrecognized selector sent to instance 0x146ac0
2010-08-07 13:04:52.752 DocKeep[8178:813] *** Terminating app due to uncaught 
exception 'NSInvalidArgumentException', reason: '*** -[NSMenuItem 
accessibilityIsIgnored]: unrecognized selector sent to instance 0x146ac0'
2010-08-07 13:04:52.753 DocKeep[8178:813] Stack: (
2422833131,
2543222331,
2422862314,
2422855660,
2422855858,
2527143518,
2527143358,
2526297164,
2526257082,
2526255388,
2526254431,
2526254237,
50199,
11702,
2526427047,
2526298521,
2526296250,
2526257082,
2526255388,
2526254431,
2526254237,
2526253388,
10576,
10502
)


It appears to be here:

#0  0x90697e94 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1  0x97967e3b in objc_exception_throw
#2  0x9069f1ea in -[NSObject doesNotRecognizeSelector:]
#3  0x9069d7ec in ___forwarding___
#4  0x9069d8b2 in __forwarding_prep_0___
#5  0x96a1265e in NSAccessibilityUnignoredDescendant
#6  0x96a125be in -[NSNibAXAttributeConnector establishConnection]
#7  0x96943c4c in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
#8  0x96939fba in loadNib
#9  0x9693991c in +[NSBundle(NSNibLoading) 
_loadNibFile:nameTable:withZone:ownerBundle:]
#10 0x9693955f in +[NSBundle(NSNibLoading) 
loadNibFile:externalNameTable:withZone:]
#11 0x9693949d in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#12 0xc417 in -[ScanController init] at ScanController.m:444


I don't know if that's helpful at all...


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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

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

2010-08-07 Thread Kyle Sluder
On Aug 7, 2010, at 10:19 AM, Brian Postow  wrote:

> There doesn't seem to be a separate Interface Builder list, so hopefully 
> someone here can help:

Tools questions typically belong on xcode-users, but this looks like it might 
be a framework bug.


> 
> I have a cocoa program that I have I am writing on a 10.6 system, but 
> targeting to 10.5.
> 
> On the 10.6 system, it works fine. However, when I run it on the 10.5 
> machine, I get:

What do you mean by "get?" Is this in IB or when your app is running? Is it a 
console message or an alert?

If it's a console message in your own code, try breaking on NSLog() and working 
the backtrace to see who the sender and receiver are.

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


IB Bug? maybe?

2010-08-07 Thread Brian Postow
There doesn't seem to be a separate Interface Builder list, so hopefully 
someone here can help:

I have a cocoa program that I have I am writing on a 10.6 system, but targeting 
to 10.5.

On the 10.6 system, it works fine. However, when I run it on the 10.5 machine, 
I get:

 The sender of menu item actions is now the NSMenuItem, not an NSMatrix. A menu 
item action method appears to be trying to send the NSMatrix method 
'accessibilityIsIgnored' to its sender. This is no longer valid. Please change 
the code.

I looked this up online and found  that one place implies that I'm calling 
"accessibilityIsIgnored" in my code, which I am not, or that there are multiple 
copies of the InterfaceBuilder library on the system, which there are not.

has anyone else seen this?


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 implement lazy loading with a proxied array

2010-08-07 Thread Kyle Sluder
On Aug 7, 2010, at 9:42 AM, Dave DeLong  wrote:

> Let's say that I have an object that encapsulates a Google search.  I feed 
> this object my query string, set some options, and then execute it.  Ideally, 
> I'd like to get back an NSArray of all the results, but 1) that isn't 
> practical and 2) the Google API doesn't support that.
> 
> So what if I use an NSProxy?  Can I return an NSProxy in place of the array 
> that knows how many total results there are, and then as the user asks for 
> more and more results, it just silently executes "paged" searches to get the 
> next batch?

This sounds like a bad idea. It might work, but it will introduce 
hard-to-follow network access. What if someone asks the array for -lastObject? 
Or -reverseObjectEnumerator?

Since I guarantee at some point clients of your searching logic are going to 
need to be aware of the nature of Google API searching (in other words, your 
abstraction will leak), it would be best to expose on your Google-searching 
controller object specific API for paging through results. It might be as 
simple as a -loadMore method and a resultsSoFar NSArray property.

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


How to implement lazy loading with a proxied array

2010-08-07 Thread Dave DeLong
Hi everyone,

Disclaimer: I have never touched NSProxy before; I've just read some 
documentation.

Let's say that I have an object that encapsulates a Google search.  I feed this 
object my query string, set some options, and then execute it.  Ideally, I'd 
like to get back an NSArray of all the results, but 1) that isn't practical and 
2) the Google API doesn't support that.

So what if I use an NSProxy?  Can I return an NSProxy in place of the array 
that knows how many total results there are, and then as the user asks for more 
and more results, it just silently executes "paged" searches to get the next 
batch?

I'm guessing that the answer to this is "Yes", since I think I've seen stuff 
like that before.  I think I understand that in order to implement this, I'll 
need to subclass NSProxy and override methodSignatureForSelector: and 
forwardInvocation:.  However, here's where my question arises:

There are many different ways of retrieving objects out of an NSArray, namely:
- objectAtIndex:
- countByEnumeratingWithState:objects:count:
- enumerateObjects(AtIndexes...)(UsingBlock...)(WithOptions...)
- filteredArrayUsingPredicate:
- getObjects:range:
- valueForKey:
(to name a few)

Would my array proxy have to satisfy all of these?  This is a proxy that 
(theoretically) I'd be exposing to other developers (since I'm writing a 
framework), so how many cases of object retrieval do I need to cover?

I guess the short version of this question is "where do I begin?"

Thanks,

Dave

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

NSGlyphGenerator behavior

2010-08-07 Thread vincent habchi
Hi there,

There is little documentation available on the working of NSGlyphGenerator (or 
concrete subclasses thereof). If there is any guru lurking around, I'd like to 
know if it is expected that, upon sending a string for glyph generation through
-(void)generateGlyphsForGlyphStorage: desiredNumberOfCharacters: glyphIndex: 
characterIndex:, the callback (-(void)insertGlyphs: length: 
forStartingGlyphAtIndex: characterIndex:) gets invoked more than once with 
chunks of the original string corresponding to words or spaces (that is to say, 
the shared NSGlyphGenerator splits the string into words and spaces)?

Actually, that's more than fine for my purpose, but, precisely, it seems even 
too fine to be true, so I'm a bit cautious! :)

Thanks!
Vincent___

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

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

2010-08-07 Thread Hunter Hillegas
Which session are we talking about? I'd like to go watch that video and I don't 
recall seeing it.

As for the second bit, I'm not so sure... If they had wanted to port EOF they 
would have just ported EOF. Of course, I could be wrong but I'm not holding my 
breath for robust, multi-user Core Data.

Hunter

On Aug 7, 2010, at 8:43 AM, Brad Gibbs wrote:

> Also, I attended a session at WWDC this year that describes extending Core 
> Data for use in a multi-user environment. I'd have to watch the video again 
> to get the specifics, but, I think the gist of it was to keep a local copy of 
> the data and sync with the server.
> 
> I hope rampant speculation about an unannounced OS doesn't run afoul of any 
> NDAs, but, I've got to believe that Apple is working on extending Core Data 
> for use in a multi-user environment.  With iPhone, iPad and desktop users and 
> Apple's recent push into SMB, accessing a central database from each of these 
> devices via Core Data just makes too much sense.  Maybe it isn't exactly Core 
> Data and maybe it's some tie-in to FileMaker, but, I've got to believe it's a 
> priority for them.  It's just too big of a nut to ignore.  

___

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

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

2010-08-07 Thread Brad Gibbs
I've been developing an app meant to run strictly on a local network.  I'd like 
to have the capacity to run 50 clients and a single server (although most 
installations will have fewer than 20 clients).  My plan has been to have each 
client maintain its own Core Data database and sync with the Core Data db on 
the server.  I've been using BLIP to message over TCP.

Communication should work like this:

1.  Client sends command to server
2.  Server updates its CD db
3.  On a didSave notification, server messages changes to all connected clients
4.  Connected clients receive the update message and update their db's 
accordingly
5.  If a client is offline for a period of time, when it rejoins the network, 
it asks the server for a batch update (I haven't decided whether this will 
request the entire data file as it stands at that moment, or just ask for 
incremental changes since the client's last save, but I'm leaning towards 
re-sending the entire db, which is typically smaller than 1 MB)

In my app, objects are infrequently being created and destroyed.  The changes 
are primarily just attributes of existing objects being updated.

I don't believe this runs afoul of the patterns Ben is describing, does it?  
I'm not sharing the Core Data db, I'm just keeping several Core Data db's in 
sync by providing methods on the server that each client can call remotely.

Also, I attended a session at WWDC this year that describes extending Core Data 
for use in a multi-user environment.  I'd have to watch the video again to get 
the specifics, but, I think the gist of it was to keep a local copy of the data 
and sync with the server.

I hope rampant speculation about an unannounced OS doesn't run afoul of any 
NDAs, but, I've got to believe that Apple is working on extending Core Data for 
use in a multi-user environment.  With iPhone, iPad and desktop users and 
Apple's recent push into SMB, accessing a central database from each of these 
devices via Core Data just makes too much sense.  Maybe it isn't exactly Core 
Data and maybe it's some tie-in to FileMaker, but, I've got to believe it's a 
priority for them.  It's just too big of a nut to ignore.  


Brad



On Aug 6, 2010, at 11:38 PM, Ben Trumbull wrote:

>> Can more than one process be accessing the same Core Data sqlite file?
>> 
>> This post from author Marcus Zarra says "no"∑
>> 
>>  http://forums.pragprog.com/forums/90/topics/1476
>> 
>> But this post from Ben Trumbull seems to say "yes", as long as the two 
>> processes are accessing it via the same filesystem:
>> 
>>  
>> http://www.cocoabuilder.com/archive/cocoa/184606-core-data-file-sharing-via-an-afp-alias.html
>> 
>> Which one am I misunderstanding?
> 
> There is a big difference between multiple processes accessing the same Core 
> Data file and multiple machines.  Multiple processes on the same local 
> machine work fine.  Several Apple products do this.  Multiple processes 
> across multiple physical machines will not work well (AFP) or at all (NFS).
> 
> So we don't recommend targeting a multi-user configuration.  As I mentioned 
> in that earlier post, your best bet is probably write the proper service that 
> uses Core Data, and vends to your client processes via IPC (like a web 
> service).   The client processes might independently use Core Data for local 
> caching (replication).
> 
> It possible, but inefficient, for a very limited number of clients to share 
> over AFP.  NFS doesn't work correctly at all.  This is restricted by file 
> caching issues underneath us.  There are a lot of limitations and sharp edges 
> here, so we actively recommend against multiple computers simultaneously 
> accessing the same db.  Support for it is disabled by default for projects 
> built with a deployment target >= 10.6
> 
> - 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/bradgibbs%40mac.com
> 
> This email sent to bradgi...@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: Core Data : Multiprocess (was Multiuser) ?

2010-08-07 Thread Jerry Krinock
Sorry.  I see I've created confusion by putting "Multiuser" in the subject.  I 
should have said "Multiprocess"…

On 2010 Aug 06, at 23:43, Ben Trumbull wrote:

> p.s. 
> 

Thank you, Ben.  In the second post in that thread back in May, Ben wrote:

> Yes, several Apple frameworks use Core Data databases from multiple processes 
> simultaneously with a single user account and single physical machine.

Later, a reference is made to the iCal, Mail and Address Book apps. 

That's what I'm interested in.  Specifically, an app + a background process, 
same Mac, same user, sharing a non-document sqlite file.  So it appears that 
all should work, presumably as described in the "Change Management" section of 
"Core Data Programming Guide".

One thing still bothers me.  Twice in that document, it mentions "managed 
object contexts in the *same application*".  What if they are in *different 
processes*?  Possibly the author just wasn't thinking of that?

I've done some more testing since my original post and it appear does appear to 
work – the errors I was seeing yesterday were "Could not merge changes" errors 
(133020 in NSCocoaErrorDomain), and I presume these were due to the fact that I 
had not set a merge policy on these managed object contexts.  But I have yet to 
reproduce and prove this.  Any additional assurance that what I'm doing should 
work would be 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: Core Data : Multiuser ?

2010-08-07 Thread Hunter Hillegas
Given those limitations, how does one enable support for a 10.6+ target?

On Aug 6, 2010, at 11:38 PM, Ben Trumbull wrote:

> It possible, but inefficient, for a very limited number of clients to share 
> over AFP.  NFS doesn't work correctly at all.  This is restricted by file 
> caching issues underneath us.  There are a lot of limitations and sharp edges 
> here, so we actively recommend against multiple computers simultaneously 
> accessing the same db.  Support for it is disabled by default for projects 
> built with a deployment target >= 10.6

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Philippe Devallois

On 7 août 2010, at 11:34, Rick Mann wrote:

> I think you misunderstand (or I do). I don't want to specify a file of a 
> particular type(s). I want to specify that a *file* is what I accept (as 
> opposed to the contents of that file).
> 
> On Aug 7, 2010, at 02:29:47, Philippe Devallois wrote:
> 

Ah ok, you just want "file" dragged types.

You should use public.data for files and public.directory if you want to handle 
bundles



___

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

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

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

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


Re: Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Philippe Devallois

On 7 août 2010, at 09:50, Rick Mann wrote:

> I'm trying to understand how to call -registerForDraggedTypes: using UTIs, 
> instead of PBoardTypes. I want my table view to accept files dragged in from 
> the Finder. I accept multiple kinds of file. What's the right UTI to listen 
> for? The 10.6 standard types don't seem to include anything that's obviously 
> "file" type.
> 
> TIA,
> Rick
> 

This is the detailed list of Apple defined UTIs:

http://developer.apple.com/mac/library/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html



___

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

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

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

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


Re: Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Rick Mann
I think you misunderstand (or I do). I don't want to specify a file of a 
particular type(s). I want to specify that a *file* is what I accept (as 
opposed to the contents of that file).

On Aug 7, 2010, at 02:29:47, Philippe Devallois wrote:

> 
> On 7 août 2010, at 09:50, Rick Mann wrote:
> 
>> I'm trying to understand how to call -registerForDraggedTypes: using UTIs, 
>> instead of PBoardTypes. I want my table view to accept files dragged in from 
>> the Finder. I accept multiple kinds of file. What's the right UTI to listen 
>> for? The 10.6 standard types don't seem to include anything that's obviously 
>> "file" type.
>> 
> 
> http://developer.apple.com/mac/library/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html
> 
> "
> Identifier Tags
> 
> Each UTI can have one or more tags associated with it. These tags indicate 
> alternate methods of type identification, such as filename extension, MIME 
> type, or NSPasteboard type. You use these tags to assign specific extensions, 
> MIME types, and so on, as being equivalent types in a UTI declaration.
> 
> For example, the public.jpeg identifier declaration includes one OSType tag 
> ('JPEG') and two filename extension tags (.jpg and .jpeg). These tags are 
> then considered alternate identifiers for the public.jpeg type.
> 
> Essentially, you use the tags to group all the possible methods of 
> identifying a type under one UTI. That is, a file with extension .jpg or 
> .jpeg, or an OSType of 'JPEG' are all considered to be of type public.jpeg. 
> "

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Philippe Devallois

On 7 août 2010, at 09:50, Rick Mann wrote:

> I'm trying to understand how to call -registerForDraggedTypes: using UTIs, 
> instead of PBoardTypes. I want my table view to accept files dragged in from 
> the Finder. I accept multiple kinds of file. What's the right UTI to listen 
> for? The 10.6 standard types don't seem to include anything that's obviously 
> "file" type.
> 

http://developer.apple.com/mac/library/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html

"
Identifier Tags

Each UTI can have one or more tags associated with it. These tags indicate 
alternate methods of type identification, such as filename extension, MIME 
type, or NSPasteboard type. You use these tags to assign specific extensions, 
MIME types, and so on, as being equivalent types in a UTI declaration.

For example, the public.jpeg identifier declaration includes one OSType tag 
('JPEG') and two filename extension tags (.jpg and .jpeg). These tags are then 
considered alternate identifiers for the public.jpeg type.

Essentially, you use the tags to group all the possible methods of identifying 
a type under one UTI. That is, a file with extension .jpg or .jpeg, or an 
OSType of 'JPEG' are all considered to be of type public.jpeg. 
"___

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

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


Stuck on programmatic scrolling (scrollToBottom sample code)

2010-08-07 Thread Christopher Corbell
I have a WebKit view which is displaying HTML content from a string.

Periodically content can get inserted to the end of the body of the html
document, at which time I have the WebView reload.

I simply want to make the application programmatically scroll to the bottom
of the page when this happens, like a chat view or scrolling terminal
output.

After I tell the WebView to load its new content I call a scrollToBottom
method identical to the one documented here:
http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/NSScrollViewGuide/Articles/Scrolling.html#//apple_ref/doc/uid/TP40003463-SW1
)

It never works - the view just always reload the content scrolled up to the
beginning.  FWIW I also tried this with an NSTableView and couldn't get it
to work there either.  The sample code includes special logic if the view
coordinates are flipped so I know it isn't that.

Anyone have a guess as to the issue?

TIA,
Chris
___

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

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

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

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


Proper UTI for accepting files dropped on my table view?

2010-08-07 Thread Rick Mann
I'm trying to understand how to call -registerForDraggedTypes: using UTIs, 
instead of PBoardTypes. I want my table view to accept files dragged in from 
the Finder. I accept multiple kinds of file. What's the right UTI to listen 
for? The 10.6 standard types don't seem to include anything that's obviously 
"file" type.

TIA,
Rick

___

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

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

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

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