Re: newbie window questions

2011-04-13 Thread Quincey Morris
On Apr 12, 2011, at 23:27, Artemiy Pavlov wrote:

> - I would like to disable my app from maximizing on the screen. 

Look into the window delegate method 'windowWillUseStandardFrame:defaultFrame:' 
or perhaps 'windowShouldZoom:toFrame:':


http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSWindowDelegate_Protocol/Reference/Reference.html

This would likely be implemented in a window controller owning the window that 
you want to prevent from zooming, or (if it's a single-window application) you 
might use the app delegate as the window's delegate, but a window controller is 
the better choice.

> - When the app's window is closed, I would like the app to quit and not stay 
> active in the dock.

Look into the application delegate method 
'applicationShouldTerminateAfterLastWindowClosed':


http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html


___

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

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

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

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


Re: newbie window questions

2011-04-13 Thread Laurent Daudelin
On Apr 12, 2011, at 23:27, Artemiy Pavlov wrote:

> Hi all!
> 
> I have previously written plugins with custom views, but I am now working on 
> a standalone app and have a couple very basic questions:
> 
> - I would like to disable my app from maximizing on the screen. 
> 
> - When the app's window is closed, I would like the app to quit and not stay 
> active in the dock.

I'm assuming that when you say "my app", you really mean "my window". Just make 
sure in Interface Builder that your window is not resizable (the "Resize" 
checkbox in the inspector is turned off).

You can implement the applicationShouldTerminateAfterLastWindowClosed: in your 
NSApplicationDelegate instance to return YES, signaling to the NSApplication 
object that it should terminate when the last window is closed.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

___

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

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

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

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


Re: newbie window questions

2011-04-13 Thread Artemiy Pavlov
Thanks Laurent, all worked perfectly!

On 13 Apr 2011, at 10:23, Laurent Daudelin wrote:

> On Apr 12, 2011, at 23:27, Artemiy Pavlov wrote:
> 
>> Hi all!
>> 
>> I have previously written plugins with custom views, but I am now working on 
>> a standalone app and have a couple very basic questions:
>> 
>> - I would like to disable my app from maximizing on the screen. 
>> 
>> - When the app's window is closed, I would like the app to quit and not stay 
>> active in the dock.
> 
> I'm assuming that when you say "my app", you really mean "my window". Just 
> make sure in Interface Builder that your window is not resizable (the 
> "Resize" checkbox in the inspector is turned off).
> 
> You can implement the applicationShouldTerminateAfterLastWindowClosed: in 
> your NSApplicationDelegate instance to return YES, signaling to the 
> NSApplication object that it should terminate when the last window is closed.
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.com
> 

___

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

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

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

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


How to enable accessibility for Screen Change

2011-04-13 Thread Symadept
Hi,
I am looking for a multiview app, if I am navigating to Page 2 from Page 1
is there a way I can enable accessibility such that, Voice Over can read as
I am transitioning to Page 2.

Glad to see your responses.

Regards
symadept
___

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


AVMutableMetadataItem on still photos

2011-04-13 Thread Roy Lovejoy
Watched session 409 from WWDC '10-

They mentioned adding metadata via AVMutableMetadataItems.

It's not clear how to add them to an AVCaptureStillImageOutput (desired)-
since only AVCaptureMovieFileOutput has the metadata property.

I had previously had added metadata to the photos after the fact via 
CGImageSource & a whole slew of kCGImageProperty.

AVMutableMetaDataItems seemed cleaner by injecting the data at the time of jpeg 
creation.

Anyone else trying to tag still images in 
AVFoundation?___

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


MPMoviePlayerController

2011-04-13 Thread Jeffrey Walton
Hi All,

I'm trying to play a M4V acquired from iTunes [1]. The movie is local
and was transferred into my sandbox using iTunes via file sharing.

Working from a Hillegass example ('Playing Movie Files', p. 294), the
player appears to load/display but does not play.

Unfortunately, PLAY is not documented [2]. In addition, I can't find a
delegate (as with other controllers) and there are no notifications
covering errors [2]. Finally, the error log is for network streams
[2].

How does one determine errors when using MPMoviePlayerController?

More philosophical: why are the APIs so inconsistent? Why is there no
readily apparent way to consistently retrieve error information
(Windows has GetLastError and Linux has errno)?

Jeff

[1] http://www.apple.com/itunes/charts/tv-shows/the-simpsons/lost-verizon/

[2] 
http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html
___

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

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

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

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


Re: MPMoviePlayerController

2011-04-13 Thread Kyle Sluder
On Apr 13, 2011, at 9:15 AM, Jeffrey Walton  wrote:

> 
> 
> Unfortunately, PLAY is not documented [2]. In addition, I can't find a
> delegate (as with other controllers) and there are no notifications
> covering errors [2]. Finally, the error log is for network streams
> [2].

Not sure about the error handling, but MPMoviePlayerController is documented to 
conform to MPMediaPlayback, the documentation for which describes -play: 
http://developer.apple.com/library/ios/documentation/mediaplayer/reference/MPMediaPlayback_protocol/Reference/Reference.html#//apple_ref/occ/intfm/MPMediaPlayback/play


> More philosophical: why are the APIs so inconsistent? Why is there no
> readily apparent way to consistently retrieve error information
> (Windows has GetLastError and Linux has errno)?

And you've never seen "An error occurred: There was an error (E_SUCCESS)" on 
Windows, or similar errno stomping on *nix?

What UNIX libraries do you regularly use that set errno?

Returning errors from the place they happen, or providing a block argument that 
can act as an error handler, or notifying a delegate object than an error has 
occurred in an operation it requested before are all vastly superior to the 
"last failure gets to write an oh-so-descriptive integer to a shared memory 
location."

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

2011-04-13 Thread Jeffrey Walton
On Wed, Apr 13, 2011 at 1:26 PM, Kyle Sluder  wrote:
> On Apr 13, 2011, at 9:15 AM, Jeffrey Walton  wrote:
>
>>
>>
>> Unfortunately, PLAY is not documented [2]. In addition, I can't find a
>> delegate (as with other controllers) and there are no notifications
>> covering errors [2]. Finally, the error log is for network streams
>> [2].
>
> Not sure about the error handling, but MPMoviePlayerController is documented 
> to conform to MPMediaPlayback, the documentation for which describes -play: 
> http://developer.apple.com/library/ios/documentation/mediaplayer/reference/MPMediaPlayback_protocol/Reference/Reference.html#//apple_ref/occ/intfm/MPMediaPlayback/play
Silly me. I went looking for documentation on MPMoviePlayerController
PLAY in MPMoviePlayerController's documentation.

>
>> More philosophical: why are the APIs so inconsistent? Why is there no
>> readily apparent way to consistently retrieve error information
>> (Windows has GetLastError and Linux has errno)?
>
> And you've never seen "An error occurred: There was an error (E_SUCCESS)" on 
> Windows, or similar errno stomping on *nix?
It happens at times. My personal experience is that I sometimes log
*before* retrieving the error (the logging succeeds and stomps the
failure code). If you find a program is regularly producing incorrect
results and incorrectly reporting errors, its probably time to
uninstall.

> What UNIX libraries do you regularly use that set errno?
For example, socket calls. Typically, anything less than 0 cause me to
inspect errno. For the visual stuff, I use QT on Linux so an exception
is thrown.

> Returning errors from the place they happen, or providing a block argument 
> that can act as an error handler, or notifying a delegate object than an 
> error has occurred in an operation it requested before are all vastly 
> superior to the "last failure gets to write an oh-so-descriptive integer to a 
> shared memory location."
The great thing about an immediate return code (followed by a call to
GetLastError or errno) is one can find the point of first failure
quickly, without disgorging the point of failure from the reporting
mechanism. There's a lot to be said about finding the point of first
failure quickly.

MPMoviePlayerPlaybackDidFinishNotification " ... is also sent when
playback fails because of an error." So how does one tell when the
notification is sent for a good reason, versus a bad reason? As can be
seen, the documentation does not clarify. Its too bad there is no
'MPMoviePlayerError' (or similar) notification (perhaps I'm reading
the notification section incorrectly).

Below is the rabbit hole I went down trying to play a Movie. I would
give my left arm for a return code right about now. With a error code,
I could search for "MPMoviePlayerController play error 0xX" and
probably get dozens of questions/answers pertinent to my situation.

Jeff

Purchase TV Show from Apple's iTunes
v
Attempt to play TV show on iPhone
v
UIWebView, loadRequest
v
Use code from a well known author
v
Video fails to play
v
Look up docs on loadRequest
v
Nothing about errors in loadRequest documentation
v
Ask for help to determine loadRequest errors
v
Use webView:didFailLoadWithError:
v
Error is "Plug-in handled load" (sounds a lot like stomping an error
with success)
v
Switch to MPMoviePlayerController
v
Use code from a well known author
v
Video fails to play
v
PLAY is not documented in MPMoviePlayerController
v
Try to locate the error
v
Stack Overflow states errors reported through notifications
v
MPMoviePlayerPlaybackDidFinishNotification is sent for both good and
bad conditions
v
Scratch head and wonder
___

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


AVFoundation still photo Zoom & HDR support

2011-04-13 Thread Roy Lovejoy
I'm not seeing the methods for accessing these features in AVFoundation - 
I would have assumed it to be part of AVCaptureDevice, but it's no where to be 
found.

Any help would be appreciated.___

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

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

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

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


Re: MPMoviePlayerController

2011-04-13 Thread Quincey Morris
On Apr 13, 2011, at 11:39, Jeffrey Walton wrote:

> Silly me. I went looking for documentation on MPMoviePlayerController
> PLAY in MPMoviePlayerController's documentation.

Unfortunately, it's just something you need to learn about Apple's style of 
documentation -- when consulting the documentation for a class, especially the 
first time, you also need to look at the superclass documentation and (now that 
so many informal protocols have been formalized in Snow Leopard) in the 
documentation for protocols the class conforms to.

Although this can trip up the unwary (usually only once), it's hard to get 
worked up about, because the alternative -- repeating "inherited" method 
documentation everywhere, which some people have asked for on this list -- 
would probably be worse. There's an *awful* lot of methods whose behavior is 
shared.

> The great thing about an immediate return code (followed by a call to
> GetLastError or errno) is one can find the point of first failure
> quickly, without disgorging the point of failure from the reporting
> mechanism. There's a lot to be said about finding the point of first
> failure quickly.

The other point that Kyle didn't make explicitly is that global error variables 
aren't thread safe. Also, since Cocoa internally makes a lot of use of 
threading that you won't see explicitly, "the" point of failure can't be very 
well-defined in Mac OS X, in the sense it would be if you were single-threaded. 
'errno' is old-school.

> MPMoviePlayerPlaybackDidFinishNotification " ... is also sent when
> playback fails because of an error." So how does one tell when the
> notification is sent for a good reason, versus a bad reason? As can be
> seen, the documentation does not clarify. Its too bad there is no
> 'MPMoviePlayerError' (or similar) notification (perhaps I'm reading
> the notification section incorrectly).

FWIW, anything involving QuickTime is "special". Historically, the QuickTime 
APIs have been a mess, and there are now archeological remnants of various 
attempts to fix and/or simplify them. QuickTime-related frameworks are a lot 
more rational and usable than they used to be, but for those historical reasons 
they still play by a different set of rules.

I'm sorry that you've been through the wringer in getting up to speed on Cocoa. 
It's not your fault, and you've been a little bit unlucky. Take comfort that 
the worst of the nightmare is probably over.


___

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

2011-04-13 Thread Kyle Sluder
On Wed, Apr 13, 2011 at 11:39 AM, Jeffrey Walton  wrote:
> On Wed, Apr 13, 2011 at 1:26 PM, Kyle Sluder  wrote:
>> On Apr 13, 2011, at 9:15 AM, Jeffrey Walton  wrote:
>>
>>>
>>>
>>> Unfortunately, PLAY is not documented [2]. In addition, I can't find a
>>> delegate (as with other controllers) and there are no notifications
>>> covering errors [2]. Finally, the error log is for network streams
>>> [2].
>>
>> Not sure about the error handling, but MPMoviePlayerController is documented 
>> to conform to MPMediaPlayback, the documentation for which describes -play: 
>> http://developer.apple.com/library/ios/documentation/mediaplayer/reference/MPMediaPlayback_protocol/Reference/Reference.html#//apple_ref/occ/intfm/MPMediaPlayback/play

> Silly me. I went looking for documentation on MPMoviePlayerController
> PLAY in MPMoviePlayerController's documentation.

Well, the MPMoviePlayerController documentation's Overview section
does say the following:

"This class supports programmatic control of movie playback, and
user-based control via buttons supplied by the movie player. You can
control most aspects of playback programmatically using the methods
and properties of the MPMediaPlayback protocol, to which this class
conforms. The methods and properties of that protocol let you start
and stop playback, seek forward and backward through the movie’s
content, and even change the playback rate."

> The great thing about an immediate return code (followed by a call to
> GetLastError or errno) is one can find the point of first failure
> quickly, without disgorging the point of failure from the reporting
> mechanism. There's a lot to be said about finding the point of first
> failure quickly.

Except when that error happens in a background task. You certainly
wouldn't want -play to block until the user stopped playback or an
error occurred.

>
> MPMoviePlayerPlaybackDidFinishNotification " ... is also sent when
> playback fails because of an error." So how does one tell when the
> notification is sent for a good reason, versus a bad reason? As can be
> seen, the documentation does not clarify. Its too bad there is no
> 'MPMoviePlayerError' (or similar) notification (perhaps I'm reading
> the notification section incorrectly).

The sentence directly before the one you quoted: "The userInfo
dictionary of this notification contains the
MPMoviePlayerPlaybackDidFinishReasonUserInfoKey key, which indicates
the reason that playback finished." Click the link, it takes you to
the documentation for that notification key, which states "The value
of this key is an NSNumber containing an integer value that represents
one of the “MPMovieFinishReason” constants." Click that link, you get
the three values: MPMovieFinishReasonPlaybackEnded,
MPMovieFinishReasonPlaybackError, MPMovieFinishReasonUserExited.

Not that difficult.

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


Refreshing an NSView

2011-04-13 Thread Tom Jeffries
I seem to be missing something, and it's probably something quite obvious.
 In the initialization to an NSView subclass window, I do the following:

- (void) drawRect:(NSRect)dirtyRect
{
 [StepWindow DrawStepArea];
}

DrawStepArea is a simple function that draws some lines on the screen-
here's a condensed version:

+ (void) DrawStepArea
{
   CGRect stepsBox;

  CGContextRef stepsContext = [[NSGraphicsContext currentContext]
graphicsPort];
  CGContextSetLineWidth(stepsContext, 1.0);
  stepsBox = CGRectMake(0, 0, 100, 100);
  CGContextBeginPath (stepsContext);
  CGContextSetRGBStrokeColor(stepsContext, 0, 0, 0, 1);
  CGContextAddRect(stepsContext, stepsBox);
  CGContextFillPath(stepsContext);
  CGContextDrawPath (stepsContext, kCGPathStroke);
}

It works perfectly when the window is first initialized.  However, when I
call DrawStepArea later nothing gets drawn.  I'm calling from another class,
but everything about the call works fine including access to variables in
the StepWindow class.

Any idea what I'm missing, or on what to look for to figure this out?  Many
thanks for any suggestions.
___

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

2011-04-13 Thread Kyle Sluder
On Wed, Apr 13, 2011 at 11:39 AM, Jeffrey Walton  wrote:
> Below is the rabbit hole I went down trying to play a Movie. I would
> give my left arm for a return code right about now. With a error code,
> I could search for "MPMoviePlayerController play error 0xX" and
> probably get dozens of questions/answers pertinent to my situation.

I don't know what it is about Apple's documentation, but something
about it trips everyone up when they first get to the platform. I'm
certainly among that crowd. It's not that things aren't sufficiently
documented; usually they are, with certain notable exceptions like
Core Audio. Maybe it's that you really do need to be willing to make
plenty of clicks in order to understand small facets of the thing
you're looking at. On top of that, you really do need to understand
the whole of a class before you can proficiently work with it. Just
encountering methods that sound like they do the right thing rarely
works; there's usually some required supporting infrastructure.

Sorry this has frustrated you. But eventually everything starts making
perfect sense. The Mac and iOS platforms really are some of the
best-designed and most developer-friendly APIs in existence.

--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: Refreshing an NSView

2011-04-13 Thread Quincey Morris
On Apr 13, 2011, at 12:23, Tom Jeffries wrote:

> I seem to be missing something, and it's probably something quite obvious.
> In the initialization to an NSView subclass window, I do the following:
> 
> - (void) drawRect:(NSRect)dirtyRect
> {
> [StepWindow DrawStepArea];
> }

> It works perfectly when the window is first initialized.  However, when I
> call DrawStepArea later nothing gets drawn.  I'm calling from another class,
> but everything about the call works fine including access to variables in
> the StepWindow class.

This isn't how drawing works. You shouldn't be calling 'drawRect:' (or any 
method that draws) directly. Instead, send the view a 'setNeedsDisplay:' or 
'setNeedsDisplayInRect:' message. Eventually, the frameworks will call 
'drawRect:' after setting up the drawing environment properly, and the view 
contents should then get redrawn.

At the very least, the information here:


http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaDrawingGuide/DrawingEnviron/DrawingEnviron.html

is essential knowledge for anyone trying subclass NSView, as is this entire 
document:


http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaViewsGuide/Introduction/Introduction.html

but especially:


http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaViewsGuide/SubclassingNSView/SubclassingNSView.html


___

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

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

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

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


Re: How to enable accessibility for Screen Change

2011-04-13 Thread Peter Lübke
You should rather post your question to  Accessibility- 
d...@lists.apple.com.


Am 13.04.2011 um 11:30 schrieb Symadept:


Hi,
I am looking for a multiview app, if I am navigating to Page 2 from  
Page 1
is there a way I can enable accessibility such that, Voice Over can  
read as

I am transitioning to Page 2.

Glad to see your responses.

Regards
symadept

___

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


Are the Mac international resources available publicly?

2011-04-13 Thread Motti Shneor
Hi.

In our program, we need to let the user choose a country code from a list, just 
like you choose input source from the language menu.

I was wondering whether these well designed and pretty-complete lists of 
countries regions and their flags and country-codes (phone) are available to 
the developer via some API, or well-defined image names?

I tried to play with NSLocale, but could not get any further than a list of 
countries.

Any hint will make me very happy!


Motti Shneor, 
Spectrum Reflections LTD.
---
ceterum censeo microsoftiem delendam esse
---










___

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


Cocoaheads Lake Forest meeting TONIGHT, 7pm, El Toro library

2011-04-13 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the month.

Please join us TONIGHT from 7pm to 9pm on Wednesday, 4/13.  We will be
meeting at the Orange County Public Library (El Toro) community room, 24672
Raymond Way, Lake Forest, CA 92630

Peter Hosey has built a brand new application to demonstrate some of his
previous points.

As always, details and the upcoming meeting calendar can be found at the
cocoaheads web site, www.cocoaheads.org.

For those who went to the recent meetings at Ozate, please contact me
off-list and let me know what you thought of the space.  Joe has offered to
have us meet there more often, and I want to get a feel for what the group
would prefer.

(Personal note: Google Irvine is hiring again, and there are some open spots
in MTV for Cocoa/ObjC/iOS development.  Ping me or drop by for details.)
___

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

2011-04-13 Thread Jeffrey Walton
On Wed, Apr 13, 2011 at 3:12 PM, Kyle Sluder  wrote:
> On Wed, Apr 13, 2011 at 11:39 AM, Jeffrey Walton  wrote:
>> On Wed, Apr 13, 2011 at 1:26 PM, Kyle Sluder  wrote:
>>> On Apr 13, 2011, at 9:15 AM, Jeffrey Walton  wrote:
>>>
[ SNIP ]
>>>
>>
>> MPMoviePlayerPlaybackDidFinishNotification " ... is also sent when
>> playback fails because of an error." So how does one tell when the
>> notification is sent for a good reason, versus a bad reason? As can be
>> seen, the documentation does not clarify. Its too bad there is no
>> 'MPMoviePlayerError' (or similar) notification (perhaps I'm reading
>> the notification section incorrectly).
>
> The sentence directly before the one you quoted: "The userInfo
> dictionary of this notification contains the
> MPMoviePlayerPlaybackDidFinishReasonUserInfoKey key, which indicates
> the reason that playback finished." Click the link, it takes you to
> the documentation for that notification key, which states "The value
> of this key is an NSNumber containing an integer value that represents
> one of the “MPMovieFinishReason” constants." Click that link, you get
> the three values: MPMovieFinishReasonPlaybackEnded,
> MPMovieFinishReasonPlaybackError, MPMovieFinishReasonUserExited.
>
> Not that difficult.
:)

I'm registered for the following notifications:
* MPMoviePlayerPlaybackDidFinishNotification (0)
* MPMoviePlayerPlaybackDidFinishReasonUserInfoKey (1)
* MPMoviePlayerPlaybackStateDidChangeNotification (2)
* MPMoviePlayerLoadStateDidChangeNotification (3)
* MPMoviePlayerThumbnailImageRequestDidFinishNotification (4)

Here's what I am seeing (I'm logging in the notification). The double
MPMoviePlayerLoadStateDidChangeNotification is the Start/Stop sequence
from the player. The stop comes immediately. (I've also tried with a
filename which has no embedded spaces). Notice that
MPMoviePlayerPlaybackDidFinish* is never received.

2011-04-13 16:48:41.725 MyTestApp[364:707] Filename:
/var/mobile/Applications/82D7D326-A6FA-4DE9-8DB9-D703C5F3DCB9/Documents/02
Lost Verizon.m4v
...
[Switching to thread 13315]
2011-04-13 16:48:42.671 MyTestApp[364:707] Notification:
NSConcreteNotification 0x1735d0 {name =
MPMoviePlayerLoadStateDidChangeNotification; object =
}
2011-04-13 16:48:42.677 MyTestApp[364:707] Notification:
NSConcreteNotification 0x16ade0 {name =
MPMoviePlayerPlaybackStateDidChangeNotification; object =
}

Unfortunately, according to the documentation for
MPMoviePlayerPlaybackStateDidChangeNotification: "There is no
userInfo". It kind of takes the wind out of the sails for fetching
MPMovieFinishReasonPlaybackError from the dictionary.

Jeff
___

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

2011-04-13 Thread Jeffrey Walton
On Wed, Apr 13, 2011 at 3:32 PM, Kyle Sluder  wrote:
> On Wed, Apr 13, 2011 at 11:39 AM, Jeffrey Walton  wrote:
>> Below is the rabbit hole I went down trying to play a Movie. I would
>> give my left arm for a return code right about now. With a error code,
>> I could search for "MPMoviePlayerController play error 0xX" and
>> probably get dozens of questions/answers pertinent to my situation.
>
> I don't know what it is about Apple's documentation, but something
> about it trips everyone up when they first get to the platform. I'm
> certainly among that crowd. It's not that things aren't sufficiently
> documented; usually they are, with certain notable exceptions like
> Core Audio. Maybe it's that you really do need to be willing to make
> plenty of clicks in order to understand small facets of the thing
> you're looking at. On top of that, you really do need to understand
> the whole of a class before you can proficiently work with it. Just
> encountering methods that sound like they do the right thing rarely
> works; there's usually some required supporting infrastructure.
>
> Sorry this has frustrated you. But eventually everything starts making
> perfect sense. The Mac and iOS platforms really are some of the
> best-designed and most developer-friendly APIs in existence.
There's no need to apologize for Apple.

I see why good iPhone programmers are worth their weight in gold (and
so hard to find).

Jeff
___

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


UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-13 Thread Martin Linklater
Hi - I'm working on latest iOS and when testing my code on an iPhone3G I 
sometimes get this log output:

2011-04-14 00:03:08.920 CRDev[18309:307] InGameViewController - viewDidUnload
2011-04-14 00:03:09.223 CRDev[18309:307] InGameViewController - viewDidLoad
2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController implementation of 
-viewDidUnload caused the view to be reloaded. This will adversely impact 
system performance.
2011-04-14 00:03:09.732 CRDev[18309:307] InGameViewController - 
didReceiveMemoryWarning
2011-04-14 00:03:09.745 CRDev[18309:307] InGameViewController - viewDidUnload
2011-04-14 00:03:09.781 CRDev[18309:307] InGameViewController - viewDidLoad
2011-04-14 00:03:09.934 CRDev[18309:307] InGameViewController implementation of 
-viewDidUnload caused the view to be reloaded. This will adversely impact 
system performance.


Can anyone tell me what's causing this ? It's screwing up some of the child 
views and causing some subtle bugs...

Thanks for any help.___

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

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

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

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


Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-13 Thread David Duncan
On Apr 13, 2011, at 4:14 PM, Martin Linklater wrote:

> Hi - I'm working on latest iOS and when testing my code on an iPhone3G I 
> sometimes get this log output:
> 
> 2011-04-14 00:03:08.920 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.223 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController implementation 
> of -viewDidUnload caused the view to be reloaded. This will adversely impact 
> system performance.
> 2011-04-14 00:03:09.732 CRDev[18309:307] InGameViewController - 
> didReceiveMemoryWarning
> 2011-04-14 00:03:09.745 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.781 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.934 CRDev[18309:307] InGameViewController implementation 
> of -viewDidUnload caused the view to be reloaded. This will adversely impact 
> system performance.
> 
> 
> Can anyone tell me what's causing this ? It's screwing up some of the child 
> views and causing some subtle bugs...


Your -viewDidUnload method is either directly or indirectly causing the view to 
reload, typically by referencing it via self.view.
--
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


isDeletableFileAtPath: returns YES for locked files???

2011-04-13 Thread Laurent Daudelin
Is it normal that NSFileManager's isDeletableFileAtPath: returns YES for a 
locked file? Based on the result it returns, when I try to send it a 
removeItemAtPath:error:, it fails and the error localized description is '“This 
is a test.docx” couldn’t be removed because you don’t have permission to access 
it.'. That seems wrong to me. First, isDeletableFileAtPath: shouldn't return 
YES for a locked file.

Comments?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

___

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

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

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

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


Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-13 Thread Chris Parker

On 13 Apr 2011, at 4:14 PM, Martin Linklater wrote:

> Hi - I'm working on latest iOS and when testing my code on an iPhone3G I 
> sometimes get this log output:
> 
> 2011-04-14 00:03:08.920 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.223 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController implementation 
> of -viewDidUnload caused the view to be reloaded. This will adversely impact 
> system performance.
> 2011-04-14 00:03:09.732 CRDev[18309:307] InGameViewController - 
> didReceiveMemoryWarning
> 2011-04-14 00:03:09.745 CRDev[18309:307] InGameViewController - viewDidUnload
> 2011-04-14 00:03:09.781 CRDev[18309:307] InGameViewController - viewDidLoad
> 2011-04-14 00:03:09.934 CRDev[18309:307] InGameViewController implementation 
> of -viewDidUnload caused the view to be reloaded. This will adversely impact 
> system performance.
> 
> 
> Can anyone tell me what's causing this ? It's screwing up some of the child 
> views and causing some subtle bugs...

The log is trying to help you out; -viewDidUnload is called when the view 
controller has discarded its view. The log is telling you that an 
implementation of -viewDidUnload is causing the view to be loaded again.

This can be caused by doing anything which accesses the -view property on the 
view controller inside the -viewDidUnload implementation.

Look around in InGameViewController's implementation of -viewDidUnload and see 
if you're doing anything that involves '[self view]' (or 'self.view' for you 
dot-syntax people :) ).

.chris

-- 
Chris Parker
iOS Frameworks (UIKit)
Apple Inc.


___

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


Preventing View Update in NSTableView

2011-04-13 Thread Peter Lübke

Hi,

I have an NSTableView subclass bound to an NSArrayController.
I'd like to temporarily 'freeze' the cells in the table view while  
the data displayed in those cells are changed so they are not  
continuously redrawn.

When the changes are completed, they should be updated at once.

For various reasons, executing the changes on a copy of the array  
controller's content is no option.


Thoughts?

- Peter
___

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 done writing?

2011-04-13 Thread Uli Kusterer
On 12.04.2011, at 17:54, Rainer Standke wrote:
> Thanks for pointing these out, Uli. Are those classes youhave on github newer 
> than, let's say, UKKQueue on you website at 
> http://zathras.de/angelweb/sourcecode.htm?

 Yes.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.lookandfeelcast.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: UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-13 Thread Matt Neuburg
On Wed, 13 Apr 2011 16:42:40 -0700, Chris Parker  said:
>> 2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController implementation 
>> of -viewDidUnload caused the view to be reloaded. This will adversely impact 
>> system performance.
>
>The log is trying to help you out; -viewDidUnload is called when the view 
>controller has discarded its view. The log is telling you that an 
>implementation of -viewDidUnload is causing the view to be loaded again.
>
>This can be caused by doing anything which accesses the -view property on the 
>view controller inside the -viewDidUnload implementation.

That's really kind of wonderful.

In my iOS book I talk about discovering that my loadView was being mysteriously 
called twice, and then (by logging like crazy) realizing that this due to my 
mentioning the view property in my awakeFromNib. That's how I learned not to do 
that. :) I really applaud verbose explanatory log messages from the framework 
such as this. m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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

2011-04-13 Thread Matt Neuburg
On Wed, 13 Apr 2011 12:32:27 -0700, Kyle Sluder  said:
>
>I don't know what it is about Apple's documentation, but something
>about it trips everyone up when they first get to the platform. I'm
>certainly among that crowd. It's not that things aren't sufficiently
>documented; usually they are, with certain notable exceptions like
>Core Audio.

I would point to Core Animation, which omits or gets wrong a number of key 
(hint) fundamental facts.

>Maybe it's that you really do need to be willing to make
>plenty of clicks in order to understand small facets of the thing
>you're looking at. On top of that, you really do need to understand
>the whole of a class before you can proficiently work with it.

This is why my book has a chapter on documentation where I actually take the 
reader through a typical page of class documentation, while jumping up and down 
and yelling "don't forget to look in the superclass", "don't forget to look in 
the adopted protocols", and so on with all the other lessons I've learned over 
the years. Nonetheless, although I think the docs have become *vastly* better 
cross-linked than they used to be (and don't think I don't appreciate it!), the 
business of documenting things in multiple files, often *without* linkage of 
any kind, remains one of the documentation's greatest weaknesses. (My favorite 
examples are things like the string drawing methods and awakeFromNib - indeed, 
NSObject itself is very scattered and quite hard to get a complete handle on.) 
AppKiDo can be a help here.

And in the end, of course, documentation is only that - documentation. A list 
of methods and functions is not knowledge. Docs cannot be reasonably expected 
to have explanatory or (perhaps I should say) instructive power as well. It can 
often take a great deal of experimentation before the penny drops and the 
pieces of a framework or technology start to gel in your mind and you start to 
see when and how to use it. 

m.

PS In the particular case of MPMoviePlayerController, where the OP was having 
trouble tracking down a play command, my book has: "Further programmatic 
control over the actual playing of the movie is obtained through the 
MPMediaPlayback protocol, which MPMoviePlayerController adopts. This gives you 
the expected play, pause, and stop methods, as well as commands for seeking 
quickly forward and backward..." I had trouble discovering this too, the first 
time! I like to think that I've suffered so you don't have to... :)

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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


[MEET] CocoaHeads-NYC tomorrow (Thursday) night

2011-04-13 Thread Andy Lee

6:00 PM at Google. Paul Kim's talk will be called "The Ins and Outs of NSImage".

Please submit your name (that's all we need) so Ed can have badges printed:



If you decide at the last minute and haven't RSVP'ed, you'll still be admitted, 
but you'll have to call or IM Ed and wait for a badge.

Details and coordinates here:



--Andy

___

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: Are the Mac international resources available publicly?

2011-04-13 Thread Michael Dautermann

On Apr 13, 2011, at 4:30 PM, Motti Shneor wrote:

> Hi.
> 
> In our program, we need to let the user choose a country code from a list, 
> just like you choose input source from the language menu.
> 
> I was wondering whether these well designed and pretty-complete lists of 
> countries regions and their flags and country-codes (phone) are available to 
> the developer via some API, or well-defined image names?
> 
> I tried to play with NSLocale, but could not get any further than a list of 
> countries.
> 
> Any hint will make me very happy!


Hello Motti,

I've written code that enumerates through Text Input Source properties (e.g. 
the CFArray returned by the TISCreateInputSourceList function) and for each 
TISInputSourceRef, comes up with the localized name (kTISPropertyLocalizedName) 
and those pretty flag icons (kTISPropertyIconImageURL). 

That said, I really recommend against doing this.  It sounds like what you're 
doing has nothing to do with input source stuff.  Better to write your own 
custom data structure (e.g. an array of NSDictionary objects) where you have in 
each entry a localized name, country codes and flag icons that you either copy 
/ borrow from the raw TIS files or, even better, use your own flag icons in a 
proper OS X friendly format (Text Input Source icons are "classic" Mac OS 9 
format, IIRC -- I'm using them in my code as an IconRef).  

I hope my opinion helps you out!

michael


___

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: Preventing View Update in NSTableView

2011-04-13 Thread Graham Cox

On 14/04/2011, at 10:13 AM, Peter Lübke wrote:

> I'd like to temporarily 'freeze' the cells in the table view while the data 
> displayed in those cells are changed so they are not continuously redrawn.
> When the changes are completed, they should be updated at once.


This is what happens by default.

The redraws do not take place until the event loop completes, so if all your 
changes are made within the event cycle, you'll only get one redraw. If you are 
changing your data model one item per event loop - which you'd have to go to a 
lot of trouble to accomplish - then you'll get the table updating for each 
change.

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


Click in borderless window moves all windows to front

2011-04-13 Thread Trygve Inda
My App has one borderless window which I fill with custom views for the grow
box, title bar and content. It all works great except when I click this
window, all my app's windows move to the front.

How can I prevent this?

Thanks,

T.


___

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