Re: [iPhone] Terminating iPhone App programatically

2010-07-09 Thread Uli Kusterer
Am Jul 5, 2010 um 6:51 PM schrieb Tharindu Madushanka:
> Ah Ok. I got the point. Thanks :) So we should not look to exit the app
> using code.

 Exactly. If it's an error situation, you should really try to gracefully 
handle such errors and give the user the option to continue using your 
application instead of just putting up a window and quitting your application. 
Similarly, if you are reacting to a settings change, your application should 
update "live" instead of requiring the user to quit and restart the application.

 If an iPhone app can be smart and do work for the user, it should, instead of 
requiring manual process management.

-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."



___

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: Another basic CoreData question

2010-07-09 Thread Jerry Krinock

On 2010 Jul 08, at 19:28, Noah Desch wrote:

> On Jul 8, 2010, at 7:33 PM, gumbo...@mac.com wrote:
> 
>> Using the standard Employee/Department example, Whats the best way to set a 
>> default department for an Employee?
>> So that every employee is created with a relationship to the "mailRoom" 
>> department.
> 
> Probably to add some custom code to AwakeFromInsert in your employee 
> NSManagedObjectSubclass to set its own department.

Yes, that works.  As always, you must be careful you don't screw up Undo.  For 
discussion of this, see list archives during the last couple weeks, thread:

   Re: CoreData and undo/redo : how to add a managed object with attributes 
already set in the undo/redo stack ?

Several solutions are given.  Gumboots asked which is "best".  I don't know.  
They all work.

An interesting question is how this happens in the DepartmentAndEmployees 
sample code.  When I create a document with an employee, save the file and dump 
it with sqlite3, it appears that the Employee is related to the Department.  
But I looked at that code for a few minutes yesterday and can't see how it 
happened.  The only time that an Employee is set to a Department or vice versa 
is in the -paste method, but that doesn't run.  Does anyone know?

___

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: NSXMLParser parses line feeds in attribute strings as spaces

2010-07-09 Thread Jerry Krinock
Thank you all for the replies.  

On 2010 Jul 08, at 19:18, Jeff Johnson wrote:

> See section 3.3.3 Attribute-Value Normalization:
> 
> http://www.xml.com/axml/testaxml.htm

That's the problem.  NSXMLParser is correct.  Unfortunately, the incorrect XML 
is being generated by others, so I got to spend 2 hours writing code to patch 
the errors in it before passing to NSXMLParser  :(

___

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

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

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

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


Re: NSView Docs. Was: Binding -- or not -- a button created in code

2010-07-09 Thread Sean McBride
On Thu, 8 Jul 2010 15:01:19 -0700, Jerry Krinock said:

>Well, I'm still using -[NSView viewWillMoveToWindow:] to remove my
>observers and unbind my bindings, with no problems.  But I'm still
>scared that someday it might not be invoked when a window is closed.  So
>I filed a bug on the documentation.
>
>Problem ID: 8172493
>
>Title: -[NSView viewWillMoveToWindow:] always invoked when closed?

mmalc has some comments on unbinding here:


Note that if you use NSView's fullscreen method, viewWillMoveToSuperview
is invoked with a nil parameter. :(

I filed  about this.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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: Another basic CoreData question

2010-07-09 Thread Keary Suska
On Jul 9, 2010, at 6:12 AM, Jerry Krinock wrote:

> An interesting question is how this happens in the DepartmentAndEmployees 
> sample code.  When I create a document with an employee, save the file and 
> dump it with sqlite3, it appears that the Employee is related to the 
> Department.  But I looked at that code for a few minutes yesterday and can't 
> see how it happened.  The only time that an Employee is set to a Department 
> or vice versa is in the -paste method, but that doesn't run.  Does anyone 
> know?

Any actions on the employee array controller are manipulating the employees 
relationship of department, so it is handled automagically by CD. Do you mean 
other than that?

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: Another basic CoreData question

2010-07-09 Thread Sean McBride
On Fri, 9 Jul 2010 05:12:10 -0700, Jerry Krinock said:

>>> Using the standard Employee/Department example, Whats the best way to
>set a default department for an Employee?
>>> So that every employee is created with a relationship to the
>"mailRoom" department.
>>
>> Probably to add some custom code to AwakeFromInsert in your employee
>NSManagedObjectSubclass to set its own department.
>
>Yes, that works.

Agreed, but it can be tricky.  How, from Employee's awakeFromInsert, do
you get the default Department?  One way would be to fetch.  I do this
and it's generally fine, except for a bug in NSArrayController:

6723165 fetching in awakeFromInsert causes 2 notifications to
NSArrayController

Looks like this is actually mentioned in awakeFromInsert's docs now.  Nice!

So if you have a tableview (bound to an array controller) of Employees,
adding a new Employee will result in two items in the table (but not
your model).

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


CIFilter does not strongly reference its name, resulting in crash when using garbage collection

2010-07-09 Thread Michal Antonic
Hi,
it seems to me that CIFilter does not strongly reference its own name. When 
using garbage collection, sometimes the name gets collected prematurely, 
resulting in crashes.

This problem manifests itself perhaps most clearly when trying to use a 
CIFilter that has been encoded to XIB and then decoded.

Using the debugger just after decoding from XIB gets me this:

(gdb) info gc-roots (void*)[filter name]
Number of roots: 0
(gdb) info gc-roots filter
Number of roots: 3

[filter name] has no references, but filter has 3. This seems like a bug, as it 
leads to crashes and CIFilter should clearly own its name. I filed a bug for 
this with ID 8173658.

Are there any bullet-proof workarounds, aside from not encoding the CIFilter at 
all, but instead creating it programmatically and referencing its name object 
from elsewhere?

Miso___

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


EPUB

2010-07-09 Thread Gerd Moe-Behrens
How do I display an EPUB/XHTML file in UIWebView?


Thanks in advance for your help.
Best
Gerd

Sent from my iPad
___

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: Another basic CoreData question

2010-07-09 Thread gumboots
Thanks for the help guys. I have this working now, along with the double items. 
Is there any way to avoid/workaround this problem. Or rather another way to get 
a reference to the departments?
Cheers
Rob


On 10/07/2010, at 2:26 AM, Sean McBride wrote:

> On Fri, 9 Jul 2010 05:12:10 -0700, Jerry Krinock said:
> 
 Using the standard Employee/Department example, Whats the best way to
>> set a default department for an Employee?
 So that every employee is created with a relationship to the
>> "mailRoom" department.
>>> 
>>> Probably to add some custom code to AwakeFromInsert in your employee
>> NSManagedObjectSubclass to set its own department.
>> 
>> Yes, that works.
> 
> Agreed, but it can be tricky.  How, from Employee's awakeFromInsert, do
> you get the default Department?  One way would be to fetch.  I do this
> and it's generally fine, except for a bug in NSArrayController:
> 
> 6723165 fetching in awakeFromInsert causes 2 notifications to
> NSArrayController
> 
> Looks like this is actually mentioned in awakeFromInsert's docs now.  Nice!
> 
> So if you have a tableview (bound to an array controller) of Employees,
> adding a new Employee will result in two items in the table (but not
> your model).
> 
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
> 
> 
> ___
> 
> 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/gumboots%40mac.com
> 
> This email sent to gumbo...@mac.com

___

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

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

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

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


Re: Custom control and cells

2010-07-09 Thread Corbin Dunn

On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:

> Hi,
> 
> I try to find an example on how to implement the mouse tracking and editing 
> behavior of a NSCell from my own control (subclass of NSControl). I need a 
> control that can handle several kinds of cells like ImageAndTextCell (with 
> editing) or popup button cells.
> 
> I read a lot about it but can’t fit it together.

It is probably easiest to just use controls that contain the cells, and not try 
to make your control directly use multiple cells. With today's hardware, the 
performance gains are not worth the extra coding effort.

corbin



___

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


Detecting 'nop' clicks on an NSPopUpButton?

2010-07-09 Thread Sean McBride
Hi all,

If the user clicks a popup button and reselects the existing selection,
the button still sends its action.  I'd like to treat that as a nop.

Is there a way to detect, from my action method, that the new selection
is the same as the previous selection?

(I can of course do this by checking if the change of state that I would
perform is no different than the current state, but that check would be
different for every popup action I have.  I'm hoping for something I can
apply more universally.  And the reason I want to treat it as a nop is
to prevent the creation of undo actions that don't do anything useful.)

Thanks,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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: Another basic CoreData question

2010-07-09 Thread Sean McBride
On Sat, 10 Jul 2010 05:22:46 +1200, gumbo...@mac.com said:

>Thanks for the help guys. I have this working now, along with the double
>items. Is there any way to avoid/workaround this problem. Or rather
>another way to get a reference to the departments?

The workaround is to not fetch in awakeFromInsert. :(  Say you have a
'Create Employee' push button.  You can implement an action method for
it, and in there a new Employee Managed Object, fetch the Department,
and connect them.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


trapping each iteration of run loop?

2010-07-09 Thread Scott Ribe
Is there any way to get some code to run after each event processed? (This is 
for debugging, not subverting the UI in some strange way.) I don't really want 
to just use NSTimer, because I don't want this code running continuously when 
the app is otherwise idle. 

-- 
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: Another basic CoreData question

2010-07-09 Thread Jerry Krinock

On 2010 Jul 09, at 07:19, Keary Suska wrote:

> On Jul 9, 2010, at 6:12 AM, Jerry Krinock wrote:
> 
>> An interesting question is how this happens in the DepartmentAndEmployees 
>> sample code.  When I create a document with an employee, save the file and 
>> dump it with sqlite3, it appears that the Employee is related to the 
>> Department.  But I looked at that code for a few minutes yesterday and can't 
>> see how it happened.  The only time that an Employee is set to a Department 
>> or vice versa is in the -paste method, but that doesn't run.  Does anyone 
>> know?
> 
> Any actions on the employee array controller are manipulating the employees 
> relationship of department, so it is handled automagically by CD. Do you mean 
> other than that?

No wonder I didn't find it.  I only searched the code.  As you noted, 
Employees' array controller's Content Set is bound to Department Controller.

Foiled again by hidden settings in Interface Builder!  Sometimes I think I 
should stop using Interface Builder and do everything in code until Apple 
extends Xcode's Project Find to include xib 
files.___

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

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

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

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


Re: NSView Docs. Was: Binding -- or not -- a button created in code

2010-07-09 Thread Jerry Krinock

On 2010 Jul 09, at 07:19, Sean McBride wrote:

> mmalc has some comments on unbinding here:
> 

I wonder if mmalc saw any advantage to using -viewWillMoveToSuperview: vs. 
-viewWillMoveToWindow: for unbinding/unobserving?  It seems like they'd both do 
about the same thing.

> Note that if you use NSView's fullscreen method ...

Arghhh.  I'll put that in the "If we don't leave a few bugs for later we could 
never ship anything" pile.___

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: trapping each iteration of run loop?

2010-07-09 Thread Abhinay Kartik Reddyreddy
I think  CFRunLoopObserver is what you are looking for. 

http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CFRunLoopObserverRef/Reference/reference.html

-Kartik

On Jul 9, 2010, at 4:14 PM, Scott Ribe wrote:

> Is there any way to get some code to run after each event processed? (This is 
> for debugging, not subverting the UI in some strange way.) I don't really 
> want to just use NSTimer, because I don't want this code running continuously 
> when the app is otherwise idle. 
> 
> -- 
> 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/karthikreddy09%40gmail.com
> 
> This email sent to karthikredd...@gmail.com

___

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

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

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

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


Re: NSView Docs. Was: Binding -- or not -- a button created in code

2010-07-09 Thread Sean McBride
On Fri, 9 Jul 2010 13:38:36 -0700, Jerry Krinock said:

>> mmalc has some comments on unbinding here:
>> 
>
>I wonder if mmalc saw any advantage to using -viewWillMoveToSuperview:
>vs. -viewWillMoveToWindow: for unbinding/unobserving?  It seems like
>they'd both do about the same thing.

My memory is fuzzy, but it might have had to do with GC.  IIRC,
viewWillMoveToWindow:nil is sent to a view during a window's
finalization... ah, here's what I was thinking of:



Anyway, I previously used a DTS incident and talked to people at WWDC
about all this.  The conclusion was: on 10.5, an NSView's finalize is
always called on the main thread, so you can safely call
removeObserver:forKeyPath: to undo KVO started previously.  In 10.6, kvo
is done with weak referencing, so you don't have anything you need to do.

>> Note that if you use NSView's fullscreen method ...
>
>Arghhh.  I'll put that in the "If we don't leave a few bugs for later we
>could never ship anything" pile.

:) In my case it was a big deal, because full screen is an important feature.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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: trapping each iteration of run loop?

2010-07-09 Thread Scott Ribe
Yes, exactly, thanks!

You'd think after all this time I'd know to replace NS with CF in the 
documentation browser when I don't see a way to do something... But n...

On Jul 9, 2010, at 2:38 PM, Abhinay Kartik Reddyreddy wrote:

>  think  CFRunLoopObserver is what you are looking for. 


-- 
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: Setting focus on NSSearchField...

2010-07-09 Thread Lorenzo Thurman

-It's better now and the menu stays after a --slight flickering

In case no one has responded to the flickering issue yet (on 10.5?).  
It may be a known bug. You'll have to disable screen updates just  
before the call that causes the flickering. And re-enable it just  
after. I think the macros are called NSDisableScreenUpdates/

NSEnableScreenUpdates  (it's been a while).
The important thing to note is that you must reenable screen updates  
within 1 sec or the OS will do it itself. HTH


--"My break-dancing days are over, but there's always the funky chicken"
The Full Monty

On Jul 8, 2010, at 5:03 PM, cocoa-dev-requ...@lists.apple.com wrote:


It's better now and the menu stays after a slight flickering

___

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: Custom control and cells

2010-07-09 Thread Georg Seifert
Hi,
The thing is, I want to replicate the NSCollectionView but using cells instead 
of views. The NSCollectionView has a lot of problems like performance  and I 
couldn’t find a way to get the rect of the view of an item (both fixed in Snow 
Leopard but I have to support Leopard).

It would be interesting anyway if I could implement my own controls.

Best
Georg
> 
> On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
> 
>> Hi,
>> 
>> I try to find an example on how to implement the mouse tracking and editing 
>> behavior of a NSCell from my own control (subclass of NSControl). I need a 
>> control that can handle several kinds of cells like ImageAndTextCell (with 
>> editing) or popup button cells.
>> 
>> I read a lot about it but can’t fit it together.
> 
> It is probably easiest to just use controls that contain the cells, and not 
> try to make your control directly use multiple cells. With today's hardware, 
> the performance gains are not worth the extra coding effort.
> 
> corbin
> 
> 

___

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: Custom control and cells

2010-07-09 Thread Michael Watson
In what way do you believe a custom NSCell-based replication of 
NSCollectionView will perform better than NSCollectionView itself? What 
performance issue have you seen? Are you sure the problem lies with 
NSCollectionView and not your own code surrounding it? (I.e., have you Sharked 
your application?)


--
michael

On 09 Jul, 2010, at 15:22, Georg Seifert wrote:

> Hi,
> The thing is, I want to replicate the NSCollectionView but using cells 
> instead of views. The NSCollectionView has a lot of problems like performance 
>  and I couldn’t find a way to get the rect of the view of an item (both fixed 
> in Snow Leopard but I have to support Leopard).
> 
> It would be interesting anyway if I could implement my own controls.
> 
> Best
> Georg
>> 
>> On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
>> 
>>> Hi,
>>> 
>>> I try to find an example on how to implement the mouse tracking and editing 
>>> behavior of a NSCell from my own control (subclass of NSControl). I need a 
>>> control that can handle several kinds of cells like ImageAndTextCell (with 
>>> editing) or popup button cells.
>>> 
>>> I read a lot about it but can’t fit it together.
>> 
>> It is probably easiest to just use controls that contain the cells, and not 
>> try to make your control directly use multiple cells. With today's hardware, 
>> the performance gains are not worth the extra coding effort.
>> 
>> corbin
>> 
>> 
> 
> ___
> 
> 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/mikey-san%40bungie.org
> 
> This email sent to mikey-...@bungie.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


NSPreferencePane and sheets

2010-07-09 Thread Dave DeLong
Hi everyone,

I'm working on a preference pane and am having issues getting some sheets to 
work.

I have a button that executes:

NSOpenPanel * open = [NSOpenPanel openPanel];
//basic configuration
[NSApp beginSheet:open modalForWindow:[[self mainView] window] delegate:self 
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];

My sheetDidEnd: selector basically retrieves the filenames out of the open 
panel.

When I do this, I get an open panel sliding out of System preferences, but the 
browser area is blank. Everything is collapsed, and selecting folders in my 
Places or Devices groups doesn't show anything in the browser.

When I click "OK" or "Cancel", the sheet goes away, but the ending selector 
never fires.

In addition, the next time I click the button, the action fires, but the sheet 
never appears.

Is there something special I need to be doing to get sheets working?  (I'll 
also add that using runModal instead works properly, but I'd like to use the 
sheet as I feel it would fit better in the UI than a modal window)

Thanks,

Dave

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Re: NSPreferencePane and sheets

2010-07-09 Thread Dave DeLong
Here's some clarification (since I realize my original question may not have 
made very much sense):

I have a button on an NSPreferencePane that executes the following code:

NSOpenPanel * open = [NSOpenPanel openPanel];
//basic configuration
[NSApp beginSheet:open modalForWindow:[[self mainView] window] delegate:self 
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];

When I click the button to execute this code, I get a sheet that looks like 
this:

http://gallery.me.com/davedelong#100084/Screen%20shot%202010-07-09%20at%205.34.22%20PM&bgcolor=black

You'll notice that everything is collapsed at the the file browser area is 
blank.  When I try to navigate to a part of the file system within the panel, 
nothing shows up in the browser area.  For example:

http://gallery.me.com/davedelong#100084/Screen%20shot%202010-07-09%20at%205.34.37%20PM&bgcolor=black

- When I click the "OK" or "Cancel" button, the sheet disappears, but the 
didEndSelector (as specified above) is never executed.
- When I click the original button again (to re-open the sheet), the button's 
action executes (verifiable via logging, breakpoints, etc), but the sheet never 
opens.
- If I change the NSOpenPanel to display as a modal window (-[NSOpenPanel 
runModal]) instead of as a sheet, everything works as expected.


Summary:  something is wrong with my sheet when I use it from within an 
NSPreferencePane.
Question:  what's going on, and how do I fix it?


Thanks,

Dave

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

[iOS] How to test iAd enabled apps

2010-07-09 Thread Meik Schuetz
Hello,
while testing my iAd enabled app on my device the delegate method 
didFailToReceiveAdWithError is called with the error 'Invalid app id/account 
information'. I'd like to make sure that everything works fine before I submit 
the app for review. Is there anyway that I can test, even having the test 
banner, like in the simulator?

Thanks a lot
Meik

___

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: Custom control and cells

2010-07-09 Thread Georg Seifert
Hi,

> In what way do you believe a custom NSCell-based replication of 
> NSCollectionView will perform better than NSCollectionView itself? What 
> performance issue have you seen? Are you sure the problem lies with 
> NSCollectionView and not your own code surrounding it? (I.e., have you 
> Sharked your application?)

I have Sharked it a lot.

I have bound the CollectionView to a array with several hundred to several 
thousand items. There is a sidebar which filters the content, displaying a 
small subset of the content. Every time I change the filter, all previously not 
visible views are recreated. This may take several seconds. I could mostly 
avoid this by caching the item and the view (jumping through holes to find out 
how to do so). One half of the initial loading of the document is taken from 
the NSCollectionView. 

So the main problem is the time the CollectionView needs to archive and 
deserialize the item view prototype (I even improved this by creating the view 
in code in newItemForRepresentedObject:).

I just Sharked it and stoped the time again (on Snow Leopard) and it turns out 
that my optimization does work very well, taking the time to initiate the 
collectionview from 1 second to <0.1 sec. But the optimization does only work 
on SL. So all my users with Leopard and PowerPCs (there are several still using 
them) have to wait.

Saving of the collectionViewItems in the data object (This was one of the holes 
I jumped through), albite not working to cache the items in Leopard, can be 
used to get the frame of the view for the item in Leopard. Or is there a (even 
private) method to get this directly from the collectionView? (I have to check 
for the systems version number anyway)

Georg

> 
> 
> --
> michael
> 
> On 09 Jul, 2010, at 15:22, Georg Seifert wrote:
> 
>> Hi,
>> The thing is, I want to replicate the NSCollectionView but using cells 
>> instead of views. The NSCollectionView has a lot of problems like 
>> performance  and I couldn’t find a way to get the rect of the view of an 
>> item (both fixed in Snow Leopard but I have to support Leopard).
>> 
>> It would be interesting anyway if I could implement my own controls.
>> 
>> Best
>> Georg
>>> 
>>> On Jul 7, 2010, at 4:14 AM, Georg Seifert wrote:
>>> 
 Hi,
 
 I try to find an example on how to implement the mouse tracking and 
 editing behavior of a NSCell from my own control (subclass of NSControl). 
 I need a control that can handle several kinds of cells like 
 ImageAndTextCell (with editing) or popup button cells.
 
 I read a lot about it but can’t fit it together.
>>> 
>>> It is probably easiest to just use controls that contain the cells, and not 
>>> try to make your control directly use multiple cells. With today's 
>>> hardware, the performance gains are not worth the extra coding effort.
>>> 
>>> corbin
>>> 
>>> 
>> 
>> ___
>> 
>> 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/mikey-san%40bungie.org
>> 
>> This email sent to mikey-...@bungie.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: NSPreferencePane and sheets

2010-07-09 Thread Michael Ash
On Fri, Jul 9, 2010 at 7:21 PM, Dave DeLong  wrote:
> Hi everyone,
>
> I'm working on a preference pane and am having issues getting some sheets to 
> work.
>
> I have a button that executes:
>
> NSOpenPanel * open = [NSOpenPanel openPanel];
> //basic configuration
> [NSApp beginSheet:open modalForWindow:[[self mainView] window] delegate:self 
> didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) 
> contextInfo:NULL];

You need to use the NSOpenPanel method
beginSheetForDirectory:file:types:modalDelegate:contextInfo:. By
bypassing that method, you are probably bypassing a bunch of important
setup code which causes the sheet to not work correctly.

Mike
___

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: Custom control and cells

2010-07-09 Thread Michael Ash
On Fri, Jul 9, 2010 at 6:22 PM, Georg Seifert  wrote:
> Hi,
> The thing is, I want to replicate the NSCollectionView but using cells 
> instead of views. The NSCollectionView has a lot of problems like performance 
>  and I couldn’t find a way to get the rect of the view of an item (both fixed 
> in Snow Leopard but I have to support Leopard).

If I were writing this today, I would use views. I would make it so
that it only had enough subviews to occupy the currently visible area.
The rest of the collection view would be empty. As the user scrolled,
I would create new views for the newly exposed items and add them
dynamically. If view creation is too slow for this, I would implement
some sort of view reuse mechanism that could load new data into the
views that have scrolled off screen. This is basically how UITableView
works on the iPhone, and if it can get good performance on that
platform, you ought to be able to do great on any Mac that can run OS
X.

Mike
___

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 NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Matt James
Hi all,

In the WWDC session "Mastering Core Data", it was recommended to subclass 
NSManagedObject, which I'm doing.  Not only does this follow their 
recommendation, but it's also helpful for coding additional logic that might be 
appropriate on a per-model basis.  What I don't understand, however, is how to 
fetch those subclassed objects from the managed object context.

As an example, let's say I have PersonModel which extends NSManagedObject and, 
for me, represents a "Person" entity.  When I run a fetch for Person entities, 
I get back NSManagedObjects.  That's fine, but I'm unable to make use of any 
custom logic I have on the PersonModel class.

I'm new to Core Data, so I may very well be misunderstanding the 
recommendations or be doing things in a screwy manner.  Please straighten me 
out!

Thanks for any help.

-Matt James
http://www.macyenta.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: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Roland King
Your model (xcdatamodel) says what class is used for each entity, you have that 
set to the name of your custom class, right? If so it will give you the correct 
object type when you insert or retrieve it. 

executeFetchRequest:error: in NSManagedObjectContext will return an NSArray() 
of the correct subclasses of NSManagedObject. If you're using methods which are 
documented to return NSManagedObject*(s) [ can't think of one offhand ] that 
should also be actually returning the correct subclass, you just need to cast. 

On 10-Jul-2010, at 12:29 PM, Matt James wrote:

> Hi all,
> 
> In the WWDC session "Mastering Core Data", it was recommended to subclass 
> NSManagedObject, which I'm doing.  Not only does this follow their 
> recommendation, but it's also helpful for coding additional logic that might 
> be appropriate on a per-model basis.  What I don't understand, however, is 
> how to fetch those subclassed objects from the managed object context.
> 
> As an example, let's say I have PersonModel which extends NSManagedObject 
> and, for me, represents a "Person" entity.  When I run a fetch for Person 
> entities, I get back NSManagedObjects.  That's fine, but I'm unable to make 
> use of any custom logic I have on the PersonModel class.
> 
> I'm new to Core Data, so I may very well be misunderstanding the 
> recommendations or be doing things in a screwy manner.  Please straighten me 
> out!
> 
> Thanks for any help.
> 
> -Matt James
> http://www.macyenta.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/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: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Matt James
Wow, thank you so much.  I have no idea how I missed the "Class" column in the 
xcdatamodel's UI.  From what I saw, none of the tutorials mentioned doing this 
either.  Maybe I was reading the newbie stuff where they didn't get into fun 
stuff like that.

Again, thanks a TON!

-Matt

On Jul 10, 2010, at 12:57 AM, Roland King wrote:

> Your model (xcdatamodel) says what class is used for each entity, you have 
> that set to the name of your custom class, right? If so it will give you the 
> correct object type when you insert or retrieve it. 
> 
> executeFetchRequest:error: in NSManagedObjectContext will return an NSArray() 
> of the correct subclasses of NSManagedObject. If you're using methods which 
> are documented to return NSManagedObject*(s) [ can't think of one offhand ] 
> that should also be actually returning the correct subclass, you just need to 
> cast. 
> 
> On 10-Jul-2010, at 12:29 PM, Matt James wrote:
> 
>> Hi all,
>> 
>> In the WWDC session "Mastering Core Data", it was recommended to subclass 
>> NSManagedObject, which I'm doing.  Not only does this follow their 
>> recommendation, but it's also helpful for coding additional logic that might 
>> be appropriate on a per-model basis.  What I don't understand, however, is 
>> how to fetch those subclassed objects from the managed object context.
>> 
>> As an example, let's say I have PersonModel which extends NSManagedObject 
>> and, for me, represents a "Person" entity.  When I run a fetch for Person 
>> entities, I get back NSManagedObjects.  That's fine, but I'm unable to make 
>> use of any custom logic I have on the PersonModel class.
>> 
>> I'm new to Core Data, so I may very well be misunderstanding the 
>> recommendations or be doing things in a screwy manner.  Please straighten me 
>> out!
>> 
>> Thanks for any help.
>> 
>> -Matt James
>> http://www.macyenta.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/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