NSTextView scaled using scaleUnitSquareToSize - alignment issue

2011-03-09 Thread Kenneth Baxter

HI, I have a subclass of NSTextView that I am showing on a window. I sometimes 
want to display it zoomed in, so have been using scaleUnitSquareToSize:, and 
this works fine so long as the text is left aligned. 

When I am zoomed in, and using either center alignment or right alignment the 
text appears too far to the right in the text field. The frame of the field is 
showing at the correct size and location - it's just that the text is 
positioned incorrectly within the frame

Am I doing something wrong here? Is there something I can do to get it to 
position correctly?

Thanks

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: Assertion failure in -[MPMoviePlayerControllerNew _moviePlayerDidBecomeActiveNotification:]

2011-03-09 Thread Dave Camp
I saw that assertion yesterday in a bit of code that was accidentally calling a 
MPMoviePlayerController method from a secondary thread.

Dave

On Mar 8, 2011, at 5:01 PM, Steve Christensen wrote:

 I'm seeing the above assertion in an app running on iOS 4.2.1. It then throws 
 an NSInternalInconsistencyException with the reason: movie player 
 MPMoviePlayerControllerNew: 0x446fbe0 has wrong activation state (1).
 
 The setup has a MPMoviePlayerController instance that is playing a local 
 audio file. There is also a UIWebView whose HTML contains an audio tag. 
 When the play control is tapped, I see a 
 MPMoviePlayerPlaybackDidFinishNotification notification with a reason of 
 MPMovieFinishReasonPlaybackEnded, then gdb shows the assertion failure and 
 exception and dumps the backtrace (below).
 
 If I start playing the HTML's audio then start the MPMoviePlayerController's 
 audio, the HTML's audio fades out and the MPMoviePlayerController's plays, so 
 there's probably some subtle difference I'm missing. Any ideas what I might 
 be doing wrong or what to look at? Everything is working great except when it 
 comes time for dueling audio.

___

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


get a dictionary out of an array of dictionaries by a criterion

2011-03-09 Thread Martin Batholdy
Hi,

I have a plist with an array of dictionaries.
Now every of these dictionaries has a key 'ID' with an integer.

Now how I can get only one dictionary element out of this array where key is 
equal to x?


thanks for any advice!

___

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: get a dictionary out of an array of dictionaries by a criterion

2011-03-09 Thread Dave DeLong
Load the array into memory.
Create an NSPredicate with the predicateFormat: @ID = %d, myID
Use filteredArrayUsingPredicate:
The resulting array contains the dictionaries you're looking for.

OR

Loop through the array and find it yourself.

Dave

On Mar 9, 2011, at 9:18 AM, Martin Batholdy wrote:

 Hi,
 
 I have a plist with an array of dictionaries.
 Now every of these dictionaries has a key 'ID' with an integer.
 
 Now how I can get only one dictionary element out of this array where key is 
 equal to x?
 
 
 thanks for any advice!
___

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 wait for methods with result/completion blocks to finish?

2011-03-09 Thread Chris Markle
Matt, Kyle,

Thanks for taking your time to give me your thoughts on this. It's
good food-for-thought and thought is what I need now... Thanks!

Chris
___

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

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

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

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


Fwd: NSXMLParserDelegateAbortedParseError

2011-03-09 Thread Josh Caswell
Kevin,

 I see -abortParse and parseErrorOccurred: as there for when your
 parser chokes on the data.
 I think you're jumping in a bit early by using abort.

Okay, I've got it. Thanks very much for the input! I plan to answer my
question on StackOverflow and I'll give you a mention unless you
object.

-- Josh Caswell
___

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


Okay to talk about Xcode 4 now?

2011-03-09 Thread Charles Srstka
Since Xcode 4 was just released on the App Store and can now be downloaded by 
anyone with an internet connection, is it safe to say that it no longer has 
“secret” status and can be talked about without violating NDA?

Charles___

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: Okay to talk about Xcode 4 now?

2011-03-09 Thread Kyle Sluder
On Wed, Mar 9, 2011 at 1:16 PM, Charles Srstka cocoa...@charlessoft.com wrote:
 Since Xcode 4 was just released on the App Store and can now be downloaded by 
 anyone with an internet connection, is it safe to say that it no longer has 
 “secret” status and can be talked about without violating NDA?

If you do want to talk about Xcode 4, the xcode-users list might be a
better place for most discussion.

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


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

2011-03-09 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, 3/9.  We will be
meeting at the Orange County Public Library (El Toro) community room, 24672
Raymond Way, Lake Forest, CA 92630

This will be a somewhat informal meeting, with no prepared presentation.
 With luck, we can get a discussion going on the newly released Xcode 4.

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

Thanks go to OReilly Media for the Introduction to iOS for Javascript
Programmers book we will be giving away as a door prize.

Scott
___

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: Outlets Not Connected In awakeFromNib

2011-03-09 Thread Jonathan Hess

On Mar 3, 2011, at 3:31 AM, Uli Kusterer wrote:

 On 02.03.2011, at 10:54, Andreas Grosam wrote:
 I have a very basic custom UIViewController with its own associated nib 
 file. This view controller is the root view controller of a Navigation 
 Controller which is itself embedded within a Split View Controller which is 
 defined in another nib - say the main.nib.
 
 tl;dr
 
 But do you have any objects that are part of several NIBs? I.e. a view 
 controller that is instantiated by one NIB, but the view controller has a NIB 
 of its own that it loads in turn? In that case, you'll get -awakeFromNib 
 twice. Once when the containing NIB is instantiated, and a second time after 
 you load the containED NIB.

Good explanation, and that's true on Mac OS X, but on iOS objects that aren't 
created by loading the NIB aren't sent the awakeFromNib message. So the file's 
owner of a NIB doesn't get the awakeFromNib message. It should just do the work 
it's interested in after the nib is loaded. UIViewController provides that hook 
with viewDidLoad.

Jon Hess

 
 Cheers,
 -- Uli Kusterer
 The Witnesses of TeachText are everywhere...
 http://www.masters-of-the-void.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/jhess%40apple.com
 
 This email sent to jh...@apple.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


Finding network mounted DVDs

2011-03-09 Thread P Teeson
In my app I want to find all mounted DVD volumes, including those mounted from 
other Macs on my network.
The reason is that I want the user to be able to choose the one they want.

Here is the code I am using to find them (based on the CDROM sample from Apple):

kern_return_t FindEjectableDVDMedia(io_iterator_t *mediaIterator)
{
kern_return_t   kernResult; 
CFMutableDictionaryRef  classesToMatch;

// DVD media are instances of class kIODVDMediaClass
classesToMatch = IOServiceMatching(kIODVDMediaClass); 

if (classesToMatch == NULL) {
printf(IOServiceMatching returned a NULL dictionary.\n);
}
else {
CFDictionaryAddValue(classesToMatch, CFSTR(kIOMediaEjectableKey), 
kCFBooleanTrue); 
}

 kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, 
classesToMatch, mediaIterator);
if (KERN_SUCCESS != kernResult) {
printf(IOServiceGetMatchingServices returned 0x%08x\n, kernResult);
}

return kernResult;
}

However when I do
nextMedia = IOIteratorNext(mediaIterator);
in my loop for all devices it returns 0 after the first iteration.
So apparently I have not found the network mounted DVD.
But DVDPlayer sees it as a mounted disk and will play the movie.

I mounted the network DVD using the Finder and Connect to server...
The server is my wife's Mac running Tiger and sure enough the DVD was mounted.
(But as I said shows up on my desktop with the rectangular disk icon on my Snow 
Leopard 10.6
rather than the circular DVD icon for the DVD on my local machine.)

Your advice is solicited and appreciated.  TIA

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