Re: Build and Archive fails due to missing dSYM file

2010-12-16 Thread jonat...@mugginsoft.com

On 16 Dec 2010, at 07:22, Graham Cox wrote:

 Hi all,
 
 I'm trying to use Build and Archive to prepare an app for submission to the 
 Mac App Store.
 
 It fails because it is unable to copy the dSYM file to the archive. The error 
 suggests that the format needs to be DWARF with dSYM, but that is indeed what 
 I am using.
 
 When I build in Debug configuration, a dSYM file is created with the app, but 
 in Release config, it is not. Yet both projects have exactly the same build 
 settings in this respect, so I'm not sure what's going on. Both projects have 
 'Generate debug symbols' on, and both have 'DWARF with dSYM' as the format.
 
 There is presumably some other magic flag I need to ensure I generate the 
 dSYM file in the Release config, but I'm at a a loss. I've searched the net 
 for this problem and understand what the file is for and why it's part of the 
 archive, but haven't found anything that sheds light on the file not getting 
 created in the first place.
 
 --Graham
 
Presumably you have checked that the target level settings for the release 
build have not been modified to override the project level settings.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com___

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

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

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

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


Core data - binding related problem in NSNumberFormatter and NSDatePicker

2010-12-16 Thread Devarshi Kulshreshtha
Hi Pat,

Regarding:

For #1, you have an non-ascii character at the front of the number formatter
 (in IB).


It is now working correctly when I am entering the price with $ symbol
prefixed, eg. $123,00 :)

I think that this is not user intuitive, user may not always know that he/
she has to prefix dollar symbol. I think it would have been good if:

1. I can somehow change the alert message which now says - Formatting
Error to You should prefix dollar symbol.

2. Numberformatter can automatically prefix the '$' symbol to the entered
decimal number.

Do you know any way to implement these?

 For #2, you are only actually setting the value of the selected car.
  However the value of the date (if you don't purposefully set it) is nil,
 and the Date Picker is not displaying a value for nil, so it is leaving the
 value in there.  Try adding two cars, and setting a value for each car.
  Then it will change for each selection.  I discovered this by adding a text
 field, setting a date formatter on the text field, and binding the text
 field to the same binding as the date picker.


Your interpretation is correct, when I set the default value of
datePurchased attribute to some value say- 2010-12-10 in
MyDocument.xcdatamodel, it started working as intended.

So I am now thinking that can we set the default value to today's date in
xcdatamodel?

Also when I tried adding two or more cars and change their data value, I got
the same problem. I used date-picker according to my requirements.

-- 
Thanks,

Devarshi



-- 
Thanks,

Devarshi
___

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: Re: How to read a text file over a network

2010-12-16 Thread Abhijeet Singh
Thanks ... It worked (/Volumes/{name of disk as it appears in the Finder} 
)RegardsAbhijeet Original message From:Nick Zitzmann n...@chronosnet.com 
Date: 14 Dec 10 12:38:27Subject: Re: How to read a text file over a networkTo: 
Cc: cocoa...@lists.apple.comon Dec 13, 2010, at 10:12 PM, Abhijeet Singh 
wrote: I think the type of server is AFP. Because the file path displayed by 
Finder is: afp://PriyankaMac.afpovertcp.tcp.local/shared/file1.txt. But if i 
put the same file path in my file2.txt my program fails to open file1.txt 
file.That's most likely because that's an afp: URL, and you need to use file: 
URLs with NSURL, etc. Once the disk is mounted, its path will start with 
/Volumes/{name of disk as it appears in the Finder} in the general case, but if 
a volume with the same name is mounted, then its path will most likely be 
slightly different, so you might need to use the DiskArbitration framework in 
order to get a good path...Nick ZitzmannGet Yourself a cool, short @in.com
  Email ID now!
___

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

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

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

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


Re: Core data - binding related problem in NSNumberFormatter and NSDatePicker

2010-12-16 Thread Andreas Grosam

On Dec 16, 2010, at 11:38 AM, Devarshi Kulshreshtha wrote:

 Hi Pat,
 
 Regarding:
 
 For #1, you have an non-ascii character at the front of the number formatter
 (in IB).
Guess, ¤ (\u00A4) is the localized currency symbol defined in the 
International Components for Unicode Library (ICU) 
http://unicode.org/reports/tr35/tr35-6.html#Number_Format_Patterns  - and a 
valid character. But admittedly, it looks strange. ;)

 
 It is now working correctly when I am entering the price with $ symbol
 prefixed, eg. $123,00 :)
According your project, you use a *localized* currency number formatter (in IB 
there is a check-box where you can set/unset this). The currency symbol must 
then match those defined in your current locale. That is, $123.00 works only 
if your currency symbol for your current locale is $ as well. You probably 
don't want this behavior, since on any other computer, the currency symbol can 
be different - for example on my Mac I would have to type € for the symbol.


 
 I think that this is not user intuitive, user may not always know that he/
 she has to prefix dollar symbol. I think it would have been good if:
 
 1. I can somehow change the alert message which now says - Formatting
 Error to You should prefix dollar symbol.
 
 2. Numberformatter can automatically prefix the '$' symbol to the entered
 decimal number.
 
 Do you know any way to implement these?
Since I don't know what IB is doing exactly, do it programmatically. Here is 
the code which may solve your issue: 

NSNumberFormatter* priceFormatter = [[NSNumberFormatter alloc] init];
[priceFormatter setFormat:@$#,##0.00;$0;-$#,##0.00];
[priceField setFormatter: priceFormatter];
[priceFormatter release];

Note that, here in this example, the currency symbol is fixed and equals to 
$. 
It is not required to explicitly type the currency symbol, eg.: 123 - 
$123.00 Parsing works also if you type it in correctly say, $123 - $123.00.



Regards

Andreas___

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


App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Andreas Grosam
Hi All,

An application (NSApplication) will not terminate if an exception is thrown:, 
eg:


- (void) applicationDidFinishLaunching:(NSNotification*)notification 
{
   NSAssert(0, @failed);
}

or 

- (IBAction) buttonPressed:(id) sender
{
   [self throwFatalError];  // throws NSException
}

The application will continue to run. Please note, that even after an NSAssert 
that fails, the app happily keeps going! It looks like, the application's event 
handler logs a message and then carries on. As a consequence, the uncaught 
exception handler will not be called, since apparently the exception is 
considered handled just by catching it.

In Cocoa, exceptions are considered fatal errors, and code is usually not 
exception safe. That is, after catching an exception, it is very probable that 
the application state is corrupted and can not be restored. So, is continuing 
the app after an uncaught exception occurred expected behavior? Shouldn't the 
default behavior in Cocoa cause the app to terminate as soon as possible?

NSApplicationDelegate does not have methods to deal with (so far) uncaught 
exceptions. And even if, we couldn't generally recover from exceptions anyway. 
However, a delegate method would be useful where the app signals within its 
event handler that an uncaught exception has been occurred. Then, in the 
delegate, it would be possible to perform last minute things and terminate - or 
going on as we desire.

But since there is no such delegate method, how can I change the default 
behavior?
Do I have to override NSApplication's -run method in order to terminate after 
an uncaught exception, and if yes, how? 

Additional note: I found another proposed solution in stackoverflow: 
http://stackoverflow.com/questions/3336278/why-is-raising-an-nsexception-not-bringing-down-my-application
 which suggest to add categories to NSApplication which replaces the original 
method -reportException: and requires a few other methods to be implemented. 
But this looks pretty awkward to me.

Any other suggestions?


Regards
Andreas

___

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


what's the correct key path to observe for a BOOL property?

2010-12-16 Thread Roland King
If I have a property foo and it's boolean and has the getter/setter 
isFoo/setFoo:, what's the correct key path to observe for KVO, assuming default 
automatic KVO generation as provided by NSObject, is it 'foo', or is it 
'isFoo'? 

It seemed to me that the method which triggers automatic KVO (setFoo:) only 
knows about its own signature and so would send a KVO notification for key path 
'foo'. However NSOperation (for one) is documented to 'be KVO compliant for the 
property isFinished' and indeed you have to observe 'isFinished' if you want 
notifications. 

If indeed the default KVO code generates notifications for 'foo' should you, if 
you have a boolean property using the 'isXXX' syntax, avoid default KVO and 
trigger your own property changes for isXXX? 
___

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


NSView setAlphaValue question

2010-12-16 Thread Rick C.
Hello again,

In my project I have a main window with a table view which displays filenames 
before further processing.  The table view accepts drops and all is working as 
expected.  About a week ago I had the idea to slap a view on top that says 
Drop files here and fades in/out and basically it's just visible when there's 
nothing in my table view.  So I had that working too until I realized in 
Leopard the view won't accept setAlphaValue unless I tick the box in IB for 
core animation.  So I did tick the box for window view and it worked but it 
broke a lot of subsequent UI functions/processing.  I don't know if that's 
enough info for an answer but what can I do to avoid subsequent issues by using 
core animation?  A number of buttons and a progress indicator no longer 
functions on my main window after ticking the core animation box in IB.  Funny 
enough on a PPC machine it didn't seem to cause a problem but on an Intel Mac 
with Leopard it made my app unusable...

Thanks for the advice,

rc___

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: what's the correct key path to observe for a BOOL property?

2010-12-16 Thread Ken Thomases
On Dec 16, 2010, at 7:45 AM, Roland King wrote:

 If I have a property foo and it's boolean and has the getter/setter 
 isFoo/setFoo:, what's the correct key path to observe for KVO, assuming 
 default automatic KVO generation as provided by NSObject, is it 'foo', or is 
 it 'isFoo'? 

It's foo.  The key is the name of the property.  The names of the methods can 
be derived from the key via a number of templates described in the KVC and KVO 
documentation.  One of them is isKey, which should make it clear that the 
is is not part of the key.


 It seemed to me that the method which triggers automatic KVO (setFoo:) only 
 knows about its own signature and so would send a KVO notification for key 
 path 'foo'.

Well, setFoo: doesn't have to know what key to generate a change notification 
for.  Things start at the other end.  Something adds a KVO observer to your 
object using a particular key.  The setter to hook into is determined from that 
key, but there's nothing preventing KVO from remembering the original key from 
which it derived the setter name.  I kind of doubt that it reverse engineers 
the key from the method name.

 However NSOperation (for one) is documented to 'be KVO compliant for the 
 property isFinished' and indeed you have to observe 'isFinished' if you want 
 notifications.

True.  I find this to be an awkward, non-standard aspect of NSOperation 
(especially since I once re-implemented my own version for Tiger 
compatibility).  NSOperation does not have a finished property.  It has an 
isFinished property.

Of course, it doesn't have any setter for that property, which avoids the weird 
setIsFinished: method name.  It also means it's not a counter-example to your 
(correct) understanding that your setFoo: method would generate notifications 
for the foo key.


 If indeed the default KVO code generates notifications for 'foo' should you, 
 if you have a boolean property using the 'isXXX' syntax, avoid default KVO 
 and trigger your own property changes for isXXX? 

No.  There's no need to disable KVO's automatic notifications for this case, 
and you don't want the notifications to go out under key isXXX.

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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Nick Zitzmann

On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:

 In Cocoa, exceptions are considered fatal errors, and code is usually not 
 exception safe.

[citation needed]

 That is, after catching an exception, it is very probable that the 
 application state is corrupted and can not be restored. So, is continuing the 
 app after an uncaught exception occurred expected behavior? 

Yes.

 Shouldn't the default behavior in Cocoa cause the app to terminate as soon as 
 possible?

No.

 But since there is no such delegate method, how can I change the default 
 behavior?
 Do I have to override NSApplication's -run method in order to terminate after 
 an uncaught exception, and if yes, how? 

See 
https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniAppKit/OAApplication.m
 for one such example.

Nick Zitzmann
http://www.chronosnet.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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Jean-Daniel Dupas

Le 16 déc. 2010 à 17:32, Nick Zitzmann a écrit :

 
 On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:
 
 In Cocoa, exceptions are considered fatal errors, and code is usually not 
 exception safe.
 
 [citation needed]
 

From Introduction to Exception Programming Topics for Cocoa

“Important: You should reserve the use of exceptions for programming or 
unexpected runtime errors such as out-of-bounds collection access, attempts to 
mutate immutable objects, sending an invalid message, and losing the connection 
to the window server. You usually take care of these sorts of errors with 
exceptions when an application is being created rather than at runtime.

If you have an existing body of code (such as third-party library) that uses 
exceptions to handle error conditions, you may use the code as-is in your Cocoa 
application. But you should ensure that any expected runtime exceptions do not 
escape from these subsystems and end up in the caller’s code. For example, a 
parsing library might use exceptions internally to indicate problems and enable 
a quick exit from a parsing state that could be deeply recursive; however, you 
should take care to catch such exceptions at the top level of the library and 
translate them into an appropriate return code or state.”


-- Jean-Daniel




___

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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Nick Zitzmann

On Dec 16, 2010, at 9:40 AM, Jean-Daniel Dupas wrote:

 
 Le 16 déc. 2010 à 17:32, Nick Zitzmann a écrit :
 
 
 On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:
 
 In Cocoa, exceptions are considered fatal errors, and code is usually not 
 exception safe.
 
 [citation needed]
 
 From Introduction to Exception Programming Topics for Cocoa
 
 “Important: You should reserve the use of exceptions for programming or 
 unexpected runtime errors such as out-of-bounds collection access, attempts 
 to mutate immutable objects, sending an invalid message, and losing the 
 connection to the window server. You usually take care of these sorts of 
 errors with exceptions when an application is being created rather than at 
 runtime.

Yes, but fatal errors are usually the type that can bring down the entire 
program, such as running out of memory or dividing by zero. An out-of-bounds 
exception often doesn't have to kill the program. Of course, if the developer 
wants it to kill the program, then they can override -[NSApplication run] to 
catch the exception and quit.

Nick Zitzmann
http://www.chronosnet.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: Layer hosting views, geometryFlipped, and subviews

2010-12-16 Thread David Duncan
On Dec 15, 2010, at 11:53 PM, Gideon King wrote:

 Hi, I have a layer *hosting* view which has to use the geometryFlipped option 
 so that it behaves correctly, and need to add an NSTextView subview for 
 editing sometimes, and an ordinary custom view for editing at other times.
 
 I am having trouble working out where to place the subview. It just seems to 
 end up in strange places.
 
 I have noticed also that the subview is drawing with reversed flippedness. I 
 am wondering if there is some workaround for this by either putting another 
 layer or view in between my layer and the overlay view? I have tried some 
 options but so far without success.
 
 I see that a previous question along very similar lines was asked by Kyle 
 Sluder, but there didn't appear to be any replies to his question.
 
 Any suggestions would be most welcome.


Mostly because this particular question is kinda thorny :). I think the best 
solution here is to use parallel view hierarchy that contains whatever AppKit 
views you need to add rather than trying to add them to the layer hosted tree. 
Something like this:

Layer-backed view
Layer-hosted view
layer tree
Layer-backed view
appkit views
--
David Duncan

___

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

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

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

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


Re: Layer hosting views, geometryFlipped, and subviews

2010-12-16 Thread Kyle Sluder
On Wed, Dec 15, 2010 at 11:53 PM, Gideon King gid...@novamind.com wrote:
 Hi, I have a layer *hosting* view which has to use the geometryFlipped option 
 so that it behaves correctly, and need to add an NSTextView subview for 
 editing sometimes, and an ordinary custom view for editing at other times.

Ohhh, boy. :)

After a year and a half, many Radars, and at least one DTS incident
all spent dealing with layer-backed and layer-hosting views, I can
only make the professional recommendation that you avoid using Core
Animation for anything other than a convenient OpenGL scene graph
management API. Core Animation's interaction with AppKit is simply
broken. This is not to besmirch the hard work of David Duncan, et al.,
since this is a really hard problem. But at this point, I would be
equally happy with either of the following scenarios:

1. Apple fixes layer-backed and layer-hosting views and rewrites *all*
of AppKit with Core Animation to show that it can work. That means
replacing NSCells with CALayers and otherwise factoring their drawing
along the lines that a Core Animation user (or iOS developer) would
expect.
2. Apple narrows Core Animation's scope to high-performance 2D and
pseudo-3D OpenGL scene graph management, and removes layer backing
from the API entirely. Perhaps, instead, they could focus their 2D
acceleration back on QuartzGL.

 I am having trouble working out where to place the subview. It just seems to 
 end up in strange places.

You really don't have a layer-backed view. You have a layer-hosting
view, which is what you need if you want to play around with its
layers. Adding subviews to layer-hosting views is not supported
(there's a bunch of voodoo going on behind the scenes to support naïve
use of Quartz in a layer-backed context). David's suggestion to you
was the same advice given to us: create a layer-backed peer view to
your layer-hosting view in which to host your field editor and other
ancillary views.

 I have noticed also that the subview is drawing with reversed flippedness. I 
 am wondering if there is some workaround for this by either putting another 
 layer or view in between my layer and the overlay view? I have tried some 
 options but so far without success.

Flippedness is broken. rdar://problem/8009542

That is a categorical, unequivocal statement of fact. The layer
machinery cannot deal with views that return YES from -isFlipped. If
you follow David's advice, you will find that your view will scroll in
the opposite direction as intended, and will snap to bizarre sizes
when the scroll view is resized.

The only way I have found to fix that is to swizzle NSClipView's
implementation of certain methods to call private LayerKitGlue API.
Before the announcement of the App Store, this only worried me because
it might go away or otherwise break despite our best efforts to guard
against it. But now we're threatened with rejection for violating the
terms of the Mac App Store.

You will also need to deal with other undocumented behavior that
LayerKitGlue relies upon to do its job. For example, your override of
-resizeWithOldSuperviewSize: *must* call super's implementation, even
if you specifically want to avoid super's effects.
rdar://problem/8659667 Otherwise, you will get video garbage if you
live-resize a view.

Once you've got the layer geometry kinks worked out, there are some
issues with drawing layer contents. For example, NSLayoutManager
spellchecking is entirely broken. rdar://problem/8644121 It seems to
suffer similar confusion about flippedness; it draws the underlines as
if the graphics context is not flipped. It doesn't go through the
public -drawUnderlineForGlyphRange:… API to draw the red-dotted
underlines; there's a separate private API it uses (possibly to
facilitate background thread spell checking, though we have disabled
that).

That's assuming you're able to recite the magic incantation to get
subpixel antialiased text in the first place. For obvious reasons,
subpixel antialiasing requires opaque contents in the backing store in
order to do its job correctly. But merely filling your backing store
before drawing your text is not enough; you must create your own
CGBitmapContext with
kCGImageAlphaPremultipliedFirst|kCGBitmapByteOrder32Host in which to
do your drawing. There is no documentation indicating that this
combination of flags is required for subpixel antialiased text.

And when I say merely filling your backing store, that of course
implies that you will mimic Core Animation's render process in order
to precompose the underlying layers into your opaque text-carrying
layers' backing stores, thus negating much of the benefit of using
Core Animation in the first place. And you will need to go through
great pains to match color spaces, or else your precomposed version of
colors will differ slightly but noticeably from that used by Core
Animation. There's no documentation about what color space Core
Animation operates in, but I think we've worked it out 

Re: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Andreas Grosam
On Dec 16, 2010, at 5:32 PM, Nick Zitzmann wrote:
 See 
 https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniAppKit/OAApplication.m
  for one such example.
Thank you very much, this is exactly what I'm looking for! :)


On Dec 16, 2010, at 5:55 PM, Nick Zitzmann wrote:
 
 On Dec 16, 2010, at 9:40 AM, Jean-Daniel Dupas wrote:
 
 Le 16 déc. 2010 à 17:32, Nick Zitzmann a écrit :
 
 On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote:
 
 In Cocoa, exceptions are considered fatal errors, and code is usually not 
 exception safe.
 
 [citation needed]
 
 From Introduction to Exception Programming Topics for Cocoa
 
 “Important: You should reserve the use of exceptions for programming or 
 unexpected runtime errors such as out-of-bounds collection access, attempts 
 to mutate immutable objects, sending an invalid message, and losing the 
 connection to the window server. You usually take care of these sorts of 
 errors with exceptions when an application is being created rather than at 
 runtime.
 
 Yes, but fatal errors are usually the type that can bring down the entire 
 program, such as running out of memory or dividing by zero. An out-of-bounds 
 exception often doesn't have to kill the program. Of course, if the developer 
 wants it to kill the program, then they can override -[NSApplication run] to 
 catch the exception and quit.
 
 Nick Zitzmann
 http://www.chronosnet.com/

It's not relevant whether the exception is a fatal error or (ab)used as a 
messaging mechanism. The very fact that an exception is thrown in a framework 
which is not exception-safe and the fact that this exception made its way 
through till the top of the event-handling routine makes it very likely that 
the application is left in a corrupted state.

The current behavior in Cocoa would entail a level of strong exception 
safety(see below).




From Exceptions and the Cocoa Frameworks in Apple Documentation:

The Cocoa frameworks are generally not exception-safe. The general pattern is 
that exceptions are reserved for programmer error only, and the program 
catching such an exception should quit soon afterwards.




About Exception Safety (http://en.wikipedia.org/wiki/Exception_handling):

A piece of code is said to be exception-safe, if run-time failures within the 
code will not produce ill effects, such as memory leaks, garbled stored data, 
or invalid output. Exception-safe code must satisfy invariants placed on the 
code even if exceptions occur. There are several levels of exception safety:

1) Failure transparency, also known as the no throw guarantee: Operations are 
guaranteed to succeed and satisfy all requirements even in presence of 
exceptional situations. If an exception occurs, it will not throw the exception 
further up. (Best level of exception safety.)

2) Commit or rollback semantics, also known as strong exception safety or 
no-change guarantee: Operations can fail, but failed operations are guaranteed 
to have no side effects so all data retain original values.[2]

3) Basic exception safety: Partial execution of failed operations can cause 
side effects, but invariants on the state are preserved. Any stored data will 
contain valid values even if data has different values now from before the 
exception.

4) Minimal exception safety also known as no-leak guarantee: Partial execution 
of failed operations may store invalid data but will not cause a crash, and no 
resources get leaked.

5) No exception safety: No guarantees are made. (Worst level of exception 
safety)


Regards
Andreas___

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


UINavigationController in Popover

2010-12-16 Thread Gordon Apple
I've Googled this and have seen that others have had this problem, but no
good solutions.  When using a UINavigationController in a popover, where the
content can be different sizes, the nav controller seems to always wants to
make the popover full screen height, ignoring popover size settings.  The
only way I've found to defeat it is to reset the popover size with a 0.5 sec
delayed invocation.  It works, but it's ugly.  It expands, then contracts to
the set size.  Is there any better way to do this?  (I'm still on 3.2
because I want to make sure it works there.)


___

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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread jonat...@mugginsoft.com

On 16 Dec 2010, at 19:24, Andreas Grosam wrote:

 On Dec 16, 2010, at 5:32 PM, Nick Zitzmann wrote:
 See 
 https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniAppKit/OAApplication.m
  for one such example.
 Thank you very much, this is exactly what I'm looking for! :)
 
 

This is something that has had me scratching my upper organ casing too.
The NSApplication docs state that NSApplicationMain is functionally similar to:

void NSApplicationMain(int argc, char *argv[]) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@myMain owner:NSApp];
[NSApp run];
}

Presumably it is more functionally similar to:

void NSApplicationMain(int argc, char *argv[]) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@myMain owner:NSApp];

   while(YES) {

   @try {
   [NSApp run];
   return;
   } @catch (NSException *e) {
   [NSApp reportException:e]
   }

}
}

Note that the docs also say:

The global application object uses autorelease pools in its run method; if you 
override this method, you’ll need to create your own autorelease pools.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com___

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

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

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

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


Re: Layer hosting views, geometryFlipped, and subviews

2010-12-16 Thread Gideon King
Oh wow! The voice of much pain speaking! Makes me want to cringe in the corner 
and say in a small voice but, but, but I just wanted to add a subview, sir.

I got most of the way without having to use the geometryFlipped (using a 
transform to flip coordinates) - I had seen some of your, and others' posts 
about the issues, and tried to avoid it, but my stuff kept jumping around in my 
scroll view when I changed the bounds of it and tried to keep the viewport 
stable, and I couldn't find a way to fix that. Changing to geometryFlipped 
fixed that, but introduced these other problems.

I have encountered the issue with printing, and worked around that by walking 
the drawing code as per the advice from OmniGroup. That gave me something 
workable so long as I made sure to avoid using a lot of the layer properties 
like the corner rounding, stroke and fill etc, and some of the layer classes 
like CAShapeLayer, unless I also duplicated the drawing code so that I could 
print. I did have to move away from the tiled layer as my base layer and use a 
view which draws itself, with a transparent view over the top of it to host the 
layers (which has implications for scaling etc), and a few other design 
compromises along the way. Lots of investigating and trying different things, 
but got it working well enough overall...

I could not use a layer hosting view because of the lack of ordering 
capabilities of sibling views.

One of the big reasons for going with a layer hosting view is that it allows me 
to order overlapping sibling sublayers - something critical to my application. 
Along the way, I also needed to support this for 10.5, and there were just too 
many bugs and limitations in 10.5 to be able to use layers, so I wrote my own 
NSView replacement that allows me to treat everything the same way as layers, 
and just draws the content (overlapping in the right order) into a view. This 
works fine, except that it of course doesn't make use of hardware graphics 
acceleration, so is significantly slower than the 10.6 compatible 
implementation. Seeing as only about 14% of our customers (and falling) are 
still on Leopard, I wasn't too concerned about that, but need something better 
going forward.

I had not tried adding a text view to a non-geometryFlipped layer hosting view, 
but have now tried it, and indeed you are correct about it not showing up the 
spelling checking dots, even though it does otherwise obey the positioning I 
want it.

The whole core animation stuff does feel a bit raw when you really try using 
it seriously, but at the same time, very promising, and heading in some nice 
directions. I expect Apple will be doing some serious work on it for Lion, and 
am expecting it to really shine there...but that really doesn't help me for now.

I respect both your opinion and David's and might try David's suggested 
solution today, even though it does appear to require overlapping sibling 
views, which I have found can not be guaranteed what order they will appear in. 
The other option I am considering is just using a child window as an overlay 
and doing all my view stuff in there. I'll need to think it through, but it may 
well work well enough for my needs if I clip to my scroll view's clip view size 
and reposition things on the child window when the parent scrolls.

I really don't want to completely throw out the CA implementation when I am so 
close, and have overcome all the other issues I have encountered and got the 
core system working so nicely for just about everything else.

Thanks for taking the time to reply with all the feedback and suggestions. Time 
for me to try some more things out...

Regards

Gideon

On 17/12/2010, at 5:09 AM, Kyle Sluder wrote:

 
 Ohhh, boy. :)
 
 
[much stuff removed]

 My professional suggestion: avoid using Core Animation for anything
 related to traditional UI. CA is great for things like Front Row,
 sprite-based animation/games, overlays atop Core Video movie playback,
 data visualization (but be careful here! sometimes it's also the wrong
 tool for building data visualization)... it's not good for writing the
 next version of your productivity app's main content view.
 
 --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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Kyle Sluder
On Thu, Dec 16, 2010 at 12:41 PM, jonat...@mugginsoft.com
jonat...@mugginsoft.com wrote:
 This is something that has had me scratching my upper organ casing too.
 The NSApplication docs state that NSApplicationMain is functionally similar 
 to:

 void NSApplicationMain(int argc, char *argv[]) {
    [NSApplication sharedApplication];
    [NSBundle loadNibNamed:@myMain owner:NSApp];
    [NSApp run];
 }

 Presumably it is more functionally similar to:

 void NSApplicationMain(int argc, char *argv[]) {
    [NSApplication sharedApplication];
    [NSBundle loadNibNamed:@myMain owner:NSApp];

   while(YES) {

       @try {
           [NSApp run];
           return;
       } @catch (NSException *e) {
           [NSApp reportException:e]
       }

    }
 }

Look up NSExceptionHandler.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Exceptions/Tasks/ControllingAppResponse.html

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


NSSlider Mouse Up

2010-12-16 Thread koko
What is the preferred way of receiving an action when the mouse is  
released in an NSSlider?


-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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Dave Keck
 Look up NSExceptionHandler.

NSExceptionHandler (and NSSetUncaughtExceptionHandler for that matter)
can't help because the exception is being caught by AppKit.
Furthermore, the NSApplication subclass technique mentioned earlier
won't work in all cases either, since some AppKit/Foundation wrap
callouts with try/catch, and don't call NSApplication's
-reportException: with the thrown exceptions. For example, an
exception thrown in the -applicationDidFinishLaunching: delegate
method simply can't be caught.

(That said, NSHandleOtherExceptionMask will allow your
NSExceptionHandler delegate method to be called for exceptions that
were caught normally, and therefore will work for cases where
exceptions are caught by AppKit. But of course, using that to
terminate your app makes the assumption that no code in your process
is using exceptions for flow control, etc. I know of one case at least
– NSConnection/NSPort – where exceptions can occur in the normal
course of execution.)
___

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: NSSlider Mouse Up

2010-12-16 Thread Ken Ferry
Hi Koko,

On Thu, Dec 16, 2010 at 2:37 PM, k...@highrolls.net wrote:

 What is the preferred way of receiving an action when the mouse is released
 in an NSSlider?


The preferred thing is not to do precisely that.  It's to have the action
method use, say, -performSelector:withObject:afterDelay: and +
cancelPreviousPerformRequestsWithTarget:selector:object: to schedule
expensive work that cannot be performed too often.

A couple things to note:
(1) Users using full keyboard access or accessibility are not using the
mouse, so no mouse up.
(2) According to Apple's human interface group, it is highly desirable that
changes made with sliders be live whenever possible.  If something is too
expensive to do completely live, you still shouldn't wait for mouseUp: to
produce the 'real' effect, just avoid doing it every single time the user
twitches.

-Ken
Cocoa Frameworks



 -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/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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Dave Keck
 Presumably it is more functionally similar to:

On my system, the exception is being caught from within
-[NSApplication run]. So it would look like the implementation of -run
shown here:

http://cocoawithlove.com/2009/01/demystifying-nsapplication-by.html

with a @try around the calls to -nextEventMatchingMask: and
-sendEvent:, and the @catch block calling -reportException:.
___

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: NSSlider Mouse Up

2010-12-16 Thread koko

After posting I found a Carbon function GetCurrentButtonState;
I call this in my slider action method and if the mouse is up I do my  
clean up and return otherwise I do the live slider action.

Seems to work just fine.

Am I OK with this?

-koko


On Dec 16, 2010, at 3:54 PM, Ken Ferry wrote:


Hi Koko,

On Thu, Dec 16, 2010 at 2:37 PM, k...@highrolls.net wrote:
What is the preferred way of receiving an action when the mouse is  
released in an NSSlider?


The preferred thing is not to do precisely that.  It's to have the  
action method use, say, -performSelector:withObject:afterDelay: and  
+ cancelPreviousPerformRequestsWithTarget:selector:object: to  
schedule expensive work that cannot be performed too often.


A couple things to note:
(1) Users using full keyboard access or accessibility are not using  
the mouse, so no mouse up.
(2) According to Apple's human interface group, it is highly  
desirable that changes made with sliders be live whenever possible.   
If something is too expensive to do completely live, you still  
shouldn't wait for mouseUp: to produce the 'real' effect, just avoid  
doing it every single time the user twitches.


-Ken
Cocoa Frameworks


-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/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: NSSlider Mouse Up

2010-12-16 Thread Fritz Anderson
I'm at the airport and without access to the documentation, but I doubt that 
Cocoa promises that NSSlider will always be implemented in terms of a Carbon 
button. I think you've stumbled on an undocumented technique that accidentally 
happens to work.

Take the advice about the performSelector: family to heart. It's a very useful 
technique, and worth learning.

― F


On Dec 16, 2010, at 5:24 PM, k...@highrolls.net wrote:

 After posting I found a Carbon function GetCurrentButtonState;
 I call this in my slider action method and if the mouse is up I do my clean 
 up and return otherwise I do the live slider action.
 Seems to work just fine.
___

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

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

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

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


Re: Core data - binding related problem in NSNumberFormatter and NSDatePicker

2010-12-16 Thread Flavio Donadio
Devarshi,


These are pretty simple.

 It is now working correctly when I am entering the price with $ symbol
 prefixed, eg. $123,00 :)
 
 I think that this is not user intuitive, user may not always know that he/
 she has to prefix dollar symbol. I think it would have been good if:
 
 1. I can somehow change the alert message which now says - Formatting
 Error to You should prefix dollar symbol.
 
 2. Numberformatter can automatically prefix the '$' symbol to the entered
 decimal number.
 
 Do you know any way to implement these?

In IB, select the formatter and tivk the lenient checkbox. It will not 
require the dollar (or the localized currency symbol) anymore.

 Your interpretation is correct, when I set the default value of
 datePurchased attribute to some value say- 2010-12-10 in
 MyDocument.xcdatamodel, it started working as intended.
 
 So I am now thinking that can we set the default value to today's date in
 xcdatamodel?
 
 Also when I tried adding two or more cars and change their data value, I got
 the same problem. I used date-picker according to my requirements.

You want newly created Cars to have the datePurchased automatically set to 
today? If so, all you need to set the date at creation time is creating a 
custom NSManagedObject. Subclass NSManagedObject and override it's 
-awakeFromInsert method like below:

- (void)awakeFromInsert
{
[self setValue:[NSDate date] forKey:@datePurchased];
}

Change the your xcdatamodel and select your newly create subclass for the Car 
entity.

Hope it helps!


Cheers,
Flavio___

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: NSSlider Mouse Up

2010-12-16 Thread Kyle Sluder
010/12/16 Fritz Anderson fri...@manoverboard.org:
 I'm at the airport and without access to the documentation, but I doubt that 
 Cocoa promises that NSSlider will always be implemented in terms of a Carbon 
 button. I think you've stumbled on an undocumented technique that 
 accidentally happens to work.

GetCurrentButtonState refers to the mouse buttons, not the button
itself. :) But, regardless…

 Take the advice about the performSelector: family to heart. It's a very 
 useful technique, and worth learning.

Yes. Do this.

--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: NSToolbarItem Craziness

2010-12-16 Thread Seth Willits
On Dec 15, 2010, at 5:58 PM, k...@highrolls.net wrote:

 So why is not the action method called when the item is enabled but a table 
 has focus?

Probably because the toolbar has no target, thus the action is being sent up 
the responder chain and something before your controller responds to that same 
action.


--
Seth Willits



___

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: Build and Archive fails due to missing dSYM file [SOLVED]

2010-12-16 Thread Graham Cox

On 16/12/2010, at 8:34 PM, jonat...@mugginsoft.com wrote:

 Presumably you have checked that the target level settings for the release 
 build have not been modified to override the project level settings.


Thanks Jonathan, indeed that was the case, I overlooked it about 50 times for 
some reason - the interface just doesn't make things like that jump out I guess.

Anyway, one step forwardsNext!

--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: NSView setAlphaValue question

2010-12-16 Thread Seth Willits
On Dec 16, 2010, at 6:34 AM, Rick C. wrote:

 ... So I had that working too until I realized in Leopard the view won't 
 accept setAlphaValue unless I tick the box in IB for core animation.  So I 
 did tick the box for window view and it worked but it broke a lot of 
 subsequent UI functions/processing


Yeah, layer-backed views don't always work perfectly. What I would do instead 
is just go old school and redraw the view's contents at varying alpha. It's 
more work than using the animator on the view itself, but it'll work OK and you 
won't have to start over completely. Off the top of my head I can't think of a 
simpler solution.


--
Seth Willits



___

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

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

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

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


Re: Core data - binding related problem in NSNumberFormatter and NSDatePicker

2010-12-16 Thread mmalc Crawford

On Dec 16, 2010, at 3:45 pm, Flavio Donadio wrote:

   [self setValue:[NSDate date] forKey:@datePurchased];
 
Don't use KVC to set managed object properties unless you have a good reason 
(dynamic code). Core Data generates accessor methods for you that are much more 
efficient to use:

[self setDatePurchased:[NSDate date]];

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


Re: NSView setAlphaValue question

2010-12-16 Thread Rick C.
Thanks Seth I appreciate the input and yes I think I can handle that!  I should 
have thought of that already... :-)  As a note...I wasn't actually using 
animator I was just reducing the alpha via a repeating timer since I liked the 
effect better but the end result was the same problem so I think this can take 
care of it.  Thanks again!



On Dec 17, 2010, at 8:57 AM, Seth Willits wrote:

 On Dec 16, 2010, at 6:34 AM, Rick C. wrote:
 
 ... So I had that working too until I realized in Leopard the view won't 
 accept setAlphaValue unless I tick the box in IB for core animation.  So I 
 did tick the box for window view and it worked but it broke a lot of 
 subsequent UI functions/processing
 
 
 Yeah, layer-backed views don't always work perfectly. What I would do instead 
 is just go old school and redraw the view's contents at varying alpha. It's 
 more work than using the animator on the view itself, but it'll work OK and 
 you won't have to start over completely. Off the top of my head I can't think 
 of a simpler solution.
 
 
 --
 Seth Willits
 
 
 
 ___
 
 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/rickcorteza%40gmail.com
 
 This email sent to rickcort...@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


ImageAndTextCell editing problem

2010-12-16 Thread Fernando Valente
Hey,

I got ImageAndTextCell and I'm using it on a NSOutlineView. When I double click 
a cell in order to edit it, I get the following error:

2010-12-16 05:31:54.399 MyApp[26823:a0f] -[NSCFString representedObject]: 
unrecognized selector sent to instance 0xa0aff968

Does anyone know a solution for that?


Best regards,
Fernando Valente
http://www.chiarosoft.com/
http://www.fvalente.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


Image conversion to RGBA colors

2010-12-16 Thread Gideon King
Hi, I have an arbitrary (user supplied) image, and I want to get the RGBA 
values of each pixel of the image. I'm thinking that I should create it as an 
NSImage and then use the TIFFRepresentation to get it into an NSBitmapImageRep 
object, and then walk through and pick up the colors, but it appears that the 
NSBitmapImageRep could be in a wide variety of internal formats.

Is there either some generic way of finding the RGBA values, or ensuring that 
the NSBitmapImageRep is created in a fixed color space that I can code for? 
...or some other way of solving this problem?

Thanks

Gideon


___

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: Image conversion to RGBA colors

2010-12-16 Thread Ken Ferry
On Thu, Dec 16, 2010 at 7:48 PM, Gideon King gid...@novamind.com wrote:

 Hi, I have an arbitrary (user supplied) image, and I want to get the RGBA
 values of each pixel of the image. I'm thinking that I should create it as
 an NSImage and then use the TIFFRepresentation to get it into an
 NSBitmapImageRep object, and then walk through and pick up the colors, but
 it appears that the NSBitmapImageRep could be in a wide variety of internal
 formats.

 Is there either some generic way of finding the RGBA values, or ensuring
 that the NSBitmapImageRep is created in a fixed color space that I can code
 for? ...or some other way of solving this problem?


Yes.  Create an NSBitmapImageRep in a fixed pixel format and draw the
NSImage in it.  Now you have bits in a canonical pixel format.

The TIFFRepresentation thing is a not very good hack that unfortunately
seems to have critical mass in the community - that code just won't die.
 TIFFRepresentation is good method to call if you're sending data outside of
your process, say to the pasteboard or to disk.  It's pretty much always
wrong if the data isn't going to leave your address space.

See the section NSBitmapImageRep: CoreGraphics impedance matching and
performance notes in the AppKit release
noteshttp://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKit.htmlfor
more detail.

-Ken
Cocoa Frameworks



 Thanks

 Gideon


 ___

 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: ImageAndTextCell editing problem

2010-12-16 Thread Nick Zitzmann

On Dec 16, 2010, at 12:35 AM, Fernando Valente wrote:

 Hey,
 
 I got ImageAndTextCell and I'm using it on a NSOutlineView. When I double 
 click a cell in order to edit it, I get the following error:
 
 2010-12-16 05:31:54.399 MyApp[26823:a0f] -[NSCFString representedObject]: 
 unrecognized selector sent to instance 0xa0aff968
 
 Does anyone know a solution for that?

If you're having a problem with an exception being raised due to a nonsensical 
message being sent to an object, then the problem is usually caused by one of 
the following:

1. Your code is sending a message to an object not declared as id that does not 
respond to that message, which should raise a compiler warning, but either you 
ignored it or your project has warnings turned off.

2. Your code is dynamically forwarding the message without first checking to 
see if it responds to that message. This will not cause a compiler warning.

3. Your application is messaging a deallocated object, and you got lucky, 
because some other object (in the above case, an NSString) moved into its old 
address. Under normal circumstances, this would cause a crash.

To fix these:

1. Make sure -Wmost is in your target's other warnings build setting. (You 
can be more pedantic if you wish, but I find that -Wmost covers most bases, 
along with the default warnings.) And don't ignore build warnings unless you 
know what you're doing.

2. Break on objc_exception_raise and try to reproduce the problem in the 
debugger. And if this is the problem, then use -respondsToSelector: to find out 
if objects or classes support a message prior to sending.

3. Run your app in Instruments with the zombie detection instrument, then try 
to reproduce the problem.

Nick Zitzmann
http://www.chronosnet.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 setAlphaValue question (Update still not working)

2010-12-16 Thread Rick C.
Hi again Seth,

Ok I thought that was easy enough but something is still not right.  When I 
code my view to be redrawn at varying alpha and then have my controller send 
the message when it's time to be redrawn it does not work in Leopard (Snow 
Leopard again no problem).  Now the view is reporting the alpha being changed 
and the fact that it works in Snow should mean I coded it correctly, but 
again no changes evident in Leopard.  If I use setWantsLayer then it works but 
I'm back to the broken issues again (still funny why no problem on PPC Leopard 
just Intel).  But as for the fading doesn't work on PPC or Intel doing it this 
way.  I must be missing something?  What does work is setHidden and I could 
give up and just have the fade effect on Snow, but it sure would be nice to 
keep it the same on both.  Any thoughts of what maybe I'm doing wrong?  Thanks 
again,

rc



On Dec 17, 2010, at 8:57 AM, Seth Willits wrote:

 On Dec 16, 2010, at 6:34 AM, Rick C. wrote:
 
 ... So I had that working too until I realized in Leopard the view won't 
 accept setAlphaValue unless I tick the box in IB for core animation.  So I 
 did tick the box for window view and it worked but it broke a lot of 
 subsequent UI functions/processing
 
 
 Yeah, layer-backed views don't always work perfectly. What I would do instead 
 is just go old school and redraw the view's contents at varying alpha. It's 
 more work than using the animator on the view itself, but it'll work OK and 
 you won't have to start over completely. Off the top of my head I can't think 
 of a simpler solution.
 
 
 --
 Seth Willits
 
 
 
 ___
 
 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/rickcorteza%40gmail.com
 
 This email sent to rickcort...@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


NSManagedObject editor, open source project (useful for iOS projects)

2010-12-16 Thread Devraj Mukherjee
Hi all,

As part of our upcoming iOS app, which involves editing a lot of data
on the device, we developed and have Open Sourced a Managed Object
Editor, which reads its configuration from a JSON file and presents a
Grouped TableView based editor interface.

It can handle, relationships and options. Still under development and
will make a release shortly. Source code available at
http://moed.googlecode.com/

Comments are welcome.
___

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 setAlphaValue question (Update still not working)

2010-12-16 Thread Seth Willits
On Dec 16, 2010, at 8:45 PM, Rick C. wrote:

 Ok I thought that was easy enough but something is still not right.  When I 
 code my view to be redrawn at varying alpha and then have my controller send 
 the message when it's time to be redrawn it does not work in Leopard (Snow 
 Leopard again no problem).  Now the view is reporting the alpha being changed 
 and the fact that it works in Snow should mean I coded it correctly, but 
 again no changes evident in Leopard.  If I use setWantsLayer then it works 
 but I'm back to the broken issues again (still funny why no problem on PPC 
 Leopard just Intel).  But as for the fading doesn't work on PPC or Intel 
 doing it this way.  I must be missing something?  What does work is setHidden 
 and I could give up and just have the fade effect on Snow, but it sure would 
 be nice to keep it the same on both.  Any thoughts of what maybe I'm doing 
 wrong?  Thanks again,


I really can't tell from what you've said what would be wrong. There's 
certainly no reason it shouldn't work on Leopard. Make a movie and/or sample 
project/code.



--
Seth Willits



___

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


File name issue with German umlauts

2010-12-16 Thread Ulf Dunkel
I wonder if I have to handle NSString for folder/file names in a special 
way.


My issue:
When I search for an existing folder named äöütest, it isn't found, 
until I enter the search string not via keyboard to a search field in my 
app, but copy it from the folder name in the Finder and paste it to the 
search field in my app.


Isn't NSString always NSString? Do I have to handle encoding in a 
special way here? What is the encoding of fspecs in the Finder?


Thank you,
---UlfDunkel

___

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: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Jean-Daniel Dupas

Le 17 déc. 2010 à 00:06, Dave Keck a écrit :

 Presumably it is more functionally similar to:
 
 On my system, the exception is being caught from within
 -[NSApplication run]. So it would look like the implementation of -run
 shown here:
 
http://cocoawithlove.com/2009/01/demystifying-nsapplication-by.html
 
 with a @try around the calls to -nextEventMatchingMask: and
 -sendEvent:, and the @catch block calling -reportException:.
 

Not necessarily. Some subsystems use @try @catch, like the menu handler and the 
notification center. 
It does not mean that all appkit calls are protected though.


-- Jean-Daniel




___

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: File name issue with German umlauts

2010-12-16 Thread Stephen J. Butler
On Fri, Dec 17, 2010 at 1:34 AM, Ulf Dunkel dun...@calamus.net wrote:
 I wonder if I have to handle NSString for folder/file names in a special
 way.

 My issue:
 When I search for an existing folder named äöütest, it isn't found, until
 I enter the search string not via keyboard to a search field in my app, but
 copy it from the folder name in the Finder and paste it to the search field
 in my app.

Some code here would help figure out what is wrong.

 Isn't NSString always NSString? Do I have to handle encoding in a special
 way here? What is the encoding of fspecs in the Finder?

You shouldn't even be thinking about FSSpecs. FSRef or NSURL is the way to go.
___

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