Re: How to get key code from "SysDefined" Carbon Event

2011-10-18 Thread Ken Thomases
On Oct 18, 2011, at 11:21 PM, Jerry Krinock wrote:

> P.S.  typeEventHotKeyID should be eventTypeHotKeyID

"Should" in what sense?  It's a type indicator, that's why it starts with 
"type".  The type it is conveying in this case is EventHotKeyID, the type of 
your hotKeyID parameter (and of the value conveyed in the 
kEventParamDirectObject for that particular event).  Re-ordering the subwords 
would completely obscure its meaning, and make it not conform to all of the 
other "type..." type indicator constants.

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: How to get key code from "SysDefined" Carbon Event

2011-10-18 Thread Jerry Krinock

On 2011 Oct 18, at 13:22, James Walker wrote:

> The only documented parameter in the kEventClassKeyboard / 
> kEventHotKeyPressed Carbon Event is
> 
>  kEventParamDirectObject (in, typeEventHotKeyID)
>   The ID of the hot key that was pressed.
> 
> That's the ID that was passed to RegisterEventHotKey.  That's what you should 
> use to distinguish different hot keys.

Aha!  In the header for RegisterEventHotKey(), I had read about that hot key ID 
parameter being somehow  available in the callback, but for the life of me I 
couldn't figure out how, because all its parameters are "opaque".  But thanks 
to your telling me what to look for, I found that the answer is: 
GetEventParameter().  Like this…

EventHotKeyID hotKeyID ;
OSStatus result = GetEventParameter(
carbonEvent,
kEventParamDirectObject,
typeEventHotKeyID,
NULL,
sizeof(EventHotKeyID),
NULL,
&hotKeyID) ;
UInt32 keyID = hotKeyID.id ;

So now I set the hotKeyID.id to a unique value when registering each hot key, 
and pass an object which can decode the keyID and perform the desired function 
in the userData.  Key code and modifier flags are not necessary.

Jerry

P.S.  typeEventHotKeyID should be eventTypeHotKeyID

___

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

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

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

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


Re: Custom NSArrayController that manages its own array?

2011-10-18 Thread Quincey Morris
On Oct 18, 2011, at 17:01 , Keary Suska wrote:

> When dealing with collections even the best of us forget that in the MVC 
> approach the model for the NSArrayController is the array itself, and not the 
> object that contains it. The key and the collection KVC methods are simply a 
> way to acquire the model object from another object that has a relationship 
> to it. Therefore, in this case, the content of the object controller is the 
> reference to the model.

Absolutely. I'll add here that NSArrayControllers are basically glue, and not 
even (exactly) necessary glue. You can connect a table view directly to a data 
model, without using an array controller. All the array controller does is to 
add some useful conveniences (such as supporting the table in sorting and 
filtering content without disturbing the data model). That essential 
inessentiality is one reason why it's usually a terrible idea to add behavior 
in a NSArrayController subclass. The expression "throwing good money after bad" 
jumps to mind.

> It may be useful to mention that there are limitations to how 
> NSObjectControllers and their subclasses respond to KVO, such that if any 
> object needs direct access to the array's objects you may want to consider 
> having the array owned by some other object. In particular, 
> +keyPathsForValuesEffectingKey, which fails to function for key paths through 
> NSObjectControllers. This might be the basis of Quincy's flat out "don't do 
> it" recommendation. But for most simple, bindings-only approaches, the above 
> approach will work fine.

That wasn't what was uppermost in my mind.

I've been trying, but I can't find a good reason why Jens should not (in 
theory, as an app design principle) put the content in a subclass. The pattern 
of having a combined MC object is officially sanctioned within MVC, after all. 
However, the arbitrariness of the solution is a code smell -- which Jens is 
obviously aware of or he wouldn't have started this thread --and that makes me 
wonder if there's a deeper difficulty which just hasn't shown itself as a 
problem yet.

My real objection is actually more visceral. NS…Controller is one of those few 
horrible design choices that Apple foisted on us. It's a kind of Pandora's box 
-- open it and horrible things crawl out, except that it's a black box (sorry 
about the mixed metaphor) so you can't open it, and nasty things crawl out 
anyway.

Here's one of the things I wrote in the response I didn't finish earlier:

If you feel tempted to tart up a NS…Controller object by subclassing and adding 
behavior, first reach into your skull and rip out your brain -- it's a faster 
way to the same result.

Yeah, well, that's why I censored that response.


___

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

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

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

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


Re: Custom NSArrayController that manages its own array?

2011-10-18 Thread Keary Suska
On Oct 18, 2011, at 5:16 PM, Jens Alfke wrote:

> 
> On Oct 18, 2011, at 11:59 AM, Keary Suska wrote:
> 
>> In your subclass you could use the machinery afforded by 
>> automaticallyPreparesContent, or simply set the content on awakeFromNib or 
>> whenever it is needed.
> 
> Hm. So in other words I would implement the KVC methods in the subclass 
> (-countOfEntries, etc.), then implement
>   - (void)prepareContent {
>   self.content = [self valueForKey: @“entries”];
>   }
> to get the fake NSMutableArray and set it as the controller’s content. I 
> guess that would work.

Well, "entries" in this case is redundant. If you subclass is designed to 
manage an array of "entries", then its content would simply be the array 
itself. There is no need to abstract it out by the key. In fact, it is a code 
smell to do so.

When dealing with collections even the best of us forget that in the MVC 
approach the model for the NSArrayController is the array itself, and not the 
object that contains it. The key and the collection KVC methods are simply a 
way to acquire the model object from another object that has a relationship to 
it. Therefore, in this case, the content of the object controller is the 
reference to the model.

It may be useful to mention that there are limitations to how 
NSObjectControllers and their subclasses respond to KVO, such that if any 
object needs direct access to the array's objects you may want to consider 
having the array owned by some other object. In particular, 
+keyPathsForValuesEffectingKey, which fails to function for key paths through 
NSObjectControllers. This might be the basis of Quincy's flat out "don't do it" 
recommendation. But for most simple, bindings-only approaches, the above 
approach will work fine.

Best,

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

___

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

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

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

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


Re: Getting weekday name from weekday number?

2011-10-18 Thread Rick Mann

On Oct 18, 2011, at 15:21 , Dave DeLong wrote:

> Quick idea off the top of my head:
> 
> Ask an NSDateFormatter for its shortWeekdaySymbols (returns an NSArray of 
> NSStrings) and index into that with your weekday number.

That seems to work. Thanks!

-- 
Rick

> 
> Other than that, the correct way to do this is to construct an NSDate with 
> the appropriate weekday and then use a date format of "EEE" to get the short 
> weekday name.
> 
> Dave
> 
> On Oct 18, 2011, at 3:18 PM, Rick Mann wrote:
> 
>> Hi. Given a day-of-week number, what's the best way to get the abbreviated 
>> name of that weekday? I've tried using NSDateComponents in various ways 
>> (stand-alone, building off the current date, etc.) to get at it (by using 
>> NSDateFormatter on the resulting date), but none seem to work. Basically, 
>> setting the weekday on NSDateComponents seems to do nothing.
>> 
>> Matters are complicated by the fact that two of the three format specifiers 
>> for weekday name use the "local" weekday number, which can vary by locale.
>> 
>> Any suggestions? I could just roll my own and localize it, but I'd rather 
>> just use what the OS provides.
>> 
>> The only other thing I can think to do is start with a known date for, say, 
>> Sunday, and add to that the weekday number I have, and the convert that date 
>> to a string formatted as a weekday name.
>> 
>> Thanks,
>> 
>> -- 
>> Rick
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
>> 
>> This email sent to davedel...@me.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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com

___

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

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

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

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


Re: Custom NSArrayController that manages its own array?

2011-10-18 Thread Jens Alfke

On Oct 18, 2011, at 11:59 AM, Keary Suska wrote:

> In your subclass you could use the machinery afforded by 
> automaticallyPreparesContent, or simply set the content on awakeFromNib or 
> whenever it is needed.

Hm. So in other words I would implement the KVC methods in the subclass 
(-countOfEntries, etc.), then implement
- (void)prepareContent {
self.content = [self valueForKey: @“entries”];
}
to get the fake NSMutableArray and set it as the controller’s content. I guess 
that would work.

—Jens___

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


Source list groups hidden by default

2011-10-18 Thread David Catmull
I have a source list in my window - an NSOutlineView where my delegate returns 
YES for outlineView:isGroupItem: for certain items. In 10.7, group items now 
have a Show/Hide button that appears on mouse-over. The complication is that 
for some reason my groups are hidden by default. I can expand them 
programmatically, but that doesn't work if the group is empty. I could expand 
it when I add children, but then I have to keep track of whether it's for the 
first time or if I'm just refreshing. So how do I make my groups shown by 
default?

-- 
David Catmull
uncom...@uncommonplace.com
http://www.uncommonplace.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: Getting weekday name from weekday number?

2011-10-18 Thread Dave DeLong
Quick idea off the top of my head:

Ask an NSDateFormatter for its shortWeekdaySymbols (returns an NSArray of 
NSStrings) and index into that with your weekday number.

Other than that, the correct way to do this is to construct an NSDate with the 
appropriate weekday and then use a date format of "EEE" to get the short 
weekday name.

Dave

On Oct 18, 2011, at 3:18 PM, Rick Mann wrote:

> Hi. Given a day-of-week number, what's the best way to get the abbreviated 
> name of that weekday? I've tried using NSDateComponents in various ways 
> (stand-alone, building off the current date, etc.) to get at it (by using 
> NSDateFormatter on the resulting date), but none seem to work. Basically, 
> setting the weekday on NSDateComponents seems to do nothing.
> 
> Matters are complicated by the fact that two of the three format specifiers 
> for weekday name use the "local" weekday number, which can vary by locale.
> 
> Any suggestions? I could just roll my own and localize it, but I'd rather 
> just use what the OS provides.
> 
> The only other thing I can think to do is start with a known date for, say, 
> Sunday, and add to that the weekday number I have, and the convert that date 
> to a string formatted as a weekday name.
> 
> Thanks,
> 
> -- 
> Rick
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.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


Getting weekday name from weekday number?

2011-10-18 Thread Rick Mann
Hi. Given a day-of-week number, what's the best way to get the abbreviated name 
of that weekday? I've tried using NSDateComponents in various ways 
(stand-alone, building off the current date, etc.) to get at it (by using 
NSDateFormatter on the resulting date), but none seem to work. Basically, 
setting the weekday on NSDateComponents seems to do nothing.

Matters are complicated by the fact that two of the three format specifiers for 
weekday name use the "local" weekday number, which can vary by locale.

Any suggestions? I could just roll my own and localize it, but I'd rather just 
use what the OS provides.

The only other thing I can think to do is start with a known date for, say, 
Sunday, and add to that the weekday number I have, and the convert that date to 
a string formatted as a weekday name.

Thanks,

-- 
Rick

___

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

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

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

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


Re: Blocks vs. life, the universe and everything

2011-10-18 Thread Greg Parker
On Oct 18, 2011, at 6:42 AM, Jean-Daniel Dupas wrote:
> Le 18 oct. 2011 à 14:00, Michael Babin a écrit :
>> On Oct 17, 2011, at 2:49 PM, Greg Parker wrote:
>>> @autoreleasepool also works without ARC. It's faster than 
>>> NSAutoreleasePool. Use it.
>> 
>> What are the minimum requirements for using @autoreleasepool? The same as 
>> ARC, even when not used with ARC (Xcode 4.2 for Mac OS X v10.6 and v10.7 
>> (64-bit applications) and for iOS 4 and iOS 5)?
> 
> I tried to compile a program using @autoreleasepool and targeting 10.5, and 
> the compiler was smart enough to not call the new runtime functions, but 
> instead generate old [[NSAutoreleasPool alloc] init] and [pool drain] 
> messages.
> 
> So I guess it should works for all supported platforms.

That's right. The only requirement is the LLVM Compiler (aka clang). If your 
deployment target is too old for the new optimized autorelease pool 
implementation, the compiler will call the traditional NSAutoreleasePool 
methods instead.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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 get key code from "SysDefined" Carbon Event

2011-10-18 Thread James Walker

On 10/18/2011 1:00 PM, Jerry Krinock wrote:

I've registered a handler for global hot keys with the Carbon Event
Manager, using InstallEventHandler().  However, I'd like the user to
be able to specify *two* different global hot key functions.  Thus,
in my callback/handler, I need the key code and modifier flags of the
event, to determine which function they want.


The only documented parameter in the kEventClassKeyboard / 
kEventHotKeyPressed Carbon Event is


  kEventParamDirectObject (in, typeEventHotKeyID)
The ID of the hot key that was pressed.

That's the ID that was passed to RegisterEventHotKey.  That's what you 
should use to distinguish different hot keys.

--
  James W. Walker, Innoventive Software LLC
  
___

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: Launching 10.5 app on 10.4

2011-10-18 Thread James Walker

On 10/18/2011 12:33 PM, Nick Zitzmann wrote:


On Oct 18, 2011, at 12:37 PM, livinginlosange...@mac.com wrote:


What is the canonical method of alerting a user that an application is built 
for a newer version of OSX?


You need to set the LSMinimumSystemVersion or 
LSMinimumSystemVersionByArchitecture keys in your application's info.plist 
file. The former will block the app from running on any older version of the 
OS[1]. The latter is used to prevent certain architectures from being launched 
under certain versions of the OS, and is typically used to lock the 64-bit 
version of any app from running under Leopard[2].

If the key is set, and a user tries to run it under an unsupported OS, then 
they'll get an error message saying the app requires a newer OS version, except 
under Panther, where the error message won't appear due to a bug that was fixed 
in Tiger.

[1] except under Cheetah and Puma, where the key-value is ignored, but nobody 
uses Cheetah or Puma anymore
[2] since Leopard's 64-bit frameworks were very immature



If one does need to do something nice with Panther, there's this:



--
  James W. Walker, Innoventive Software LLC
  
___

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: 'Static' items in an NSOutlineView

2011-10-18 Thread Koen van der Drift
On Tue, Oct 18, 2011 at 3:21 PM, Quincey Morris
 wrote:
> On Oct 18, 2011, at 05:20 , Koen van der Drift wrote:
>
> We're talking about Core Data, right? Objects in a Core Data persistent
> store have no intrinsic order, though they can be indexed on one of their
> properties.
> Unfortunately, I've forgotten (if I ever knew) how you were approaching all
> this. The existence of these special top-level groups, plus the complication
> of Core Data, means that simply binding a NSTreeController to *a* data model
> is too inflexible. As I said before, in situations like this, you really
> want an intermediate data model.
>

Yes, I am using CoreData. I'm actually surprised that given the amount
of apps that use a similar layout, there is not that much info
available on how to set up these 'static' group items.. I'm going to
dig through Google code and see if I can find anything. I'll also
re-read your post on an intermediate datamodel.

- Koen.
___

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 get key code from "SysDefined" Carbon Event

2011-10-18 Thread Jerry Krinock
I've registered a handler for global hot keys with the Carbon Event Manager, 
using InstallEventHandler().  However, I'd like the user to be able to specify 
*two* different global hot key functions.  Thus, in my callback/handler, I need 
the key code and modifier flags of the event, to determine which function they 
want.

In my handler, I convert the given Carbon EventRef to a NSEvent using +[NSEvent 
eventWithEventRef:].  If I send this NSEvent a -keyCode, -characters, or 
-charactersIgnoringModifiers message, an assertion is raised.  I understand 
that this is because the event type is not a key event[1].  Actually, it is 
this weird "SysDefined" event [2].

I also tried to get the -CGEvent of this event, hoping that it might be the 
"underlying key event", but unfortunately the result appears to be just a copy 
of the same SysDefined event, which behaves in the same way.  Similarly, 
-[NSApp currentEvent] gives me the same stupid thing.

Getting the modifier flags (cmd, option, etc.) via -modifierFlags works as 
desired!

It is odd that Apple would give me the modifier flags but not the key code.  
Does anyone know how to get the key code, or at least the character, in this 
situation?

Thanks,

Jerry Krinock

I understand that my handler also gets userData.  Unfortunately this userData 
is useless for my purpose, since it is set in InstallEventHandler() and not in 
RegisterEventHotKey().  InstallEventHandler() installs the same handler with 
the same user data for all events of the same type, i.e. 
kEventClassKeyboard:kEventHotKeyPressed.

I suppose that another way to solve this problem would be if there were some 
kind of system function that would tell me, post-event, "What was the last key 
that the user pressed?"  Is there such a thing?

[1]  
http://www.cocoabuilder.com/archive/cocoa/129171-nsevent-handling-in-panther.html?q=NSEvent+keyCode+invalid+message#129171

[2] For example, it logs the following -description…

NSEvent: type=SysDefined loc=(335,409) time=116856.4 flags=0x100108 win=0x0 
winNum=0 ctxt=0x26b5b subtype=6 data1=61748032 data2=61748032

The numbers data1 and data2 are always equal to each other, but are different, 
a higher value, with each hot key event, even if user hits the same hot key. I 
suppose they could be pointers (this is a 32-bit app), but to what?

___

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: Launching 10.5 app on 10.4

2011-10-18 Thread Nick Zitzmann

On Oct 18, 2011, at 12:37 PM, livinginlosange...@mac.com wrote:

> What is the canonical method of alerting a user that an application is built 
> for a newer version of OSX?

You need to set the LSMinimumSystemVersion or 
LSMinimumSystemVersionByArchitecture keys in your application's info.plist 
file. The former will block the app from running on any older version of the 
OS[1]. The latter is used to prevent certain architectures from being launched 
under certain versions of the OS, and is typically used to lock the 64-bit 
version of any app from running under Leopard[2].

If the key is set, and a user tries to run it under an unsupported OS, then 
they'll get an error message saying the app requires a newer OS version, except 
under Panther, where the error message won't appear due to a bug that was fixed 
in Tiger.

[1] except under Cheetah and Puma, where the key-value is ignored, but nobody 
uses Cheetah or Puma anymore
[2] since Leopard's 64-bit frameworks were very immature

Nick Zitzmann


___

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: Launching 10.5 app on 10.4

2011-10-18 Thread Charles Srstka
On Oct 18, 2011, at 1:55 PM, Patrick Cusack wrote:

> Ok, so it will warn the user? I had an experience where the application 
> wouldn't launch and no alert panel would open.
> 
> Thanks,
> 
> patrick
> 
> On Oct 18, 2011, at 11:39 AM, Tim Schröder wrote:
> 
>> I don't think there is one. If the build settings are correct, OS X won't 
>> start the application but will display an error message.
>> 
>> Tim

I think that feature was added to the OS at some point, but I’m not sure 
exactly when that was.

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: 'Static' items in an NSOutlineView

2011-10-18 Thread Quincey Morris
On Oct 18, 2011, at 05:20 , Koen van der Drift wrote:

> when my app starts the first time, I would like to have the
> outline view be prepopulated with a few groups: LIBRARY, FAVORITES,
> RECENT and maybe Group1 (a child of LIBRARY).  I did all that, but did
> not add Group1 to be a child of LIBRARY, so I will do that too. Am I
> correct in doing this through an NSFetchRequest, for an entity
> @"Group" with a predicate @"Library"?

You'd probably be better off finding all of your "special" group objects when 
your app first accesses an existing persistent store, and keeping the pointers 
in instance or static variables. But you can fetch them on demand if you want.

> Do you mean that if I create the 'static' items in the order I want
> them to be displayed (LIBRARY - FAVORITES - RECENT), that's the order
> in which they always will be displayed?

We're talking about Core Data, right? Objects in a Core Data persistent store 
have no intrinsic order, though they can be indexed on one of their properties.

Unfortunately, I've forgotten (if I ever knew) how you were approaching all 
this. The existence of these special top-level groups, plus the complication of 
Core Data, means that simply binding a NSTreeController to *a* data model is 
too inflexible. As I said before, in situations like this, you really want an 
intermediate data model.


___

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

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

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

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


Re: Custom NSArrayController that manages its own array?

2011-10-18 Thread Quincey Morris
On Oct 18, 2011, at 10:44 , Jens Alfke wrote:

> To help bind my data model to AppKit tables, I’ve written a custom class that 
> implements KVC collection accessors to define a mutable-array property. That 
> is, it implements methods like -countOfEntries, objectInEntriesAtIndex:, 
> insertObject:inEntriesAtIndex, etc. I can then bind this as the contentArray 
> property of an NSArrayController, and use that controller to drive a table 
> view and master-detail UI.
> 
> I’d like to avoid using a separate class, though (so I can make this setup 
> more easily reusable.) Is it feasible to subclass NSArrayController and put 
> the collection access methods in the subclass? Then I’d just have an 
> “EntryArrayController” class I could drop into my nib. From the docs I can’t 
> figure out whether this is an appropriate thing to do.
> 
> —Jens (still mildly confused by bindings after all these years :-p)

(I started writing a longer reply to this, but it turned into a rant about 
NS…Controller objects that bored even me. Here's the essence…)

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


Re: Custom NSArrayController that manages its own array?

2011-10-18 Thread Keary Suska
On Oct 18, 2011, at 11:44 AM, Jens Alfke wrote:

> To help bind my data model to AppKit tables, I’ve written a custom class that 
> implements KVC collection accessors to define a mutable-array property. That 
> is, it implements methods like -countOfEntries, objectInEntriesAtIndex:, 
> insertObject:inEntriesAtIndex, etc. I can then bind this as the contentArray 
> property of an NSArrayController, and use that controller to drive a table 
> view and master-detail UI.
> 
> I’d like to avoid using a separate class, though (so I can make this setup 
> more easily reusable.) Is it feasible to subclass NSArrayController and put 
> the collection access methods in the subclass? Then I’d just have an 
> “EntryArrayController” class I could drop into my nib. From the docs I can’t 
> figure out whether this is an appropriate thing to do.

There is no reason that an NSArrayController cannot manage its own content (in 
fact it is coded to do so), but the idea that the content would be "keyed" is 
odd, as there generally isn't any need to. I.e., the array controller would not 
bind to itself, and if any other array controller wants its content it can 
simply bind to arrangedObjects. So the whole collection KVC stuff is 
unnecessary.

In your subclass you could use the machinery afforded by 
automaticallyPreparesContent, or simply set the content on awakeFromNib or 
whenever it is needed.

HTH,

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

___

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

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

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

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


Re: Launching 10.5 app on 10.4

2011-10-18 Thread Patrick Cusack
Ok, so it will warn the user? I had an experience where the application 
wouldn't launch and no alert panel would open.

Thanks,

patrick

On Oct 18, 2011, at 11:39 AM, Tim Schröder wrote:

> I don't think there is one. If the build settings are correct, OS X won't 
> start the application but will display an error message.
> 
> Tim
> 
> 
> 
> Am 18.10.2011 um 20:37 schrieb livinginlosange...@mac.com:
> 
>> What is the canonical method of alerting a user that an application is built 
>> for a newer version of OSX?
>> 
>> Patrick
>> ___
>> 
>> 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/tim%40timschroeder.net
>> 
>> This email sent to t...@timschroeder.net
> 

___

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

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

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

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


Re: Launching 10.5 app on 10.4

2011-10-18 Thread Tim Schröder
I don't think there is one. If the build settings are correct, OS X won't start 
the application but will display an error message.

Tim



Am 18.10.2011 um 20:37 schrieb livinginlosange...@mac.com:

> What is the canonical method of alerting a user that an application is built 
> for a newer version of OSX?
> 
> Patrick
> ___
> 
> 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/tim%40timschroeder.net
> 
> This email sent to t...@timschroeder.net

___

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

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

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

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


Launching 10.5 app on 10.4

2011-10-18 Thread livinginlosangeles
What is the canonical method of alerting a user that an application is built 
for a newer version of OSX?

Patrick
___

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: IBOutlet getter/setter pattern question

2011-10-18 Thread Eeyore
Thanks Matt, was kind of hoping you would provide some insight (your responses 
to others have been helpful).

> Very ingenious, but doesn't it leave a lot of stuff lying around that is just 
> an accident waiting to happen? You are assuming that setLabel: will be called 
> only by the nib-loading mechanism; but how do you know? Someone else can call 
> setLabel: later and get very weird results.

I guess that was my question. When I declare something as an IBOutlet, am I 
exposing it to others? If I'm the only one to access it, then only I can shoot 
myself in my foot. However, the question is now moot, see below.

> How about giving the label, if created in the nib, a tag number (how much 
> trouble can that be, since you had to go into the nib in order to make the 
> label in the first place) so that no ivar is needed in order to find it?

I haven't used tags enough in the past to think of it, but this appears to be 
the solution.

Aaron

___

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: IBOutlet getter/setter pattern question

2011-10-18 Thread Matt Neuburg
On Sun, 16 Oct 2011 13:53:05 -0700, Eeyore  said:
>I noticed that I many of my IBOutlets were only being used to modify the view 
>from the viewDidLoad methods but which were not accessed later in my code. 
>These outlets exist so that I can keep consistent appearance settings in a 
>large number of nibs without actually editing each nib. As a simplified 
>example (typed into Mail, but should describe the pattern), consider the 
>following.
>
>- begin new style -
>@interface Class : UIViewController
>@property (nonatomic, assign) IBOutlet UILabel* label;
>@end
>
>@implementation Class
>- (void)setLabel:(UILabel*)label
>{
>   label.textColor = [UIColor lightGray];
>   label.text = NSLocalizedString(@"Blah blah blah", @"Label text");
>
>}
>
>- (UILabel*)label
>{
>   NSAssert(NO, @"label is inaccessible");
>   return nil;
>}
>@end
>- end new style -

Very ingenious, but doesn't it leave a lot of stuff lying around that is just 
an accident waiting to happen? You are assuming that setLabel: will be called 
only by the nib-loading mechanism; but how do you know? Someone else can call 
setLabel: later and get very weird results.

Also, you're making some assumptions (it seems to me) about when things happen, 
and those assumptions could sometimes be wrong.

What's the problem that needs solving, really? I'd say there are two:

(1) There's a lot of buttressing just to support one little ivar that you're 
only going to refer to once, to initialize it. One might argue that this hardly 
matters, since the buttressing is created for you automatically either when you 
drag to create the outlet or by ARC, but let's pass on that for a moment.

(2) You have a desire to initialize these objects in "the right place", where 
that isn't the nib.

But surely, then, there are better solutions. How about a self-initializing 
label (a UILabel subclass)? How about creating the label itself in code, not in 
the nib at all? How about giving the label, if created in the nib, a tag number 
(how much trouble can that be, since you had to go into the nib in order to 
make the label in the first place) so that no ivar is needed in order to find 
it? I could probably go on and on... 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


Custom NSArrayController that manages its own array?

2011-10-18 Thread Jens Alfke
To help bind my data model to AppKit tables, I’ve written a custom class that 
implements KVC collection accessors to define a mutable-array property. That 
is, it implements methods like -countOfEntries, objectInEntriesAtIndex:, 
insertObject:inEntriesAtIndex, etc. I can then bind this as the contentArray 
property of an NSArrayController, and use that controller to drive a table view 
and master-detail UI.

I’d like to avoid using a separate class, though (so I can make this setup more 
easily reusable.) Is it feasible to subclass NSArrayController and put the 
collection access methods in the subclass? Then I’d just have an 
“EntryArrayController” class I could drop into my nib. From the docs I can’t 
figure out whether this is an appropriate thing to do.

—Jens (still mildly confused by bindings after all these years :-p)

___

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 bad memory access

2011-10-18 Thread Jens Alfke

On Oct 17, 2011, at 9:26 PM, Wilker wrote:

> I wanna it mapped always and uncached because I don't wanna read the entire
> file, just some pieces of it (small pieces), so, if the user is acessing a
> file from an external drive, and the file has 8gb, I only wanna read 64kb,
> so, I don't wanna read it all just for 64kb.

Just use fopen/fseek/fread/fclose. Mapping in the entire file just so you can 
read 64kb is overkill.

—Jens___

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: Blocks vs. life, the universe and everything

2011-10-18 Thread Jean-Daniel Dupas

Le 18 oct. 2011 à 16:09, Michael Babin a écrit :

> On Oct 18, 2011, at 8:42 AM, Jean-Daniel Dupas wrote:
> 
>> 
>> Le 18 oct. 2011 à 14:00, Michael Babin a écrit :
>> 
>>> What are the minimum requirements for using @autoreleasepool? The same as 
>>> ARC, even when not used with ARC (Xcode 4.2 for Mac OS X v10.6 and v10.7 
>>> (64-bit applications) and for iOS 4 and iOS 5)?
>> 
>> 
>> I tried to compile a program using @autoreleasepool and targeting 10.5, and 
>> the compiler was smart enough to not call the new runtime functions, but 
>> instead generate old [[NSAutoreleasPool alloc] init] and [pool drain] 
>> messages.
>> 
>> So I guess it should works for all supported platforms.
> 
> Which compiler/IDE version did you use? Wondering what the minimum 
> requirements are for both the tools and the binary created (your test results 
> are encouraging for 10.5 support for the binary itself).
> 


You need a modern version of clang (one that supports ARC I suppose), so I 
think Xcode 4.2 is required. 

Compiling using -mmacosx-version-min=10.5 generates simple msg_send, and 
compiling for modern target generates call to _objc_autoreleasePoolPush/Pop.


-- 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: Blocks vs. life, the universe and everything

2011-10-18 Thread Michael Babin
On Oct 18, 2011, at 8:42 AM, Jean-Daniel Dupas wrote:

> 
> Le 18 oct. 2011 à 14:00, Michael Babin a écrit :
> 
>> What are the minimum requirements for using @autoreleasepool? The same as 
>> ARC, even when not used with ARC (Xcode 4.2 for Mac OS X v10.6 and v10.7 
>> (64-bit applications) and for iOS 4 and iOS 5)?
> 
> 
> I tried to compile a program using @autoreleasepool and targeting 10.5, and 
> the compiler was smart enough to not call the new runtime functions, but 
> instead generate old [[NSAutoreleasPool alloc] init] and [pool drain] 
> messages.
> 
> So I guess it should works for all supported platforms.

Which compiler/IDE version did you use? Wondering what the minimum requirements 
are for both the tools and the binary created (your test results are 
encouraging for 10.5 support for the binary itself).

___

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 bad memory access

2011-10-18 Thread Scott Ribe
On Oct 17, 2011, at 10:26 PM, Wilker wrote:

>NSData *fileData = [NSData dataWithContentsOfFile:path
> options:NSDataReadingMappedAlways | NSDataReadingUncached error:&error];

Do you retain fileData?

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




___

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

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

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

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


Re: Blocks vs. life, the universe and everything

2011-10-18 Thread Jean-Daniel Dupas

Le 18 oct. 2011 à 14:00, Michael Babin a écrit :

> On Oct 17, 2011, at 2:49 PM, Greg Parker wrote:
> 
>> On Oct 15, 2011, at 12:28 PM, Jean-Daniel Dupas wrote:
>>> Le 15 oct. 2011 à 21:10, Seth Willits a écrit :
 
 Unrelated, when did @autoreleasepool pop in? I don't remember if I knew 
 about that or not. It's _used_ once in the Obj-C Programming Language 
 guide, but never documented anywhere I can find.
>>> 
>>> It appears with ARC. 
>>> 
>>> For the rational, you can read this:
>>> 
>>> http://clang.llvm.org/docs/AutomaticReferenceCounting.html#autoreleasepool
>> 
>> @autoreleasepool also works without ARC. It's faster than NSAutoreleasePool. 
>> Use it.
> 
> What are the minimum requirements for using @autoreleasepool? The same as 
> ARC, even when not used with ARC (Xcode 4.2 for Mac OS X v10.6 and v10.7 
> (64-bit applications) and for iOS 4 and iOS 5)?


I tried to compile a program using @autoreleasepool and targeting 10.5, and the 
compiler was smart enough to not call the new runtime functions, but instead 
generate old [[NSAutoreleasPool alloc] init] and [pool drain] messages.

So I guess it should works for all supported platforms.


-- 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: How to get from the Itunes App Store application information

2011-10-18 Thread Eric E. Dolecki
http://www.apple.com/rss/

Enjoy :)


2011/10/18 吴明 

> How to get top five from the Itunes App Store application information.
> Were to be paid and free.
>
>
>
> ___
>
> 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/edolecki%40gmail.com
>
> This email sent to edole...@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: Keeping grayscale image grayscale

2011-10-18 Thread Jonathan Taylor
Belated thanks for the various replies to my question. I'm working through the 
posted code and links now and looking at what I can learn from it. One query 
though:

On 12 Oct 2011, at 16:42, Heinrich Giesen wrote:
> Another rule of thumb is: if you need -[NSImage TIFFRepresentation] you do 
> something wrong.
> (There are of course counterexamples).

I've heard this said before, and have mostly eliminated it from my code. 
However the cocoadev page on NSBitmapImageRep does specifically say "A correct 
use of TIFFRepresentation is one that sends the resulting data outside of the 
process. For example, write to disk, write to pasteboard, write to network". So 
is there a particular reason why there is a problem with my line:
[[destImage TIFFRepresentation] writeToFile:destFile atomically:NO];

Thanks
Jonny___

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: 'Static' items in an NSOutlineView

2011-10-18 Thread Koen van der Drift
On Tue, Oct 18, 2011 at 12:19 AM, Quincey Morris
 wrote:
> On Oct 17, 2011, at 19:58 , Koen van der Drift wrote:
>
> What it should look like is:
>
> LIBRARY (static)
> Group1
> Group2
>
>
> FAVORITES (static)
> Group3
> Group4
>
> RECENT (static)
>
> You've missed something basic. In the above example (modeled as you
> previously explained on the source lists in iTunes and Mail), there are
> multiple levels of hierarchy of the data that represents the list content.
> At the root level is the root item, which is represented by a nil NSOutline
> item in your data source methods. It doesn't get displayed, but its children
> do. If you're using a tree controller, this root level doesn't exist.
> At the next level are the content groupings, of which there are 3: Library,
> Favorites and Recent. This is the topmost level when using a tree
> controller.
> At the next level are the children of the content groupings. Group1 and
> Group2 are children of Library; Group3 and Group4 are children of Favorites;
> Recent has no children.
> Below those levels, your groups may have their own children.
> What you're mis-calling "static groups" are actually parent items of the
> real group items. The reason there are no disclosure triangles is that these
> top-level groups are *always* expanded, and have their disclosure triangle
> suppressed via the delegate method I mentioned in an earlier email.


Thanks for the explanation, I now see what I did wrong. As I mentioned
before, when my app starts the first time, I would like to have the
outline view be prepopulated with a few groups: LIBRARY, FAVORITES,
RECENT and maybe Group1 (a child of LIBRARY).  I did all that, but did
not add Group1 to be a child of LIBRARY, so I will do that too. Am I
correct in doing this through an NSFetchRequest, for an entity
@"Group" with a predicate @"Library"?

> Also, regarding sorting of items at the same level, if there is no sort
> descriptor in control, the order of the items is the order in which your
> data source methods associate items with child indexes (if you're using a
> data source) *or* the order of the child item array in each parent (if
> you're using a tree controller).
>

Do you mean that if I create the 'static' items in the order I want
them to be displayed (LIBRARY - FAVORITES - RECENT), that's the order
in which they always will be displayed?

Thanks again,

- Koen.
___

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: Blocks vs. life, the universe and everything

2011-10-18 Thread Michael Babin
On Oct 17, 2011, at 2:49 PM, Greg Parker wrote:

> On Oct 15, 2011, at 12:28 PM, Jean-Daniel Dupas wrote:
>> Le 15 oct. 2011 à 21:10, Seth Willits a écrit :
>>> 
>>> Unrelated, when did @autoreleasepool pop in? I don't remember if I knew 
>>> about that or not. It's _used_ once in the Obj-C Programming Language 
>>> guide, but never documented anywhere I can find.
>> 
>> It appears with ARC. 
>> 
>> For the rational, you can read this:
>> 
>> http://clang.llvm.org/docs/AutomaticReferenceCounting.html#autoreleasepool
> 
> @autoreleasepool also works without ARC. It's faster than NSAutoreleasePool. 
> Use it.

What are the minimum requirements for using @autoreleasepool? The same as ARC, 
even when not used with ARC (Xcode 4.2 for Mac OS X v10.6 and v10.7 (64-bit 
applications) and for iOS 4 and iOS 5)?

___

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


start HLS live stream from beginning of sliding window

2011-10-18 Thread Johan Rydberg
Hi,

Not sure there's a better forum for this, but here goes:

Is there a way to instruct the iOS movie player to start playing a
live HLS stream
from the beginning of the window instead of at the end?

The scenario is this: we have an event, where we want to keep the content around
for later use.  So we store all segments, but while the stream is
ongoing we do not
have any X-EXT-ENDLIST tags, so the stream is interpret as a live stream by the
player.  But we want clients to start watching from the beginning of
the event, even
in the case of where it is ongoing.

Is this possible to do in some way, either in the player or by
constructing the playlists
in some way?

I've experimented with X-EXT-PLAYLIST-TYPE: EVENT , with or without end tags.
But without any success.
___

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


iCloud Problem

2011-10-18 Thread Gerriet M. Denkmann
This might not be the right list to ask this question, but could someone tell 
me where to ask it?

Registering for iCloud Apple tells me that an eMail has been sent to ...
But no eMail has arrived (yes, I checked the Junk folder as well).
And sending a test eMail to the same address works fine.

Kind regards,

Gerriet.

___

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 get from the Itunes App Store application information

2011-10-18 Thread 吴明
How to get top five from the Itunes App Store application information.
Were to be paid and free.



___

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