managing split view iPad

2010-07-19 Thread Andrea Mattiuz
hi all,
I can't manage the change of a navigation controller on the right side of a 
split view application (iPad) after a tap on the left side.
The behavior of this app would be similar to the 'settings' app in the iPad 
simulator.
any suggestions or examples would be very appreciated.

Thanks!

Andrea
___

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

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


Reg: sending a URL request in a thread and receiving response in another thread

2010-07-19 Thread SridharRao M
Hi All,

I have  to download around 100 images from web by sending a each image URL
in "Sender Thread" and receiving the response from another thread "Receiver
Thread".

Is there any possibility to download images in this way sequentially by
using maximum band width of URL connection.

Can any one please help me by pointing right direction do this.

Thanks,
Sridhar
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Reg: sending a URL request in a thread and receiving response in another thread

2010-07-19 Thread Mike Abdullah
Why do you think you need to do this? And don't cross-post please.

On 19 Jul 2010, at 09:58, SridharRao M wrote:

> Hi All,
> 
> I have  to download around 100 images from web by sending a each image URL
> in "Sender Thread" and receiving the response from another thread "Receiver
> Thread".
> 
> Is there any possibility to download images in this way sequentially by
> using maximum band width of URL connection.
> 
> Can any one please help me by pointing right direction do this.
> 
> Thanks,
> Sridhar
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net
> 
> This email sent to cocoa...@mikeabdullah.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


Can we send url request from Thread1 and receive response from Thread2

2010-07-19 Thread Kalyanraju M
Hi All,

My requirement is to send a url request from Thread1 and receive the response 
for that request for the different thread Thread2.

Is this possible?Any one implemented this kind of behavior.If so please suggest 
me how we can achieve it.

Regards,
Kalyanraju 



  
___

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

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

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

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


Re: Can we send url request from Thread1 and receive response from Thread2

2010-07-19 Thread Roland King
assuming that you and SridharRao M who posted almost the exact same question an 
hour before are both from Effigent and looking for the same thing, perhaps you 
could go back to that thread and reply to the question Mike Abdullah posted in 
his reply, instead of starting a new one. 



On 19-Jul-2010, at 6:25 PM, Kalyanraju M wrote:

> Hi All,
> 
> My requirement is to send a url request from Thread1 and receive the response 
> for that request for the different thread Thread2.
> 
> Is this possible?Any one implemented this kind of behavior.If so please 
> suggest me how we can achieve it.
> 
> Regards,
> Kalyanraju 
> 
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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

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

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

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


Re: Change size of NSMenuItem (offset from the top of status menu)

2010-07-19 Thread Graham Cox

On 19/07/2010, at 4:53 PM, Nava Carmon wrote:

> The question is whether there is a way to cancel this offset?


I've seen this question come up a few times in various guises. The answer is 
no; file bugs.

--Graham

___

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

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

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

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


Core Data conflict detection

2010-07-19 Thread Paulo Andrade
Hello,

I'm trying to get my head around how Core Data handles optimistic locking 
failures but still haven't figured this out.

This discussion is purely conceptual, I have no sample code to back my 
assumptions, its purpose is to clarify what should happen in various scenarios.

Core Data uses snapshots to detect conflicts. When saving a dirty object, if 
the values on the snapshot for that object are different than those on the 
persistent store you have a conflict.

However, the mechanism that makes this work is not explained. Leading me to the 
following questions.

Problem 1: Detecting conflicts on stores other than SQL

For the SQLStore it's is easy to imagine that an update to an object as a 
"WHERE" clause referencing the previous values from the snapshot, similarly to 
what EOF does.

It doesn't really matter exactly how Core Data does this but one must create a 
mental model. (From the little SQLDebug statements I've seen, I'm guessing that 
Core Data uses the private "Z_OPT" field to keep a version of the tuple on the 
database and uses this for optimistic locking… this is pure guessing).

But how does this work for the XMLStore? Or custom stores using the 
NSAtomicStore? Is the file re-read to see if it is changed? (Note that there is 
no Z_OPT here, so there must be another way)

Since Core Data isn't supposed to be used in cases where the underlying file 
changes beneath it (ie, multiple applications accessing the same file) this 
isn't really a problem. If that Core Data application is the only one reading 
and writing to that file this scenario should not happen. 

Leading me to believe conflict detection is made higher up on the stack. Jump 
to the next problem.


Problem 2: Concurrency

This problem has mainly to do with snapshots, where they are stored and with 
what they are compared with when saving.

Imagine this scenario:

You have two threads (T1 and T2) each with their own managed object context 
(moc1 and moc2) which use the same persistent store coordinator.

1 - T1 reads ObjectX

2 - T2 reads ObjectX
3 - T1 makes some changes to ObjectX
4 - T2 makes some other changes to ObjectX and saves
< at this point the snapshot should be updated >
5 - T1 tries to save


I'm expecting a conflict after point 5. But what does Core Data use to know 
this? If the snapshot is updated with the new value at step 4, the snapshot 
values are equal to what is on the persistent store. 

Show does "Core Data" know there is a conflict? 

And who owns the snapshots? Is it NSPersistentStore, 
NSPersistentStoreCoordinator or the NSManagedObjectContext?

I'm hoping I've been clear and this will lead to a healthy discussion on the 
intricacies of conflict detection.

Best regards,
Paulo Andrade

___

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

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

2010-07-19 Thread Keary Suska
On Jul 18, 2010, at 8:19 PM, Gordon Apple wrote:

>>> My main entity has three references (one-to-one and one-to-many) to
>>> identical entities defined as class "File" (a managed object).  File is not
>>> defined in the graphical model and is the only class (for the referenced
>>> entities) defined in the code.  File has a back reference, and two
>>> attributes, a user-assigned name and a code-assigned uniqueID integer, the
>>> latter of which forms the main part of the actual (internal) file name when
>>> file access is required.  Actual files are stored in their respective
>>> subfolders of the documents folder for each defined File entity.
>>> 
>>> Question 1:  The FRC is for the main entity and sorts on the main entity's
>>> own name attribute.  Is there anything is what I described above which could
>>> be interfering with using an FRC cache?
>> 
>> I wouldn't assume so, but you haven't told us what "doesn't work" means.
> 
>Here's the story.  When the program is first launched, a folder of text
> files is read and and is used to pre-populate the database.  This appears to
> work.  However, even after saving and performFetch, the FRC will not get
> section info when going to a tab view containing a tableView.  If I quit the
> app and relaunch, the table will populate correctly using the FRC.  This is
> not a good initial experience for the user when first launching the program.

We would need to see code to make any useful recommendations. If you are saying 
that the exact same code functions correctly when *not* using a cache, but 
incorrectly when using a cache, I would suspect a bug of some sort. But then, 
the bug could be in your code...

>>> Comment:  I have yet to see any sample code or writeups on using CoreData to
>>> manage files, which seems like something that should be in common usage.
>> 
>> Why? Core Data is about object graph management (and its persistence). It
>> isn't about file system management. There are other classes for that.
> 
>Well, it is not enough to define something in isolation.  Many systems,
> like browsers, are based on individual file storage.  If there is a common
> standard practice for handling file references in CoreData, I would prefer
> to use it.

Originally I was answering the wrong question. The right answer would be that 
there is almost nothing particular to persisting file references in Core Data 
vs any other approach. But I would also add that I bemoan the lack of examples 
for complex and advanced uses of Cocoa classes--it seems that examples deal 
primarily with common and simple cases.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

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

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

2010-07-19 Thread douglas welton
Eric,

This isn't a unix tool... but, for applications and other bundles, have you 
tried getting the icons path from the bundle info using CFBundleIconFile key?  
I can imagine the code might look somthing like this:

iconPath = [targetBundle objectForInfoDictionaryKey:CFBundleIconFile];

later,

douglas


On Jul 16, 2010, at 5:28 PM, Eric Gorr wrote:

> Is there a unix tool to which I can pass a file and have it tell me where the 
> icon for the file is coming from?
> 
> Thank you.___

___

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

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

2010-07-19 Thread Gordon Apple



On 7/19/10 8:27 AM, "Keary Suska"  wrote:

> On Jul 18, 2010, at 8:19 PM, Gordon Apple wrote:
> 
 My main entity has three references (one-to-one and one-to-many) to
 identical entities defined as class "File" (a managed object).  File is not
 defined in the graphical model and is the only class (for the referenced
 entities) defined in the code.  File has a back reference, and two
 attributes, a user-assigned name and a code-assigned uniqueID integer, the
 latter of which forms the main part of the actual (internal) file name when
 file access is required.  Actual files are stored in their respective
 subfolders of the documents folder for each defined File entity.
 
 Question 1:  The FRC is for the main entity and sorts on the main entity's
 own name attribute.  Is there anything is what I described above which
 could
 be interfering with using an FRC cache?
>>> 
>>> I wouldn't assume so, but you haven't told us what "doesn't work" means.
>> 
>>Here's the story.  When the program is first launched, a folder of text
>> files is read and and is used to pre-populate the database.  This appears to
>> work.  However, even after saving and performFetch, the FRC will not get
>> section info when going to a tab view containing a tableView.  If I quit the
>> app and relaunch, the table will populate correctly using the FRC.  This is
>> not a good initial experience for the user when first launching the program.
> 
> We would need to see code to make any useful recommendations. If you are
> saying that the exact same code functions correctly when *not* using a cache,
> but incorrectly when using a cache, I would suspect a bug of some sort. But
> then, the bug could be in your code...

Yes, that is what I am saying.  I'm currently not using a cache in the
FRC because then it works.  Of course, this is iPhone OS 3.2 because it's an
iPad.  I don't know how 4.0 would behave.

> 
 Comment:  I have yet to see any sample code or writeups on using CoreData
 to
 manage files, which seems like something that should be in common usage.
>>> 
>>> Why? Core Data is about object graph management (and its persistence). It
>>> isn't about file system management. There are other classes for that.
>> 
>>Well, it is not enough to define something in isolation.  Many systems,
>> like browsers, are based on individual file storage.  If there is a common
>> standard practice for handling file references in CoreData, I would prefer
>> to use it.
> 
> Originally I was answering the wrong question. The right answer would be that
> there is almost nothing particular to persisting file references in Core Data
> vs any other approach. But I would also add that I bemoan the lack of examples
> for complex and advanced uses of Cocoa classes--it seems that examples deal
> primarily with common and simple cases.

Amen, brother.  Like examples with a zillion UI types, but nothing about
how to communicate with them to do something useful.  Sometimes I have to do
a lot of experimentation to find out what I need.  For example, in the
UIAudioRecorder/Player, it is "running" when "paused".  Nothing in the
reference.  I added my own flags to get what I needed.  Also, the
UIAlertView and UIActionSheet are lacking a "context" parameter which you
have to outboard so that the delegate can sort it out.  (Freshly dealt with
in the past 24 hrs.)  I assume that was an oversight, but it would have been
nice if they had suggested how to work around it in the references.

> 
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
> 

-- 
Gordon Apple
Ed4U
Little Rock, AR


___

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

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


First Responder

2010-07-19 Thread koko
I have subclass of NSMatrix that returns YES to -acceptsFirstResonder   
yet its -keyDown method is never called.


Clearly I miss something, how about some light for me.

-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


Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Rick Mann
I have a basic NSDocument-based app with no window controllers. When the 
document's single window opens (as a result of a New or Open command), I want 
to open a drawer attached to it. But I don't immediately see in NSDocument how 
to know that the window has just opened. Where might be a good place to put a 
call to -[NSDrawer open]?

Do I need to subscribe to a window shown notification of some kind?

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


Re: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Kyle Sluder
On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
> I have a basic NSDocument-based app with no window controllers. When the 
> document's single window opens (as a result of a New or Open command), I want 
> to open a drawer attached to it. But I don't immediately see in NSDocument 
> how to know that the window has just opened. Where might be a good place to 
> put a call to -[NSDrawer open]?

1. You shouldn't use drawers anymore, as per the HIG.
2. You should use an NSWindowController.

--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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Rick Mann

On Jul 19, 2010, at 14:24:17, Kyle Sluder wrote:

> On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
>> I have a basic NSDocument-based app with no window controllers. When the 
>> document's single window opens (as a result of a New or Open command), I 
>> want to open a drawer attached to it. But I don't immediately see in 
>> NSDocument how to know that the window has just opened. Where might be a 
>> good place to put a call to -[NSDrawer open]?
> 
> 1. You shouldn't use drawers anymore, as per the HIG.

Oh, no kidding. Okay.

> 2. You should use an NSWindowController.

Yeah, I decided to go ahead and add one.

Thanks.

> 
> --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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Laurent Daudelin
On Jul 19, 2010, at 14:24, Kyle Sluder wrote:

> On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
>> I have a basic NSDocument-based app with no window controllers. When the 
>> document's single window opens (as a result of a New or Open command), I 
>> want to open a drawer attached to it. But I don't immediately see in 
>> NSDocument how to know that the window has just opened. Where might be a 
>> good place to put a call to -[NSDrawer open]?
> 
> 1. You shouldn't use drawers anymore, as per the HIG.

I didn't know the drawers were no longer in the favors of the powers that be. 
Where is this mentioned, out of curiosity and my self edification?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Quincey Morris
On Jul 19, 2010, at 13:33, Rick Mann wrote:

> I have a basic NSDocument-based app with no window controllers.

There really isn't such a thing. A "basic" NSDocument object creates its own 
window controller behind the scenes (see the 'windowNibName' method). 
Conversely, a NSDocument object that you somehow forced to operate without a 
window controller couldn't be considered "basic".

The easiest solution is to create a window controller subclass that overrides 
'windowDidLoad' to change the window's state. You'd then replace your 
document's 'windowNibName' method with a 'makeWindowControllers' method that 
creates an instance of your subclass and invokes 'addWindowController:'.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Rick Mann

On Jul 19, 2010, at 14:37:01, Quincey Morris wrote:

> On Jul 19, 2010, at 13:33, Rick Mann wrote:
> 
>> I have a basic NSDocument-based app with no window controllers.
> 
> There really isn't such a thing. A "basic" NSDocument object creates its own 
> window controller behind the scenes (see the 'windowNibName' method). 
> Conversely, a NSDocument object that you somehow forced to operate without a 
> window controller couldn't be considered "basic".

Well, by "no window controllers" I meant, no custom window controllers. 
However, I have gone ahead and added one.

> The easiest solution is to create a window controller subclass that overrides 
> 'windowDidLoad' to change the window's state. You'd then replace your 
> document's 'windowNibName' method with a 'makeWindowControllers' method that 
> creates an instance of your subclass and invokes 'addWindowController:'.

-windowDidLoad is called when the nib loads, but really I'm interested in 
opening the drawer after window becomes visible.

However, someone else pointed out that drawers are deprecated, so I guess I 
need to re-think my UI.

> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Rick Mann
On second though, I may stick to using drawers. I'm looking at the section on 
drawers in the HIG right now, and I don't see anything that suggests they're 
deprecated in any way.

On Jul 19, 2010, at 14:37:01, Quincey Morris wrote:

> On Jul 19, 2010, at 13:33, Rick Mann wrote:
> 
>> I have a basic NSDocument-based app with no window controllers.
> 
> There really isn't such a thing. A "basic" NSDocument object creates its own 
> window controller behind the scenes (see the 'windowNibName' method). 
> Conversely, a NSDocument object that you somehow forced to operate without a 
> window controller couldn't be considered "basic".
> 
> The easiest solution is to create a window controller subclass that overrides 
> 'windowDidLoad' to change the window's state. You'd then replace your 
> document's 'windowNibName' method with a 'makeWindowControllers' method that 
> creates an instance of your subclass and invokes 'addWindowController:'.
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Quincey Morris
On Jul 19, 2010, at 14:50, Rick Mann wrote:

> -windowDidLoad is called when the nib loads, but really I'm interested in 
> opening the drawer after window becomes visible.

You mean you want to see the animation of the drawer sliding out?

If you don't care (which I was assuming), then it would be fine to open the 
drawer in windowDidLoad:.

If you do care, then you can simply invoke [self showWindow: self], followed by 
the code to open the drawer, just before returning from your window 
controller's 'init' method.

(Actually, I'm not sure if you'll lose the start of the animation, or see the 
animation stutter, if you do it exactly like that. An alternative is do a 
'[self performSelector...afterDelay: 0]' of the drawer-opening code. Or even 
'...afterDelay:0.1'.)


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Kyle Sluder
On Mon, Jul 19, 2010 at 2:33 PM, Laurent Daudelin
 wrote:
> On Jul 19, 2010, at 14:24, Kyle Sluder wrote:
>
>> On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
>>> I have a basic NSDocument-based app with no window controllers. When the 
>>> document's single window opens (as a result of a New or Open command), I 
>>> want to open a drawer attached to it. But I don't immediately see in 
>>> NSDocument how to know that the window has just opened. Where might be a 
>>> good place to put a call to -[NSDrawer open]?
>>
>> 1. You shouldn't use drawers anymore, as per the HIG.
>
> I didn't know the drawers were no longer in the favors of the powers that be. 
> Where is this mentioned, out of curiosity and my self edification?

At the risk of sounding like a liar, I can't find it in the HIG or in
the AppKit release notes. I could have sworn it said to use source
lists instead of drawers.

My apologies.

--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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Rick Mann

On Jul 19, 2010, at 15:28:24, Kyle Sluder wrote:

> On Mon, Jul 19, 2010 at 2:33 PM, Laurent Daudelin
>  wrote:
>> On Jul 19, 2010, at 14:24, Kyle Sluder wrote:
>> 
>>> On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
 I have a basic NSDocument-based app with no window controllers. When the 
 document's single window opens (as a result of a New or Open command), I 
 want to open a drawer attached to it. But I don't immediately see in 
 NSDocument how to know that the window has just opened. Where might be a 
 good place to put a call to -[NSDrawer open]?
>>> 
>>> 1. You shouldn't use drawers anymore, as per the HIG.
>> 
>> I didn't know the drawers were no longer in the favors of the powers that 
>> be. Where is this mentioned, out of curiosity and my self edification?
> 
> At the risk of sounding like a liar, I can't find it in the HIG or in
> the AppKit release notes. I could have sworn it said to use source
> lists instead of drawers.

Ah, it does, in the context of navigating hierarchical data. But "for controls 
that need to be accessed fairly frequently but that don’t need to be visible 
all the time," drawers apparently are appropriate.


> 
> My apologies.
> 
> --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: Basic Q: Where is the best place to open a drawer?

2010-07-19 Thread Mike Abdullah

On 19 Jul 2010, at 23:30, Rick Mann wrote:

> 
> On Jul 19, 2010, at 15:28:24, Kyle Sluder wrote:
> 
>> On Mon, Jul 19, 2010 at 2:33 PM, Laurent Daudelin
>>  wrote:
>>> On Jul 19, 2010, at 14:24, Kyle Sluder wrote:
>>> 
 On Mon, Jul 19, 2010 at 1:33 PM, Rick Mann  wrote:
> I have a basic NSDocument-based app with no window controllers. When the 
> document's single window opens (as a result of a New or Open command), I 
> want to open a drawer attached to it. But I don't immediately see in 
> NSDocument how to know that the window has just opened. Where might be a 
> good place to put a call to -[NSDrawer open]?
 
 1. You shouldn't use drawers anymore, as per the HIG.
>>> 
>>> I didn't know the drawers were no longer in the favors of the powers that 
>>> be. Where is this mentioned, out of curiosity and my self edification?
>> 
>> At the risk of sounding like a liar, I can't find it in the HIG or in
>> the AppKit release notes. I could have sworn it said to use source
>> lists instead of drawers.
> 
> Ah, it does, in the context of navigating hierarchical data. But "for 
> controls that need to be accessed fairly frequently but that don’t need to be 
> visible all the time," drawers apparently are appropriate.

Well seeing as Keynote still has one, I hope so!
(Note I do rather like drawers myself, when used 
right)___

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

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

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

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


Core Data caching very large property values in 10.6

2010-07-19 Thread Quincey Morris
I'm not sure if I can describe this problem clearly enough, but here goes ...

I have a Core Data GC application that has been working fine under Leopard, but 
now crashes in a certain operation under Snow Leopard. It appears to be running 
out of memory (the 32-bit version produces a console error from 'malloc'; the 
64-bit version just crashes in 'malloc'). The GC is being invoked explicitly 
('collectExhaustively') from time to time, and it seems that the collector is 
*not* being outrun.

The operation that fails is a kind of image import. (I'm simplifying here, but 
that's the essence.) The images are compressed PNGs, typically about 200-400 KB 
each, and the total size of the import can be anything from a couple of hundred 
MB of image data to a couple of GB. As it's imported, each compressed image is 
stored as a NSData object property in a Core Data persistent store.

Obviously that amount of data can't be in memory at once, so there is a caching 
scheme. The images are represented by an Image entity, which has metadata (like 
the width and height) plus a 1-1 relationship to an ImageCache entity whose 
single property is the above-mentioned NSData with the compressed image data.

This arrangement allows image data to be dumped out of memory by faulting out 
the ImageCache object and allowing the NSData to be collected, while the 
metadata stays available all the time. (That's why ImageCache has to be a 
separate entity -- if the image data were a property of Image, there'd be no 
way to fault out just the image data.)

All of this worked well enough under Leopard. However, under Snow Leopard the 
faulted-out ImageCache image data property is still alive and *not* being 
collected.

From the debugger, I followed the lifetime of one of the NSData objects. 
Initially, it's kept alive by its owning ImageCache object, which is turn is 
kept alive by being in the managed context's "inserted objects" data 
structures. After each group of images, the import code saves the Core Data 
context, then attempts to fault out all of the recently created Core Data 
objects (there are other objects whose existence is supposed to be transitory, 
too), then invokes the garbage collector.

At this point, the NSData is unreferenced by application code, but 
unfortunately still alive, being rooted like this:

> Root:
>0 Kind: stack   rc:   0  Address: 0xb020f804  Frame level: 0  Symbol: 
> 
>1 Kind: object  rc:   0  Address: 0x0137e3c0  Class: 
> NSManagedObjectContext  ivar: _objectStore
>2 Kind: object  rc:   1  Address: 0x013708e0  Class: 
> NSPersistentStoreCoordinator  ivar: _persistentStores
>3 Kind: object  rc:   1  Address: 0x013708c0  Offset: 0x0014  Class: 
> NSCFArray
>4 Kind: bytes   rc:   0  Address: 0x0137d9a0  Offset: 0x0010
>5 Kind: object  rc:   0  Address: 0x01377450  Offset: 0x0044  Class: 
> NSSQLCore
>6 Kind: object  rc:   0  Address: 0x0137d290  Offset: 0x0004  Class: 
> NSSQLRowCache
>7 Kind: object  rc:   0  Address: 0x0137cf70  Offset: 0x001c  Class: 
> NSCFDictionary
>8 Kind: bytes   rc:   0  Address: 0x011f0c00  Offset: 0x0554
>9 Kind: bytes   rc:   0  Address: 0x012f2e30  Offset: 0x002c
>   10 Kind: object  rc:   0  Address: 0x01317280  Offset: 0x  Class: 
> NSConcreteData


AFAICT, this is telling me that Core Data has itself cached the NSData object 
in a "row cache". That's very bad news, because it seems to persist in there 
indefinitely, until the managed object context is finally disposed of (which I 
can't do in the middle of the import).

Does anyone know of a way to empty or disable the row cache, or can anyone 
provide a better insight into what's going wrong?


___

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

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

2010-07-19 Thread mmalc Crawford

On Jul 19, 2010, at 12:19 am, Andrea Mattiuz wrote:

> I can't manage the change of a navigation controller on the right side of a 
> split view application (iPad) after a tap on the left side.
> The behavior of this app would be similar to the 'settings' app in the iPad 
> simulator.
> any suggestions or examples would be very appreciated.

One approach is illustrated in the MultipleDetailViews example:



mmalc

___

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

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

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

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


Dynamically Updating Column Titles in NSTableView with Mouse Events

2010-07-19 Thread Peter Zegelin
I am trying to dynamically update the titles of my table columns to show the 
current row that the mouse is over. I am using an NSTrackingArea to get the 
mouseEnter, mouseMove and mouseExit events and then calling the following 
method ( in my delegate ) to update the column titles. Unfortunately the column 
titles never change, though the printf statement shows that the method is being 
called correctly:

- (void)setColumnTitlesForMouseAt:(int)row{

if(row == rowForColumnTitles)   // just to prevent unnecessary 
updating
return;

rowForColumnTitles = row;

printf("\n %02x: ",row);

NSTableColumn*  column;
int i;

for(i = 1; i <= 16; ++i){
column = [[itsTableView tableColumns] objectAtIndex:i]; 
[[column headerCell] setStringValue:[NSString 
stringWithFormat:@"%02X",rowForColumnTitles]];
}

//[itsTableView displayIfNeeded];
//[itsTableView setNeedsDisplay: YES];  
}

I've tried both the commented out methods at the end but no luck. Quartz Debug 
shows no updating in the header area either.

NOTE:  The column headers do update if I set a breakpoint at [itsTableView 
displayIfNeeded] or move the splitter that the table is in.

Thanks for any advice,

Peter Zegelin
www.fracturedsoftware.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: Dynamically Updating Column Titles in NSTableView with Mouse Events

2010-07-19 Thread Graham Cox

On 20/07/2010, at 11:54 AM, Peter Zegelin wrote:

> I've tried both the commented out methods at the end but no luck. Quartz 
> Debug shows no updating in the header area either.
> 
> NOTE:  The column headers do update if I set a breakpoint at [itsTableView 
> displayIfNeeded] or move the splitter that the table is in.
> 
> Thanks for any advice,


If this is called within some loop (like a tracking loop) you probably need to 
flush the update to the screen manually - after calling -setNeedsDisplay: try

[[itsTableView window] displayIfNeeded];

--Graham


___

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

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

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

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


Re: Dynamically Updating Column Titles in NSTableView with Mouse Events

2010-07-19 Thread Jeff Gilbert
Hi Peter,

On Jul 19, 2010, at 8:54 PM, Peter Zegelin wrote:

> I am trying to dynamically update the titles of my table columns to show the 
> current row that the mouse is over. I am using an NSTrackingArea to get the 
> mouseEnter, mouseMove and mouseExit events and then calling the following 
> method ( in my delegate ) to update the column titles. Unfortunately the 
> column titles never change, though the printf statement shows that the method 
> is being called correctly:
> 
> - (void)setColumnTitlesForMouseAt:(int)row{
>   
>   if(row == rowForColumnTitles)   // just to prevent unnecessary 
> updating
>   return;
>   
>   rowForColumnTitles = row;
>   
>   printf("\n %02x: ",row);
>   
>   NSTableColumn*  column;
>   int i;
>   
>   for(i = 1; i <= 16; ++i){
>   column = [[itsTableView tableColumns] objectAtIndex:i]; 
>   [[column headerCell] setStringValue:[NSString 
> stringWithFormat:@"%02X",rowForColumnTitles]];
>   }
>   
>   //[itsTableView displayIfNeeded];
>   //[itsTableView setNeedsDisplay: YES];  
> }


I do something similar and found the following works for me:

// update column headers
...

// force the table to redraw the headers
[[table headerView] setNeedsDisplay:YES];

Good luck,
Jeff Gilbert
___

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

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


Using XSLT functions with NSXMLDocument

2010-07-19 Thread Alec Stewart
Hello,

I'm trying to transform a NSXML document using objectByApplyingXSLT.  This
is working okay as long as I don't use any XSLT functions in my xslt sheet.


When I try to use the XSLT functions adjust-dateTime-to-timezone
and dateTime in my XSLT sheet I get these errors at run time:

mlXPathCompOpEval: function dateTime not found
XPath error : Unregistered function
xmlXPathCompOpEval: function adjust-dateTime-to-timezone not found
XPath error : Unregistered function
runtime error: element value-of
XPath evaluation returned no result.

I would be very grateful if anyone could let me know if it is possible to
get these XSLT functions to work for a transformation
with objectByApplyingXSLT.

If it is not possible I would also love to hear some suggestions about other
ways to transform an XML document using an XSLT sheet that includes XSLT
functions.

Thanks,

Alec

Alec M. Stewart
President

Velocitek - Performance Training Tools
Web: www.velocitek.com
Toll free USA & Canada: 1-800-693-1610
Worldwide: +1-(650)-362-0499 ex. 1
Fax: +1-(650)-618-2679
Skype: alec_stewart
Address: 271B Kahiko Street, Paia, HI, 96779, USA

twitter.com/alecms
facebook.com/alec.stewart
linkedin.com/in/alecms
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Dynamically Updating Column Titles in NSTableView with Mouse Events

2010-07-19 Thread Peter Zegelin
Wow that was quick!

[[table headerView] setNeedsDisplay:YES];

works great. Thanks to Jeff and Graham for replying.



On 20/07/2010, at 12:20 PM, Jeff Gilbert wrote:

> Hi Peter,
> 
> On Jul 19, 2010, at 8:54 PM, Peter Zegelin wrote:
> 
>> I am trying to dynamically update the titles of my table columns to show the 
>> current row that the mouse is over. I am using an NSTrackingArea to get the 
>> mouseEnter, mouseMove and mouseExit events and then calling the following 
>> method ( in my delegate ) to update the column titles. Unfortunately the 
>> column titles never change, though the printf statement shows that the 
>> method is being called correctly:
>> 
>> - (void)setColumnTitlesForMouseAt:(int)row{
>>  
>>  if(row == rowForColumnTitles)   // just to prevent unnecessary 
>> updating
>>  return;
>>  
>>  rowForColumnTitles = row;
>>  
>>  printf("\n %02x: ",row);
>>  
>>  NSTableColumn*  column;
>>  int i;
>>  
>>  for(i = 1; i <= 16; ++i){
>>  column = [[itsTableView tableColumns] objectAtIndex:i]; 
>>  [[column headerCell] setStringValue:[NSString 
>> stringWithFormat:@"%02X",rowForColumnTitles]];
>>  }
>>  
>>  //[itsTableView displayIfNeeded];
>>  //[itsTableView setNeedsDisplay: YES];  
>> }
> 
> 
> I do something similar and found the following works for me:
> 
> // update column headers
> ...
> 
> // force the table to redraw the headers
> [[table headerView] setNeedsDisplay:YES];
> 
> Good luck,
> Jeff Gilbert

kind regards,

Peter Zegelin
www.fracturedsoftware.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


memory management of app delegate on iOS

2010-07-19 Thread Matt Neuburg
"Objects in the nib file are created with a retain count of 1 and then
autoreleased... If you define outlets for nib-file objects, you should
always define a setter method (or declared property) for accessing that
outlet. Setter methods for outlets should retain their values."

And indeed, if I load a nib and don't retain its top-level objects (usually
thru outlets backed by a setter with a retain policy), they vanish in a puff
of smoke. So far, so good.

But what about the app delegate? In a typical iPhone app (e.g. the
template), the app delegate is instantiated through the MainWindow nib
loading. It is a top-level nib object. So it should be autoreleased.

Yet the UIApplication object does NOT retain its delegate. So why doesn't
the app delegate vanish in a puff of smoke? Is the MainWindow nib subject to
different memory management rules?

Thx -

m.

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



___

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

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

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

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


Re: memory management of app delegate on iOS

2010-07-19 Thread Kyle Sluder
On Mon, Jul 19, 2010 at 9:32 PM, Matt Neuburg  wrote:
> Yet the UIApplication object does NOT retain its delegate. So why doesn't
> the app delegate vanish in a puff of smoke? Is the MainWindow nib subject to
> different memory management rules?

UIApplication might be retaining the top-level object array. Since
it's quite typical not to subclass UIApplication, it must have some
way of dealing with the common case: nobody else holding on to the
delegate object in the MainWindow nib.

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