DO problem with NSConnection/NSSocketPortNameServer

2010-09-23 Thread Ken Tozier
Hi

I'm writing a client/server application and can't get a valid NSConnection when 
I try to use NSSocketPortNameServer

This works, locally, but I need a connection that will work on the network

server = [[NSConnection serviceConnectionWithName: @"PMXServer"
rootObject: self 
usingNameServer: [NSPortNameServer 
systemDefaultPortNameServer]] 
retain];

I can connect to the vended object from the client using

server = [[NSConnection rootProxyForConnectionWithRegisteredName: @"PMXServer"
host: nil
usingNameServer: [NSPortNameServer 
systemDefaultPortNameServer]] 
retain];

However, when I try to use NSSocketPortNameServer instead of NSPortNameServer, 
I get server = nil

server = [[NSConnection serviceConnectionWithName: @"PMXServer"
rootObject: self 
usingNameServer: [NSSocketPortNameServer sharedInstance]] 
retain];

The documentation here serviceConnectionWithName:rootObject:usingNameServer: 
seems to indicate that this should work. 

Anyone know why it isn't?

Thanks for any help


___

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

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

2010-09-23 Thread Quincey Morris
On Sep 23, 2010, at 21:18, Richard Somers wrote:

> I have a NSBox in a portion of a window. The box is used to swap views into 
> the window by setting the content view of the box.
> 
> When a view is swapped in I need to set the cursor but NSBox is changing the 
> cursor out from underneath me. (This even happens when the cursor is not 
> inside the box.)

Is there a scroll view involved anywhere, either enclosing the box or enclosed 
by the box? Scroll views have a tendency to reset the cursor at various 
inconvenient times. (If that's what is happening to you, the solution is to use 
setDocumentCursor: to force the scroll view to use the cursor you want.)

Otherwise, you can try setting a breakpoint on [NSCursor setCursor:] to find 
out what is changing the cursor. This can be tricky to do, since you want to 
avoid stopping at the breakpoint before the scenario you're interested in, but 
it can be done with a little care (and possibly a little debugging code too).


___

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

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

2010-09-23 Thread Ken Ferry
Hi Richard,

NSBox.m makes no reference to cursors.

I suggest you try building a small sample project that reproduces your
problem.  You'll either (1) not be able to, in which case you can try to
find the difference between your real project and your sample, or (2) have a
test case you can ask people to help diagnose.

-Ken
Cocoa Frameworks

On Thu, Sep 23, 2010 at 9:18 PM, Richard Somers
wrote:

> I have a NSBox in a portion of a window. The box is used to swap views into
> the window by setting the content view of the box.
>
> When a view is swapped in I need to set the cursor but NSBox is changing
> the cursor out from underneath me. (This even happens when the cursor is not
> inside the box.)
>
> Why would NSBox mess with the cursor when 'setContentView:' is called?
>
> --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/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: NSBox setContentView: messing with the cursor

2010-09-23 Thread koko


On Sep 23, 2010, at 10:18 PM, Richard Somers wrote:

I have a NSBox in a portion of a window. The box is used to swap  
views into the window by setting the content view of the box.


When a view is swapped in I need to set the cursor but NSBox is  
changing the cursor out from underneath me. (This even happens when  
the cursor is not inside the box.)


Why would NSBox mess with the cursor when 'setContentView:' is called?


		For the same reason objectValueForTableColumn is not called after  
loadData is called in  apparently obscure situations.

There must be some obscure situation that only Apple can reveal.

-koko



--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/koko%40highrolls.net

This email sent to k...@highrolls.net



___

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

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

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

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


NSBox setContentView: messing with the cursor

2010-09-23 Thread Richard Somers
I have a NSBox in a portion of a window. The box is used to swap views  
into the window by setting the content view of the box.


When a view is swapped in I need to set the cursor but NSBox is  
changing the cursor out from underneath me. (This even happens when  
the cursor is not inside the box.)


Why would NSBox mess with the cursor when 'setContentView:' is called?

--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: NSTableView display issue

2010-09-23 Thread Rufat A. Abdullayev

I had issue with iPhone (cocoa  Touch) not desktop


Rufat


-Original Message-
From: Kyle Sluder [mailto:kyle.slu...@gmail.com] 
Sent: Thursday, September 23, 2010 8:55 PM
To: Rufat A. Abdullayev
Cc: k...@highrolls.net; cocoa-dev list
Subject: Re: NSTableView display issue

On Sep 23, 2010, at 12:39 AM, "Rufat A. Abdullayev"  wrote:

> Hi Koko
> 
> 
> I had the same problems (just without using NSSplitView) there I had extra 
> controls dynamically created on a standard UITableViewCell (cells updated 
> after scrolling tableview)
> 
> The problem gone when I created custom UITableViewCell and build it in IB 
> with needed controls (did KVO complient one) and proper cell initialization 
> in cellForRowAtIndexPath
> 

Wait, what? You're mixing up desktop Cocoa with Cocoa Touch.

--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: NSTimer memory management

2010-09-23 Thread slasktrattena...@gmail.com
Thanks all for the input. I'll take Scott's and Gregory's advice to
not retain the timer. I've seen this advocated before, but always felt
uneasy about not retaining my pointers. It just goes against all I
ever learned about Cocoa.

In this particular case, though, I might just as well get rid of the
timer altogether and go for NSObject's
performSelector:afterDelay:/cancelSelector: instead. Jeff's
enlightening (and frightening!) discussion about implicit retain
cycles makes me want to stay as far away from NSTimers as possible.

And no, this should not be a multihreading issue. The timer methods
are only called on the main thread, where the target (self) is my main
controller. Full backtrace below:

Process: MyApp [1333]
Path:/Users/user/Desktop/MyApp.app/Contents/MacOS/MyApp
Identifier:  MyApp
Version: 1.0 (1.0)
Code Type:   X86 (Native)
Parent Process:  launchd [177]

Date/Time:   2010-09-21 11:28:57.566 -0600
OS Version:  Mac OS X 10.6.4 (10F569)
Report Version:  6

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0002, 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation0x91d6cc94 CFRelease + 196
1   com.apple.CoreFoundation0x91de37c1
__CFRunLoopTimerDeallocate + 33
2   com.apple.CoreFoundation0x91d6ce31 _CFRelease + 353
3   MyApp   0x878a 0x1000 + 30602
4   MyApp   0x00011da6 0x1000 + 69030
5   MyApp   0x000204d8 0x1000 + 128216
6   com.apple.AppKit0x97792f1e -[NSApplication
sendAction:to:from:] + 112
7   com.apple.AppKit0x97872699 -[NSControl
sendAction:to:] + 108
8   com.apple.AppKit0x9786e146 -[NSCell
_sendActionFrom:] + 169
9   com.apple.AppKit0x9786e094 -[NSSegmentedCell
_sendActionFrom:] + 70
10  com.apple.AppKit0x9786d43d -[NSCell
trackMouse:inRect:ofView:untilMouseUp:] + 1808
11  com.apple.AppKit0x9786c9f7 -[NSSegmentedCell
trackMouse:inRect:ofView:untilMouseUp:] + 1223
12  com.apple.AppKit0x9786be93 -[NSControl mouseDown:] + 812
13  com.apple.AppKit0x97869e9c -[NSWindow sendEvent:] + 5549
14  com.apple.AppKit0x97782aff -[NSApplication
sendEvent:] + 6431
15  com.apple.AppKit0x977165bb -[NSApplication run] + 917
16  com.apple.AppKit0x9770e5ed NSApplicationMain + 574
17  MyApp   0x2486 0x1000 + 5254

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib   0x9875a942 kevent + 10
1   libSystem.B.dylib   0x9875b05c _dispatch_mgr_invoke + 215
2   libSystem.B.dylib   0x9875a519 _dispatch_queue_invoke + 163
3   libSystem.B.dylib   0x9875a2be
_dispatch_worker_thread2 + 240
4   libSystem.B.dylib   0x98759d41 _pthread_wqthread + 390
5   libSystem.B.dylib   0x98759b86 start_wqthread + 30

Thread 2:
0   libSystem.B.dylib   0x98762066 __semwait_signal + 10
1   libSystem.B.dylib   0x98761d22 _pthread_cond_wait + 1191
2   libSystem.B.dylib   0x987639b8
pthread_cond_wait$UNIX2003 + 73
3   com.apple.CoreVideo 0x992e286a
CVDisplayLink::runIOThread() + 1016
4   com.apple.CoreVideo 0x992e2456 startIOThread(void*) + 156
5   libSystem.B.dylib   0x9876181d _pthread_start + 345
6   libSystem.B.dylib   0x987616a2 thread_start + 34

Thread 3:
0   libSystem.B.dylib   0x987340fa mach_msg_trap + 10
1   libSystem.B.dylib   0x98734867 mach_msg + 68
2   com.apple.CoreFoundation0x91d9cfaf __CFRunLoopRun + 2079
3   com.apple.CoreFoundation0x91d9c094 CFRunLoopRunSpecific + 452
4   com.apple.CoreFoundation0x91d9bec1 CFRunLoopRunInMode + 97
5   com.apple.Foundation0x944b442c
+[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] +
329
6   com.apple.Foundation0x9447b8d4 -[NSThread main] + 45
7   com.apple.Foundation0x9447b884 __NSThread__main__ + 1499
8   libSystem.B.dylib   0x9876181d _pthread_start + 345
9   libSystem.B.dylib   0x987616a2 thread_start + 34

Thread 4:
0   libSystem.B.dylib   0x98753086 select$DARWIN_EXTSN + 10
1   com.apple.CoreFoundation0x91ddc80d __CFSocketManager + 1085
2   libSystem.B.dylib   0x9876181d _pthread_start + 345
3   libSystem.B.dylib   0x987616a2 thread_start + 34

Thread 5:
0   libSystem.B.dylib   0x987599d2 __workq_kernreturn + 10
1   libSystem.B.dylib   0x98759f68 _pthread_wqthread + 941
2   libSystem.B.d

Re: Better Question Formulation

2010-09-23 Thread Kyle Sluder
On Thu, Sep 23, 2010 at 3:48 PM,   wrote:
> Under what conditions will objectValueForTableColumn not be called after
> -reloadData is called invoking numberOfRows?

My guess is that the table view doesn't bother asking for the object
value of offscreen rows. Do you find that your implementation is
called as you start scrolling around the tableview?

More importantly, why is it necessary for your this method to be
called? All you should be doing is figuring out the object value that
the table view should stuff in the cell for the purposes of drawing
that row.

--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: Setting the default folder in saveDocumentAs (NSDocument)

2010-09-23 Thread Conrad Shultz
If I understand what you're asking, I think you want NSSavePanel's

-(void)setDirectoryURL:(NSURL*)url

From the docs:
"Sets the directory shown in the panel to the directory with the specified URL."

-Conrad

On Sep 21, 2010, at 2:17, Thorsten Lemke  wrote:

> Hello,
> 
> How can I set the default folder for the saveDocumentAs handler?
___

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

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


Better Question Formulation

2010-09-23 Thread koko
Under what conditions will objectValueForTableColumn not be called  
after -reloadData is called invoking numberOfRows?


-koko
___

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

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


TableView and SplitView Display Problem

2010-09-23 Thread koko
The log below shows the problem I am having. A NSTableView does not  
always call tableView:objectValueForTableColumn:row after calling  
numberOfRows:InTableView


(If you will take a moment the log should be explanatory)

I need to solve this, thanks!

-kok0



< Select item in Matrix view > < Table displays properly but asks for  
the data 2 times >


2010-09-23 16:16:35.855 Convert It Mac[4057:813] Bmatrix Line 631  
[m_ThreadList reloadData]
2010-09-23 16:16:35.856 Convert It Mac[4057:813] numberOfRows 1  
InTableView 
2010-09-23 16:16:36.055 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0
2010-09-23 16:17:10.769 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0


< Select item in Matrix view > < Table displays properly >

2010-09-23 16:17:10.907 Convert It Mac[4057:813] Bmatrix Line 631  
[m_ThreadList reloadData]
2010-09-23 16:17:10.908 Convert It Mac[4057:813] numberOfRows 26  
InTableView 
2010-09-23 16:17:11.267 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0
2010-09-23 16:17:11.268 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 1
2010-09-23 16:17:11.270 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 2
2010-09-23 16:17:11.272 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 3
2010-09-23 16:17:11.273 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 4
2010-09-23 16:17:11.276 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 5
2010-09-23 16:17:11.279 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 6
2010-09-23 16:17:11.280 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 7


< Select item in Matrix view > < Table does not redisplay >

2010-09-23 16:17:40.688 Convert It Mac[4057:813] Bmatrix Line 631  
[m_ThreadList reloadData]
2010-09-23 16:17:40.689 Convert It Mac[4057:813] numberOfRows 19  
InTableView 


< Wait 1 minute and click Splitter > < Table displays properly but  
asks for the data 3 times >


2010-09-23 16:18:09.391 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0
2010-09-23 16:18:09.391 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 1
2010-09-23 16:18:09.396 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 2
2010-09-23 16:18:09.398 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 3
2010-09-23 16:18:09.399 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 4
2010-09-23 16:18:09.401 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 5
2010-09-23 16:18:09.407 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 6
2010-09-23 16:18:09.408 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 7
2010-09-23 16:18:09.446 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0
2010-09-23 16:18:09.447 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 1
2010-09-23 16:18:09.448 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 2
2010-09-23 16:18:09.449 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 3
2010-09-23 16:18:09.450 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 4
2010-09-23 16:18:09.450 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 5
2010-09-23 16:18:09.451 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 6
2010-09-23 16:18:09.451 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 7
2010-09-23 16:18:45.812 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 0
2010-09-23 16:18:45.814 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 1
2010-09-23 16:18:45.816 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 2
2010-09-23 16:18:45.816 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 3
2010-09-23 16:18:45.817 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 4
2010-09-23 16:18:45.819 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 5
2010-09-23 16:18:45.821 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 6
2010-09-23 16:18:45.823 Convert It Mac[4057:813] tableView  
 objectValueForTableColumn 0x1155af0> row 7


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-de

Re: To make an application start everytime when another program starts

2010-09-23 Thread Jerry Krinock

On 2010 Sep 23, at 15:02, John Pannell wrote:

> I would guess you are looking to write a launchd "Agent"

Yes, in theory.  In practice, it's a little messy… 

> perhaps WatchPaths might be promising if Word can reliably be seen to modify 
> the filesystem in a specific location at launch.

Yes, because unfortunately as you can see in man launchd.plist(5), launchd does 
not have any triggers for watching other processes launching or terminating.  I 
know.  I've read it many times looking for one :(

> Otherwise, an "always-on" agent with a run loop waiting for notification for 
> one app is not going to use a lot of cycles :-)

Indeed, this is the other alternative.

Both alternatives will work, but both are ugly.  The second is less fragile.

For your information, there is a launchd mailing list, 
launchd-...@lists.macosforge.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: NSOperation and threadDictionary

2010-09-23 Thread Julien Poissonnier

On Sep 22, 2010, at 12:52 AM, Rick Mann wrote:

> Does iOS (and Mac OS X) clean up thread-local storage upon the completion of 
> an NSOperation? It seems dangerous to rely on every operation to clean up its 
> own mess. It also seems that an NSOperation should be able to pretend that it 
> owns the thread on which it's running, and not have to worry about whatever a 
> previous operation running on that thread might've done to the TLS.
> 
> I read the NSOperation and NSOperationQueue docs, as well as the docs for 
> -[NSThread threadDictionary], but none of it mentions this topic.
> 
> I can experiment to find out, but would like to know what others know about 
> this.
> 
> Thanks,
> Rick
> 

I don't know what happens to the threadDictionary when an NSOperationQueue 
"recycles" a thread, but the Concurrency Programming Guide states that you 
should avoid per-thread storage and consider the thread owned by the 
NSOperationQueue, not the NSOperation:
http://developer.apple.com/library/ios/#documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationObjects/OperationObjects.html%23//apple_ref/doc/uid/TP40008091-CH101-SW27

-Julien___

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

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

2010-09-23 Thread bmaclist
f a valid document gets into my 'Recent Documents' menu, and then gets 
corrupted such that I am unable to open it, how can I programmatically remove 
it from the Recent Documents list (without removing everything in the list)?

Documentation says overriding recentDocumentURLs isn't used by the 
DocumentController internals

I've tried overriding the applicationDelegate's application:OpenFile: and 
returning NO, but that causes cocoa to attempt to open via the document 
controller (and does not remove it from the list) when the open fails.
(some postings say returning NO tells cocoa to remove the item for the 
list...and it may for non-Document based 
apps)___

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

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


Registering URL schemes with Launch Services from mounted DMG images

2010-09-23 Thread Jaroslav Snajdr
Hello,


when I open and mount a DMG image that contains an application, Finder reads 
the Info.plist file and if there are CFBundleURLSchemes keys, registers the 
application with Launch Services.


If I open an URL that launches this application, and I do it before I drag it 
to the Applications folder, it will get started from the DMG image.


Can I prevent that? I don't want applications from a DMG image to be 
automatically registered. Is there any DMG flag or something similar?


Jarda Snajdr
Kerio Technologies
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 add app in startup item (global log in item)?

2010-09-23 Thread Macarov Anatoli
How add app in startup item ( 
http://www.cocoadev.com/index.pl?StartingMyAppOnStartup )?
I 
use LaunchServices/LSSharedFileList.h  from http://cocoakids.net/recipe-3-adding-your-app-to-login-items-using-lssharedfilelist
 . But change attribute kLSSharedFileListSessionLoginItems on 
kLSSharedFileListGlobalLoginItems. When add new item with 
function LSSharedFileListInsertItemURL, return LSSharedFileListItemRef item = 
1. This is the correct code?

Sorry for my english.

Macarov Anatoli , www.mas.do.am - iCtrlClip


___

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

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

2010-09-23 Thread Thorsten Lemke
Hello,

How can I set the default folder for the saveDocumentAs handler?

[self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:nil
didSaveSelector:NULL contextInfo:NULL];

This is possible in Carbon with an AEDesc.

Thorsten


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: To make an application start everytime when another program starts

2010-09-23 Thread John Pannell
Hi there-

Read up on launchd, Apple's system init solution:

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/launchd.8.html
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html%23//apple_ref/doc/man/5/launchd.plist

Excellent architectural background here:

http://developer.apple.com/library/mac/#technotes/tn2005/tn2083.html

Based on my reading of what you are trying to do, I would guess you are looking 
to write a launchd "Agent" application that loads when the user logs in, 
watches for the launch of Word, and then does your stuff (at least part of your 
solution will have to be an Agent (vs. being a "Daemon") if you want to present 
some UI).  In terms of launching-on-demand: read thoroughly the 
launchd.plist(5) man page... some of the options for KeepAlive, or perhaps 
WatchPaths might be promising if Word can reliably be seen to modify the 
filesystem in a specific location at launch.  Otherwise, an "always-on" agent 
with a run loop waiting for notification for one app is not going to use a lot 
of cycles :-)

UI concern: if your agent is LSUIElement (prevents icon in the dock, app in 
force quit list, other things), I'm thinking the panel (which belongs to your 
app, and not word) might act funny.  You might need to watch for word gaining 
and losing focus and hide/show your panel appropriately.

Hope this helps!

John

John Pannell
Positive Spin Media
http://www.positivespinmedia.com



On Sep 23, 2010, at 3:42 PM, eveningnick eveningnick wrote:

> Hello!
> I have written an application, that interacts with another
> "stranger"-program by Applescript. The problem is that i need my
> application to look like a plugin for "stranger program"- to display a
> panel, and to be launched automatically when the Master-program starts
> (and to finish, when the master program is terminated - this is solved
> already using NSWorkspace's events [cocoa framework]).
> I have submitted this to installer mailing list, but haven't got any
> response, so decided to try my luck here :)
> How could I make my application be automatically launched, when the
> MasterApp process is started? Does MacOS provide any means for such
> activity?
> I was thinking about installing a daemon, that would watch application
> start events (not sure how to do that, but i read somewhere that
> Linux/BSD kernels support such a feature - when a process registers
> its callback functions on processStart event). - And, if it's the only
> way, could you point me where to read about these capabilities of the
> kernel?
> But a daemon, that is launched with the system start, and which
> remains in memory all the time is not a good idea for a good
> application (though, if there's no better way, i'd try to implement
> it).
> What could be the best way to perform this autolaunch? I would be very
> thankful for any advice :)
> 
> PS: Why do i need it. I am writing a "plugin" for mac:Word, that
> simplifies writing of big texts, but unfortunately Microsoft didn't
> publish mac:Office Plugin SDK. Luckily for me, Word supports external
> Applescipt commands. Everything is done by me, except this autolaunch,
> which is a real problem. I had an idea to replace MicrosoftWord binary
> in a bundle with mine (and rename original executable binary into
> something like MicrosoftWord111), so when a user doubleclicks on
> Word's, first my plugin starts, which launches Word. But i think it
> can cause problems with license agreement, and major problems with
> Autoupdates.
> 
> Thank you, George
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/john%40positivespinmedia.com
> 
> This email sent to j...@positivespinmedia.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: To make an application start everytime when another program starts

2010-09-23 Thread Scott Ribe
On Sep 23, 2010, at 3:42 PM, eveningnick eveningnick wrote:

> But a daemon, that is launched with the system start, and which
> remains in memory all the time is not a good idea for a good
> application...

I think you have to. In order to autolaunch, see launchd.

> Why do i need it. I am writing a "plugin" for mac:Word, that
> simplifies writing of big texts, but unfortunately Microsoft didn't
> publish mac:Office Plugin SDK.

I think you actually can write plugins for it same as on Windows, using COM, 
but there's almost no documentation on this.

> Luckily for me, Word supports external Applescipt commands.

Be careful and test a lot. I've done something similar, and the worst problems 
come from Word 2004 bugs. You'll tell it to set the value of a custom document 
property, and it will silently fail. It will all work for a good long while, 
then it will just quit responding to AppleScript commands. It will be unable to 
update its normal template on exit. It will corrupt its preference files and be 
unable to launch. It will corrupt a document on save. One day they'll issue a 
security update, and *poof* your AppleScripts will take several times as long 
to execute. And so on :-O

I never tried 2008, because I used a bit of VBA here and there. I am hopeful 
that 2011 will be an actual improvement.

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




___

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

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

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

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


Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Martin Wierschin
The problem I've had to continuously hack around is that  
NSTextView, in conjunction with NSLayoutManager, is rather eager to  
get the text to re-layout.


Maybe, to disable layout, set the textview's textContainer to nil,  
then restore it to enable layout?


That's one idea, though I wouldn't be surprised if other things go  
weird as a result.


Personally I'd try to work with the text system in a way it expects.  
For example:


when I resize the window and need to adjust the frames of both  
scroll views, calling -[NSTextView setFrame:] results in the layout  
manager invalidating and ensuring layout for the newly visible  
character range.


Why not just turn off text view width/height tracking for the  
container during the resize? That should let the layout manager use  
the existing layout information (ie: for the stale container size).


The other "state change" you explicitly touch upon is editing the  
text. If you bracket all your changes to the text storage with begin/ 
end editing calls, you shouldn't trigger layout until all your changes  
are finished (unless you're also inadvertently triggering layout in  
other ways).


Are there any other scenarios where you trigger layout before you're  
ready?


~Martin

___

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

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


To make an application start everytime when another program starts

2010-09-23 Thread eveningnick eveningnick
Hello!
I have written an application, that interacts with another
"stranger"-program by Applescript. The problem is that i need my
application to look like a plugin for "stranger program"- to display a
panel, and to be launched automatically when the Master-program starts
(and to finish, when the master program is terminated - this is solved
already using NSWorkspace's events [cocoa framework]).
I have submitted this to installer mailing list, but haven't got any
response, so decided to try my luck here :)
How could I make my application be automatically launched, when the
MasterApp process is started? Does MacOS provide any means for such
activity?
I was thinking about installing a daemon, that would watch application
start events (not sure how to do that, but i read somewhere that
Linux/BSD kernels support such a feature - when a process registers
its callback functions on processStart event). - And, if it's the only
way, could you point me where to read about these capabilities of the
kernel?
But a daemon, that is launched with the system start, and which
remains in memory all the time is not a good idea for a good
application (though, if there's no better way, i'd try to implement
it).
What could be the best way to perform this autolaunch? I would be very
thankful for any advice :)

PS: Why do i need it. I am writing a "plugin" for mac:Word, that
simplifies writing of big texts, but unfortunately Microsoft didn't
publish mac:Office Plugin SDK. Luckily for me, Word supports external
Applescipt commands. Everything is done by me, except this autolaunch,
which is a real problem. I had an idea to replace MicrosoftWord binary
in a bundle with mine (and rename original executable binary into
something like MicrosoftWord111), so when a user doubleclicks on
Word's, first my plugin starts, which launches Word. But i think it
can cause problems with license agreement, and major problems with
Autoupdates.

Thank you, George
___

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

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

2010-09-23 Thread Ross Carter
Maybe, to disable layout, set the textview's textContainer to nil, then restore 
it to enable layout?

On Sep 23, 2010, at 7:54 AM, Jonathan Dann  wrote:

> Hi all,
> 
> In our app, Kaleidoscope, I have 2 text views side-by-side. In one 
> configuration the layout of the text in each text view is dependent both on 
> regions of layout in the "sibling" text view, and the model objects which 
> represent the the insert, equal and deleted regions of the diff.
> 
> The problem I've had to continuously hack around is that NSTextView, in 
> conjunction with NSLayoutManager, is rather eager to get the text to 
> re-layout. For example, when I resize the window and need to adjust the 
> frames of both scroll views, calling -[NSTextView setFrame:] results in the 
> layout manager invalidating and ensuring layout for the newly visible 
> character range.
> 
> I'd like to know if anybody has had any experience/luck with completely 
> disabling the automatic layout that the text system does in response to these 
> changes in state?
> 
> In psuedocode, I'd like to be able to:
> 
> [(textViewA or layoutManagerA) disableLayout]
> [(textViewB or layoutManagerB) disableLayout]
> 
> // set frames, strings, and other state the text views need in order to 
> re-layout correctly
> 
> [(textViewA or layoutManagerA) enableLayout] // note that this doesn't 
> *cause* layout.
> [(textViewB or layoutManagerB) enableLayout]
> 
> [(textViewA or layoutManagerA) performLayout] // this may result in layout in 
> textViewB
> [(textViewB or layoutManagerB) performLayout] // just for completeness
> 
> If there's any combination of layout manager and text view methods to 
> override and return nil, 0, NSZeroRect etc., while I set up all the state 
> that would be great. Obviously, -[NSLayoutManager setAllowsBackgroundLayout:] 
> is a no-go as that only governs if the text system will layout when the run 
> loop is idle. My problems stem from the synchronous layout the text system 
> performs, because, from the perspective of layout, it was designed to exist 
> in isolation.
> 
> Thanks,
> 
> Jonathan___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rosscarterdev%40me.com
> 
> This email sent to rosscarter...@me.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: NSSplitView

2010-09-23 Thread Fritz Anderson
On 23 Sep 2010, at 2:40 PM, k...@highrolls.net wrote:

> Is there a way to send a mouse click to an NSSplitView like -performClick for 
> a NSControl?

What are you hoping to accomplish? Split views don't (aren't semantically 
supposed to) do anything when you just click them. There's nothing for them to 
"perform." 

Making your application work by simulating user interaction with itself has a 
very bad smell to it. What are you trying to do?

— 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


Re: NSSplitView

2010-09-23 Thread koko

No, which is why I asked in the first place.

2010-09-23 14:12:25.784 Convert It Mac[2638:813] *** -[RightVertSplit  
performClick:]: unrecognized selector sent to instance 0x1154230


-koko

On Sep 23, 2010, at 1:43 PM, Shawn Bakhtiar wrote:



NSSplitView is derived from NSResponder, so the answer is yes, it  
should have all the same functionality as an NSControl.



> From: k...@highrolls.net
> To: cocoa-dev@lists.apple.com
> Date: Thu, 23 Sep 2010 13:40:41 -0600
> Subject: NSSplitView
>
> Is there a way to send a mouse click to an NSSplitView like -
> performClick for a NSControl?
>
> -koko
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/shashaness%40hotmail.com
>
> This email sent to shashan...@hotmail.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: NSSplitView

2010-09-23 Thread Shawn Bakhtiar


NSSplitView is derived from NSResponder, so the answer is yes, it should have 
all the same functionality as an NSControl. 

> From: k...@highrolls.net
> To: cocoa-dev@lists.apple.com
> Date: Thu, 23 Sep 2010 13:40:41 -0600
> Subject: NSSplitView
> 
> Is there a way to send a mouse click to an NSSplitView like - 
> performClick for a NSControl?
> 
> -koko
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/shashaness%40hotmail.com
> 
> This email sent to shashan...@hotmail.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


NSSplitView

2010-09-23 Thread koko
Is there a way to send a mouse click to an NSSplitView like - 
performClick for a NSControl?


-koko
___

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

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

2010-09-23 Thread Shawn Bakhtiar


Maybe these guys can help Looks like they have done most of the work, and 
they offer the source
https://opensvn.csie.org/traccgi/WiredBot/wiki

> From: d...@chancofamily.com
> Date: Mon, 20 Sep 2010 12:32:12 -0400
> To: cocoa-dev@lists.apple.com
> Subject: php and cocoa
> 
> For those on the xcode mailing list I am not spamming or anything but on one 
> of these lists xcode or cocoa, someone posted a link with an example of 
> getting data from a php web page into objective-c
> 
> The responses I got on the xcode list while useful is not what I am looking 
> for.  What I am beginning to look at is an app that will send a http request 
> to a php page and display the results (an image, description and qty)
> 
> I plan to have a php page that will return (depending on what it received)
> 
> 1. a link to a image (or the actual image) I am still thinking this out
> 2. a single numeric value (quantity available)
> 3. a description of the item (a string)
> 
> any advice or the above mentioned link would be greatly appriciated
> 
> thanks
> 
> dougc
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/shashaness%40hotmail.com
> 
> This email sent to shashan...@hotmail.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


Question in regards to UITableView

2010-09-23 Thread Eric E. Dolecki
I have a view that contains a UITableView. It does not take up the full view
(320x480). When an item is selected, the thing is supposed to slide to the
left and bring in a new table in it's place. Other items in the main view do
not change... so I can't use a UINavigationController (I don't believe). Is
it okay to use two UITableViews to pull off all the data digging here?
(animate back and forth and reloading data for them)?

Data nesting can be about 4 levels deep at the most as I see it.




  Google Voice: (508) 656-0622
  Twitter: eric_dolecki  XBoxLive: edolecki  PSN: eric_dolecki
  http://blog.ericd.net
___

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

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

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

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


Re: Accessing NSDistantObject from different threads concurrently

2010-09-23 Thread Oleg Krupnov
So, how do I implement multiple threads in the server process?

I have the following idea:

Vend many objects. First, vend a root object in the server process and
then have it create new server threads by client request and return a
connection name to the client. The new server thread creates a
connection with the above name, and through it vends its per-thread
object, and then launches its run loop to listen to the connection.

Is this a valid approach?

What is nice about it, is that there is no trouble with
synchronization. The client thread first attempts to open the
connection by the name and simply blocks until it gets it without
blocking the main server thread nor the main client thread. However,
as I understand, these named connections are visible system-wide, so I
wonder if having too many named connections is expensive for the
system, isn't it?

I would appreciate comments or suggestions of other designs. Am I on
the right path at all?

Thanks,

Oleg.

On Mon, Sep 20, 2010 at 8:32 PM, Oleg Krupnov  wrote:
> Thanks, Kyle
>
>> Multithreading is not a prerequisite for serving multiple clients. Depending 
>> on what your server's doing, sticking with NSRunLoop-based multiplexing 
>> might be a lot easier.
>
> The server's job is associated with slow devices, such as disk, but
> are quite lengthy in time. In your scenario, all client threads will
> be unnecessarily waiting for the server to complete the current job,
> while there is still a lot of CPU time to run the other jobs
> concurrently.
>
>> The NSConnection documentation has a bunch of methods for dealing with 
>> multiple threads.
>
> Maybe you're right, but I haven't found examples. A pointer would be
> appreciated. Am I correct assuming that by default there is only one
> thread in the server process, and if multiple threads are trying to
> access the proxy, all but one will be blocked?
>
>> In your case, though, it sounds like you only want to vend one object 
>> through which all your clients communicate. Even if that communication is 
>> achieved by asking the vended object for another object with which to 
>> communicate.
>
> I don't mind to vend only a single object, through which to ask for
> the other object to actually communicate with clients. I've been
> thinking about it myself. The problem is how to spawn a new thread for
> each such object in the server process and make it listen to all
> incoming requests from the corresponding client.
>
> Thanks,
>
> Oleg.
>
___

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

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

2010-09-23 Thread Kyle Sluder
On Sep 23, 2010, at 12:39 AM, "Rufat A. Abdullayev"  wrote:

> Hi Koko
> 
> 
> I had the same problems (just without using NSSplitView) there I had extra 
> controls dynamically created on a standard UITableViewCell (cells updated 
> after scrolling tableview)
> 
> The problem gone when I created custom UITableViewCell and build it in IB 
> with needed controls (did KVO complient one) and proper cell initialization 
> in cellForRowAtIndexPath
> 

Wait, what? You're mixing up desktop Cocoa with Cocoa Touch.

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


NSTextView/Field to relinquish firstResponder after return key

2010-09-23 Thread Russ

The desired behavior is that when the user hits the return key after editing 
the 
contents of a NSTextView (replaced by NSTextField during editing), the 
firstResponder should be cleared and set to the overall window, with the text 
field no longer editing. Instead, the text field becomes fully selected and 
remains editing.


The key issue seems to revolve around NSTextField's textDidEndEditing, which 
has 
the following stated behavior:

"If the user ended editing by pressing Return, this method tries to send  the 
receiver’s action to its target; if unsuccessful, it sends 
performKeyEquivalent: 
to its NSView (for example, to handle the default button on a panel); if that 
also fails, the receiver simply selects its text."

I have a bunch of breakpoints set throughout things. I can see the following 
happening:

1. NSTextView's insertNewline calling its _giveUpFirstResponder which then 
calls 
the window's makeFirstResponder to set the first responder to the window itself 
(ie removing firstResponder from the field)
2. The NSTextView's action routine gets called, via NSTextField's 
textDidEndEditing, still from within NSTextView's _giveUpFirstResponder: from 
insertNewLine:
3. The window's makeFirstResponder gets called again, re-setting the 
firstResponder back to the same field, from within NSTextField selectText: from 
within textDidEndEditing:, from within _giveUpFirstResponder: and insertNewLine:

Since the action routine for the field is definitely getting called---it's my 
routine and I've got a breakpoint sitting right in the middle---you'd think 
that 
would qualify as successful. There's nothing else an action routine has to do 
to 
indicate that it is successful, right? They can't/don't have any return values. 
I don't understand why the fallback is being performed ("simply selects its 
text") when the action has definitely run.

And my action routine has limited workaround capability---it can not override 
the firstResponder status itself, since textDidEndEditing will re-set 
firstResponder subsequently (ie step #3).

It seems like textDidEndEditing is doing some 
wrong/inexplicable/inconvenient/etc. Ideas?




___

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

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

2010-09-23 Thread Jonathan Dann

On 23 Sep 2010, at 16:45, Matt Neuburg wrote:

> Is there a cool dynamic Cocoa way to call super with the same parameters
> that came to me? I guess what I'm looking for is a pre-configured invocation
> of the current command where I can just change the target to super. No big
> deal, but I just wondered, since Cocoa is cool and dynamic. m.

No, but you can easily write an NSProxy subclass that doesn't invoke the 
method, but returns you the runtime-generated NSInvocation by reference. i.e

NSInvocation *invocation;
[[object invocationProxy:&invocation] 
do:thing:with:any:number:of:args:you:want:];

Then get the objc_super struct using the invocation's target and its class and 
use libffi (http://sourceware.org/libffi/) to construct the argument list from 
the invocation and call objc_msgSendSuper() yourself.

Maybe.

I've not done the latter part, but I'm sure it would be possible. I feel a 
weekend project coming on.

Jonathan___

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

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

2010-09-23 Thread Ken Thomases
On Sep 23, 2010, at 9:45 AM, Matt Neuburg wrote:

> Is there a cool dynamic Cocoa way to call super with the same parameters
> that came to me?

Nope.

> I guess what I'm looking for is a pre-configured invocation
> of the current command where I can just change the target to super.

Super isn't an object, so it can't be set as the target of an invocation.  The 
'super' keyword tells the compiler to use a different Objective-C runtime 
function to dispatch the message: objc_msgSendSuper instead of objc_msgSend.  
That function uses a different search to find the implementation function 
corresponding to the sent message.

(The receiver of the message is still 'self'.  There is no distinction between 
the object which received the first message and the object which receives the 
message targeted at 'super'.)

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


Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Jonathan Dann
Hi all,

In our app, Kaleidoscope, I have 2 text views side-by-side. In one 
configuration the layout of the text in each text view is dependent both on 
regions of layout in the "sibling" text view, and the model objects which 
represent the the insert, equal and deleted regions of the diff.

The problem I've had to continuously hack around is that NSTextView, in 
conjunction with NSLayoutManager, is rather eager to get the text to re-layout. 
For example, when I resize the window and need to adjust the frames of both 
scroll views, calling -[NSTextView setFrame:] results in the layout manager 
invalidating and ensuring layout for the newly visible character range.

I'd like to know if anybody has had any experience/luck with completely 
disabling the automatic layout that the text system does in response to these 
changes in state?

In psuedocode, I'd like to be able to:

[(textViewA or layoutManagerA) disableLayout]
[(textViewB or layoutManagerB) disableLayout]

// set frames, strings, and other state the text views need in order to 
re-layout correctly

[(textViewA or layoutManagerA) enableLayout] // note that this doesn't *cause* 
layout.
[(textViewB or layoutManagerB) enableLayout]

[(textViewA or layoutManagerA) performLayout] // this may result in layout in 
textViewB
[(textViewB or layoutManagerB) performLayout] // just for completeness

If there's any combination of layout manager and text view methods to override 
and return nil, 0, NSZeroRect etc., while I set up all the state that would be 
great. Obviously, -[NSLayoutManager setAllowsBackgroundLayout:] is a no-go as 
that only governs if the text system will layout when the run loop is idle. My 
problems stem from the synchronous layout the text system performs, because, 
from the perspective of layout, it was designed to exist in isolation.

Thanks,

Jonathan___

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

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


cool way to call super?

2010-09-23 Thread Matt Neuburg
Is there a cool dynamic Cocoa way to call super with the same parameters
that came to me? I guess what I'm looking for is a pre-configured invocation
of the current command where I can just change the target to super. No big
deal, but I just wondered, since Cocoa is cool and dynamic. 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: NSURLConnection sync vs async connections

2010-09-23 Thread Jerry Krinock
On 2010 Sep 23, at 02:21, Devraj Mukherjee wrote:

> Previous version I used NSURLConnection to make synchronous calls to
> the API, parsing the data and then returning results.  Only problem of
> course is that my API client had to be used in threads so the UI
> didn't get locked up while the request was being made.

There are also the ill-defined errors that you get from 
sendSynchronousRequest:returningResponse:error:, which make it difficult to 
present appropriate error recovery.

> I would like to move towards using async requests.

Good idea.

> I can grab / parse
> the data using the delegate methods, what I am struggling with is how
> I return the data to the application incorporating my library?
> 
> Notifications? Or take define a protocol that the application has to
> implement and call back appropriate messages?

On 2010 Sep 23, at 05:37, Ken Thomases wrote:

> You could follow the example of the class you're using.  NSURLConnection uses 
> the delegate pattern.

Indeed, there is the simple approach of having your data-consumer object create 
and own an NSURLConnection when needed, making itself the connection's delegate.

Notifications, delegates, protocols will all work.  The best approach may 
depend on other considerations in your app.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Tito Ciuro
Hi Chris,

On 23/09/2010, at 04:27, Chris Hanson wrote:

> On Sep 22, 2010, at 11:39 PM, Tito Ciuro wrote:
> 
>> I believe (please correct me if I'm wrong) that Core Data stores the data 
>> atomically for both, XML and binary formats. That, if I'm not mistaken 
>> requires the datafile to be read in memory. Not so with NanoStore:
> 
> Not really so with Core Data either.
> 
> Core Data has the concept of both atomic and non-atomic persistent stores.
> 
> Core Data’s binary and XML persistent stores are atomic, so they are read and 
> written like documents (all at once).  Developers can also create your own 
> kinds of atomic persistent stores by subclassing NSAtomicStore.  (Also, the 
> XML persistent store is not available on iOS, only on Mac OS X.)
> 
> Core Data’s SQLite persistent store is quite explicitly not atomic: It uses 
> transactions against SQLite.  The entire persistent store does not need to be 
> read into memory, only the data requested; the entire persistent store is not 
> written upon a save, only the data changed.
> 
>  -- Chris

As I mentioned to Thomas, I left part of the sentence out, so thanks for 
clarifying this. What I meant was precisely what you have written so eloquently.

NanoStore is also explicitly not atomic: It uses transactions against SQLite as 
well storing and indexing the dictionaries.

Thanks Chris,

-- Tito___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Tito Ciuro
Hi Thomas,

On 23/09/2010, at 04:19, Thomas Davie wrote:

> 
> On 23 Sep 2010, at 07:39, Tito Ciuro wrote:
> 
>> Hm. That would be discussed better on a White Paper or similar. There are 
>> countless tutorials and documents about Core Data already. What I can do 
>> however is to provide a small example to illustrate how NanoStore works.
>> 
>> I believe (please correct me if I'm wrong) that Core Data stores the data 
>> atomically for both, XML and binary formats. That, if I'm not mistaken 
>> requires the datafile to be read in memory.
> 
> That's incorrect, CoreData gives you the choice of XML, binary or SQLite 
> backends.  When using the SQLite one it reads the data lazily.

I was thinking about the XML option (binary as well) and didn't finish the 
sentence, leaving SQLite behind. Yes, Core Data offers three backends.

Thanks for the correction,

-- Tito

___

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

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

2010-09-23 Thread Ken Thomases
On Sep 23, 2010, at 4:21 AM, Devraj Mukherjee wrote:

> Previous version I used NSURLConnection to make synchronous calls to
> the API

> I would like to move towards using async requests. I can grab / parse
> the data using the delegate methods, what I am struggling with is how
> I return the data to the application incorporating my library?
> 
> Notifications? Or take define a protocol that the application has to
> implement and call back appropriate messages?

You could follow the example of the class you're using.  NSURLConnection uses 
the delegate pattern.

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: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Jerry Krinock

On 2010 Sep 22, at 22:15, Thomas Davie wrote:

> some of the differences between using this or using CoreData to achieve a 
> similar thing?

An important feature of Core Data is support for Undo, although it is raw and 
still takes some doing to beat Undo grouping and Undo action names into 
submission.

___

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

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

2010-09-23 Thread Gregory Weston
slasktrattena...@gmail.com wrote:

> Is this an over-release?
> 
> timer = [ [NSTimer scheduledTimerWithTimeInterval: ...] retain];
> ...
> [timer invalidate];
> [timer release];

Seems fine, although based on 

 it also seems redundant. Consider the following excerpts:

-

@interface TimerController : NSObject {
NSTimer *repeatingTimer;
}
 
@property (assign) NSTimer *repeatingTimer;
 
@end

...

- (IBAction)startRepeatingTimer:sender {
 
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5
  target:self selector:@selector(timerFireMethod:)
  userInfo:[self userInfo] repeats:YES];
self.repeatingTimer = timer;
}

...

- (IBAction)stopRepeatingTimer:sender {
[repeatingTimer invalidate];
self.repeatingTimer = nil;
}

-

Note that repeatingTimer is not retained or released by the sample code. Have 
you hit it with Xcode's analyzer yet to see what else might be tripping it up?
___

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

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

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

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


CGDisplayChangeSummaryFlags

2010-09-23 Thread Trygve Inda
In my DisplayReconfigurationCallBack, the CGDisplayChangeSummaryFlags has
bit 13 set when the GPU changes on an i5/i7 Mac. Only bits 0-12 are defined
in the header.

Is this documented anywhere else?

During a GPU switch I get:

1st:  8478  kCGDisplayMovedFlag
kCGDisplaySetMainFlag
kCGDisplaySetModeFlag
kCGDisplayAddFlag
kCGDisplayEnabledFlag
bit 13

2nd:  8736  kCGDisplayRemoveFlag
kCGDisplayDisabledFlag
bit 13

I've never seen bit 13 set on any other system during this callback.

Thanks,

Trygve


___

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

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


NSURLConnection sync vs async connections

2010-09-23 Thread Devraj Mukherjee
Hi all,

I am the maintainer of EtsyCocoa (http://etsycocoa.googlecode.com),
its a Cocoa client library for Etsy.com's REST API. I am in the
process of re-writing the API client seeing they have released v2 of
their API.

Previous version I used NSURLConnection to make synchronous calls to
the API, parsing the data and then returning results. Only problem of
course is that my API client had to be used in threads so the UI
didn't get locked up while the request was being made.

I would like to move towards using async requests. I can grab / parse
the data using the delegate methods, what I am struggling with is how
I return the data to the application incorporating my library?

Notifications? Or take define a protocol that the application has to
implement and call back appropriate messages?

Any ideas would be appreciated.

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


Tooltip flickers and disappear.

2010-09-23 Thread Vijay Malhan
Hi,

In an application I am developing, complete App wide tooltips start to
misbehave after some time (not able to reproduce the exact steps). The
tooltips flicker and then disappear. This also gets randomly fixed (no
specific steps).
This is happening in both in Mac OS X Leopard and Snow Leopard.

Anybody had faced such an issue? Or any pointers to resolve such and issue.

Thanks.
Vijay
___

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

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

2010-09-23 Thread gMail.com
Hi Andy, thank you.
Yes, I use stringWithContentsOfURL:encoding:error: and my clients trapped
the error. The [error localizedDescription] says it can't reach the file
"http//www.mywebsite.com/abc.txt" while on my machine/office I can.

The
[[error userInfo] objectForKey:@"NSUnderlyingError"] localizedDescription]
on the client's machine is empty while on my machine/office, if I disconnect
the wi-fi, I get the error message "This computer¹s Internet connection
appears to be offline."

My client can quite reach the same file http//www.mywebsite.com/abc.txt
using Safari, so I think he has some problem at the ports. To be honest my
application appends an info at the end of the url, like this"
abc.txt?version=123 when invoking stringWithContentsOfURL:encoding:error

Any idea on how to solve this problem?

--
Leo


> Da: Andy Lee 
> Data: Fri, 17 Sep 2010 08:58:29 -0400
> A: "gMail.com" 
> Cc: 
> Oggetto: Re: Ports for stringWithContentsOfURL
> 
> stringWithContentsOfURL: is deprecated.  I suggest using
> stringWithContentsOfURL:encoding:error: or
> stringWithContentsOfURL:usedEncoding:error: and logging the error or
> displaying it with +alertWithError: so those users can tell you the exact
> reason for failure.  It might help to print the URL being passed so you are
> absolutely sure it's the URL you think it is.
> 
> --Andy
> 
> 
> On Sep 17, 2010, at 8:47 AM, gMail.com wrote:
>> Hi,
>> which port must be open on the Mac in order to get a response from the
>> server when calling stringWithContentsOfURL ?
>> My method calls a small file posted on my web site, so the path is a
>> http://www...
>> It works pretty well, but some of my clients say that they get a nil
>> response, even if they can properly reach my web site with Safari. So I
>> presume they have some port closed on their machine. Or can be the firewall?
>> 
>> Thank you
>> --
>> Leonardo
> 
> 


___

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

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

2010-09-23 Thread Rufat A. Abdullayev
Hi Koko


 I had the same problems (just without using NSSplitView) there I had extra 
controls dynamically created on a standard UITableViewCell (cells updated after 
scrolling tableview)

The problem gone when I created custom UITableViewCell and build it in IB with 
needed controls (did KVO complient one) and proper cell initialization in 
cellForRowAtIndexPath


Cheers,
Rufat



-Original Message-
From: cocoa-dev-bounces+rufataa=agbank...@lists.apple.com 
[mailto:cocoa-dev-bounces+rufataa=agbank...@lists.apple.com] On Behalf Of 
k...@highrolls.net
Sent: Wednesday, September 22, 2010 10:28 PM
To: cocoa-dev list
Subject: NSTableView display issue

I have an NSTableView in an NSSplitView.

I call -reloadData and -setNeedsDisplay:YES

The table does not redisplay with the new data until the split view is  
resized.  From that point forward it behaves properly with subsequent - 
reloadData and -setNeedsDisplay:YES calls.

Is there something basic I am missing here?


-koko
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rufataa%40agbank.az

This email sent to rufa...@agbank.az
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Chris Hanson
On Sep 22, 2010, at 11:39 PM, Tito Ciuro wrote:

> I believe (please correct me if I'm wrong) that Core Data stores the data 
> atomically for both, XML and binary formats. That, if I'm not mistaken 
> requires the datafile to be read in memory. Not so with NanoStore:

Not really so with Core Data either.

Core Data has the concept of both atomic and non-atomic persistent stores.

Core Data’s binary and XML persistent stores are atomic, so they are read and 
written like documents (all at once).  Developers can also create your own 
kinds of atomic persistent stores by subclassing NSAtomicStore.  (Also, the XML 
persistent store is not available on iOS, only on Mac OS X.)

Core Data’s SQLite persistent store is quite explicitly not atomic: It uses 
transactions against SQLite.  The entire persistent store does not need to be 
read into memory, only the data requested; the entire persistent store is not 
written upon a save, only the data changed.

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


Re: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Thomas Davie

On 23 Sep 2010, at 07:39, Tito Ciuro wrote:

> Hm. That would be discussed better on a White Paper or similar. There are 
> countless tutorials and documents about Core Data already. What I can do 
> however is to provide a small example to illustrate how NanoStore works.
> 
> I believe (please correct me if I'm wrong) that Core Data stores the data 
> atomically for both, XML and binary formats. That, if I'm not mistaken 
> requires the datafile to be read in memory.

That's incorrect, CoreData gives you the choice of XML, binary or SQLite 
backends.  When using the SQLite one it reads the data lazily.

> Not so with NanoStore: the SQLite database is the storage system and the API 
> stores and retrieves dictionaries. Another strong point is that you can store 
> whatever you want: from the developer's perspective, there is no schema, so 
> objects of different "weight" or complexity can be stored with ease and 
> retrieved back verbatim.

That's certainly a neat trick, I can imagine that lets you get started with 
this a lot faster than with CoreData.

> Now... I like Core Data. I really do. But some times I get the feeling that 
> it's too heavy for simple tasks. Plus, making CD work requires some reading, 
> while NanoStore requires a fraction of the time to get it working. I believe 
> that many developers will welcome this addition, as they will be able to 
> concentrate their effort on other parts of their app. In essence, I designed 
> NanoStore to be simple, relatively powerful and fast, while demanding a 
> minimum effort from the developer. Time will tell if I'm wrong :-)

Sounds like a neat middle ground, I'll give it a go some time soon!

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