Re: Paging UITableView

2012-02-18 Thread Roland King
Indeed in the documentation about nesting UIScrollViews it says ...

Cross-directional scrolling is the term used when a scroll view that is a 
subview of another scroll view scrolls at a 90 degree angle as shown in the 
right image in Figure 6-1.
An example of cross directional scrolling can be found in the Stocks 
application. The top view is a table view, but the bottom view is a horizontal 
scroll view configured using paging mode. While two of its three subviews are 
custom views, the third view (that contains the news articles) is a UITableView 
(a subclass of UIScrollView) that is a subview of the horizontal scroll view. 
After you scroll horizontally to the news view, you can then scroll its 
contents vertically.
On Feb 19, 2012, at 1:09 PM, Luke Hiesterman wrote:

> Who/what told you that table views can't be in scroll views? It wouldn't play 
> nicely with swipe to delete, but iOS generally supports nested scroll views 
> (and a table view is just a special scroll view).
> 
> Luke
> 
> On Feb 18, 2012, at 8:58 PM, "R"  wrote:
> 
>> I understand that one is not suppose to embed a UITableView in a
>> UIScrollView.  I would like the ability to "Page" (horizontal scroll)
>> multiple UITableViews.  Is there a way to do this without using
>> UIScrollView?
>> 
>> R
>> ___
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to luket...@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:
> https://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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

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

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

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


Re: Paging UITableView

2012-02-18 Thread Luke Hiesterman
Who/what told you that table views can't be in scroll views? It wouldn't play 
nicely with swipe to delete, but iOS generally supports nested scroll views 
(and a table view is just a special scroll view).

Luke

On Feb 18, 2012, at 8:58 PM, "R"  wrote:

> I understand that one is not suppose to embed a UITableView in a
> UIScrollView.  I would like the ability to "Page" (horizontal scroll)
> multiple UITableViews.  Is there a way to do this without using
> UIScrollView?
> 
> R
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
> 
> This email sent to luket...@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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Paging UITableView

2012-02-18 Thread R
I understand that one is not suppose to embed a UITableView in a
UIScrollView.  I would like the ability to "Page" (horizontal scroll)
multiple UITableViews.  Is there a way to do this without using
UIScrollView?

R
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: __block __weak - am I doing this right?

2012-02-18 Thread Greg Parker
On Feb 18, 2012, at 9:23 AM, Fritz Anderson wrote:
> On 18 Feb 2012, at 7:41 AM, steven Hooley wrote:
>> Matt Neuburg wrote:
>>> The same issue came up again later the same day:
>>> 
>>>  __block UIBackgroundTaskIdentifier bti = [[UIApplication sharedApplication]
>>>  beginBackgroundTaskWithExpirationHandler: 
>>> ^{
>>>  [[UIApplication sharedApplication] endBackgroundTask:bti];
>>>  }];
>>> 
>>> Without __block, bti is invalid, and you won't find that out easily because 
>>> it's unlikely that you'll actually expire. :) m.
>> 
>> Can this be right?
> 
> If I understand why you're mystified, consider this, without the __block 
> declaration.
> 
> - bti starts as junk.
> 
> - The block is instantiated, and captures the junk _value_ (because it's not 
> a __block variable) of bti.
> 
> - The beginBackgroundTask… method creates the background task identifier.
> 
> - That identifier is then assigned to bti. bti is no longer junk, but that 
> does the block no good, because it's already captured the junk value.

Precisely. clang now warns about this case (or will soon; I don't know which 
release of Xcode has this).

test.m:9:33: warning: variable 'x' is uninitialized when captured by block 
[-Wuninitialized]
id x = [Foo methodWithBlock:^{ return x; }];


-- 
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
> That's exactly *why* I've been asking about it - so I can fix it (and explain 
> the fix) for the new edition:

Sorry, I did not mean to imply 'many people have done it wrong because
of this book'. What i Failed at saying was "but.. I've seen this
pattern everywhere, even in Apple sample code, it can't be a bug!". I
thought this because i'd never seen the taskId declared as __block in
the sample code or docs.

Of course, i'd made an error not noticing that in the sample code/docs
the UIBackgroundTaskIdentifier is always an iVar and not realising
that this was critical to it's operation (and why i'd never seen it
declared __block).

I really appreciate you finding my bugs for me.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: __block __weak - am I doing this right?

2012-02-18 Thread Matt Neuburg

On Feb 18, 2012, at 12:00 PM, cocoa-dev-requ...@lists.apple.com wrote:

> Date: Sat, 18 Feb 2012 18:39:55 +
> From: steven Hooley 
> To: Fritz Anderson 
> Cc: cocoa-dev@lists.apple.com
> Subject: Re: __block __weak - am I doing this right?
> Message-ID:
>   
> Content-Type: text/plain; charset=windows-1252
> 
> Thanks, I'm just surprised that this common, often cited example is broken.
> 
> http://books.google.co.uk/books?id=bwQY3_5FMg8C&pg=PA775&lpg=PA775&dq=beginBackgroundTaskWithExpirationHandler&source=bl&ots=aMuw5-hiP6&sig=NFKFDhaPw41KnfOo1n7Z_OaJflM&hl=en&sa=X&ei=T-s_T76JEaOl0AW0y-iPDw&ved=0CGoQ6AEwCTgK#v=onepage&q=beginBackgroundTaskWithExpirationHandler&f=false
> 
> That's an awful lot of broken code.

No duh. That's exactly *why* I've been asking about it - so I can fix it (and 
explain the fix) for the new edition:

https://plus.google.com/115941336284685245715/posts/H85LHwSDxP1

m.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


splitviews and subviews

2012-02-18 Thread H. Miersch
hi.
in my project i have a splitview that can contain one or more custom views 
where i do my drawing. what happens when i send a setNeedsDisplay: message to 
the splitview? will it send the message on to its subviews or do i have to 
handle that myself?
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Proper Way to use the Sandbox

2012-02-18 Thread Brad Stone
I modified my Mac shoebox app for sandboxing.  My application stores the user 
info as a series of file packages in a series of directories all rolling up 
into a Documents folder.  It works fine but now I noticed the sandbox directory 
structure doesn't get backed up with Time Machine.  Obviously, when it was in 
the regular documents folder it got backed up.  Now that it's in the app 
sandbox it seems like it does not. 
 
What is the recommended approach to make sure the user data gets backed up by 
Time Machine?  
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
Thanks, I'm just surprised that this common, often cited example is broken.

http://books.google.co.uk/books?id=bwQY3_5FMg8C&pg=PA775&lpg=PA775&dq=beginBackgroundTaskWithExpirationHandler&source=bl&ots=aMuw5-hiP6&sig=NFKFDhaPw41KnfOo1n7Z_OaJflM&hl=en&sa=X&ei=T-s_T76JEaOl0AW0y-iPDw&ved=0CGoQ6AEwCTgK#v=onepage&q=beginBackgroundTaskWithExpirationHandler&f=false

That's an awful lot of broken code.


On 18 February 2012 17:23, Fritz Anderson  wrote:
> On 18 Feb 2012, at 7:41 AM, steven Hooley wrote:
>
>>> The same issue came up again later the same day:
>>>
>>>   __block UIBackgroundTaskIdentifier bti = [[UIApplication 
>>> sharedApplication]
>>>                                   beginBackgroundTaskWithExpirationHandler: 
>>> ^{
>>>       [[UIApplication sharedApplication] endBackgroundTask:bti];
>>>   }];
>>>
>>> Without __block, bti is invalid, and you won't find that out easily because 
>>> it's unlikely that you'll actually expire. :) m.
>>
>> Can this be right?
>
> If I understand why you're mystified, consider this, without the __block 
> declaration.
>
> - bti starts as junk.
>
> - The block is instantiated, and captures the junk _value_ (because it's not 
> a __block variable) of bti.
>
> - The beginBackgroundTask… method creates the background task identifier.
>
> - That identifier is then assigned to bti. bti is no longer junk, but that 
> does the block no good, because it's already captured the junk value.
>
>
> If bti is declared __block, the block captures (notionally) a _reference_ to 
> bti. It doesn't evaluate bti until it executes, which will be after the 
> assignment.
>
>        — F
>

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSPopUpButton not accepting setMenu: from WindowController code

2012-02-18 Thread Erik Stainsby
Michael gave me the clue. I still had the window's owner as AppDelegate. When I 
corrected that to the WindowController all is well.  Details details.

~ Erik

On 2012-02-18, at 9:55 AM, Keary Suska wrote:

> On Feb 18, 2012, at 8:37 AM, Erik Stainsby wrote:
> 
>> 
>> [myPUBtn setMenu:menu] accepted in MyAppDelegate but does not accept 
>> setMenu:menu when relocated to an NSWindowController.  I'm thinking there is 
>> something I have missed about the loading sequence.
> 
> When you call this method, what object do you pass as "owner"? Is the outlet 
> connected from the File's Owner, or an object in the same xib?
> 
>> - (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner {
>>   self = [super initWithWindowNibName:windowNibName owner:owner];
>>   if (self) {
>>  [self setActionPlugins:[self loadPluginsWithPrefix:@"Action"]]; 
>>   }
>>   return self;
>> }
>> 
>> 
>> - (void)windowDidLoad
>> {
>>   [super windowDidLoad];
>>  NSMenu * menu = [[NSMenu alloc] init];
>> 
>>  for(RSTrixiePlugin * p in actionPlugins)
>>  {
>>  NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle:[p 
>> name] action:@selector(showActionPlugin:) keyEquivalent:@""];
>>  [menuItem setRepresentedObject:p];
>>  [menu addItem:menuItem];
>>  NSLog(@"%s- [%04d] added action menu item for plugin: %@", 
>> __PRETTY_FUNCTION__, __LINE__, [p name]);
>>  }
>>  [actionMenu setMenu:menu];
>>  NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, menu);   
>> // shows description of populated menu
>>  NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[menu 
>> itemArray] count]);  // returns 2
>>  NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[[actionMenu 
>> menu] itemArray] count]);  // returns 2
>>  NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, [actionMenu 
>> menu]);  // (null)
>>  [actionMenu setNeedsDisplay:YES];  // on a whim
>> }
>> 
>> 
>> […]
>> 
>> 
>> 
>> ___
>> 
>> 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:
>> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
>> 
>> This email sent to cocoa-...@esoteritech.com
> 
> 
> 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSPopUpButton not accepting setMenu: from WindowController code

2012-02-18 Thread Keary Suska
On Feb 18, 2012, at 8:37 AM, Erik Stainsby wrote:

> 
> [myPUBtn setMenu:menu] accepted in MyAppDelegate but does not accept 
> setMenu:menu when relocated to an NSWindowController.  I'm thinking there is 
> something I have missed about the loading sequence.

When you call this method, what object do you pass as "owner"? Is the outlet 
connected from the File's Owner, or an object in the same xib?

> - (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner {
>self = [super initWithWindowNibName:windowNibName owner:owner];
>if (self) {
>   [self setActionPlugins:[self loadPluginsWithPrefix:@"Action"]]; 
>}
>return self;
> }
> 
> 
> - (void)windowDidLoad
> {
>[super windowDidLoad];
>   NSMenu * menu = [[NSMenu alloc] init];
> 
>   for(RSTrixiePlugin * p in actionPlugins)
>   {
>   NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle:[p 
> name] action:@selector(showActionPlugin:) keyEquivalent:@""];
>   [menuItem setRepresentedObject:p];
>   [menu addItem:menuItem];
>   NSLog(@"%s- [%04d] added action menu item for plugin: %@", 
> __PRETTY_FUNCTION__, __LINE__, [p name]);
>   }
>   [actionMenu setMenu:menu];
>   NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, menu);   
> // shows description of populated menu
>   NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[menu 
> itemArray] count]);  // returns 2
>   NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[[actionMenu 
> menu] itemArray] count]);  // returns 2
>   NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, [actionMenu 
> menu]);  // (null)
>   [actionMenu setNeedsDisplay:YES];  // on a whim
> }
> 
> 
> […]
> 
> 
> 
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> 
> This email sent to cocoa-...@esoteritech.com


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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: __block __weak - am I doing this right?

2012-02-18 Thread Fritz Anderson
On 18 Feb 2012, at 7:41 AM, steven Hooley wrote:

>> The same issue came up again later the same day:
>> 
>>   __block UIBackgroundTaskIdentifier bti = [[UIApplication sharedApplication]
>>   beginBackgroundTaskWithExpirationHandler: 
>> ^{
>>   [[UIApplication sharedApplication] endBackgroundTask:bti];
>>   }];
>> 
>> Without __block, bti is invalid, and you won't find that out easily because 
>> it's unlikely that you'll actually expire. :) m.
> 
> Can this be right?

If I understand why you're mystified, consider this, without the __block 
declaration.

- bti starts as junk.

- The block is instantiated, and captures the junk _value_ (because it's not a 
__block variable) of bti.

- The beginBackgroundTask… method creates the background task identifier.

- That identifier is then assigned to bti. bti is no longer junk, but that does 
the block no good, because it's already captured the junk value.


If bti is declared __block, the block captures (notionally) a _reference_ to 
bti. It doesn't evaluate bti until it executes, which will be after the 
assignment.

— F


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

NSPopUpButton not accepting setMenu: from WindowController code

2012-02-18 Thread Erik Stainsby

[myPUBtn setMenu:menu] accepted in MyAppDelegate but does not accept 
setMenu:menu when relocated to an NSWindowController.  I'm thinking there is 
something I have missed about the loading sequence.

When all the code resided in MyAppDelegate I could load a list of plugins, 
build a menu item for each, and call setMenu:menu on the instance of 
NSPopUpButton connected in IB to a reference in the delegate. The appDelegate 
was getting messy so I refactored this window out to a NSWindowController, call 
-[controller initWithWindowNibName:owner:]
and remade all the connections. Several times to be sure.

The passage of code which builds out the menu items successfully executes. 
NSLog(@"%@",menu) shows the content expected.
NSLog(@"%@",[myPUBtn menu])  logs (null).

When the popup menu was being successfully populated from the AppDelegate I was 
running the code which does this work from -(void) 
applicationWillFinishLaunching;  Now that it resides in the WC I have tried 
variously: -windowDidLoad, -windowWillLoad, -awakeFromNib (not invoked), and 
even tacking it directly onto the end of initWithWindowNibName:owner:  The 
results are the same: the log shows the menu built and the setMenu: statement 
fires, but the target control does not receive the new menu.

My assumption at the moment is that it is a sequence of loading issue: that the 
popup button isn't present yet (?) when 
the menu hand off fires.

Here's the relevant selection from the code:

~ Erik




@interface RSTrixieEditor : NSWindowController

@property (retain) IBOutlet NSPopUpButton * actionMenu;

@end


@implementation RSTrixieEditor

@synthesize actionMenu; // popup button

- (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner {
self = [super initWithWindowNibName:windowNibName owner:owner];
if (self) {
[self setActionPlugins:[self loadPluginsWithPrefix:@"Action"]]; 
}
return self;
}


- (void)windowDidLoad
{
[super windowDidLoad];
NSMenu * menu = [[NSMenu alloc] init];

for(RSTrixiePlugin * p in actionPlugins)
{
NSMenuItem * menuItem = [[NSMenuItem alloc] initWithTitle:[p 
name] action:@selector(showActionPlugin:) keyEquivalent:@""];
[menuItem setRepresentedObject:p];
[menu addItem:menuItem];
NSLog(@"%s- [%04d] added action menu item for plugin: %@", 
__PRETTY_FUNCTION__, __LINE__, [p name]);
}
[actionMenu setMenu:menu];
NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, menu);   
// shows description of populated menu
NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[menu 
itemArray] count]);  // returns 2
NSLog(@"%s- [%04d] %lu", __PRETTY_FUNCTION__, __LINE__, [[[actionMenu 
menu] itemArray] count]);  // returns 2
NSLog(@"%s- [%04d] %@", __PRETTY_FUNCTION__, __LINE__, [actionMenu 
menu]);  // (null)
[actionMenu setNeedsDisplay:YES];  // on a whim
}


[…]



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
> The same issue came up again later the same day:
>
>__block UIBackgroundTaskIdentifier bti = [[UIApplication sharedApplication]
>beginBackgroundTaskWithExpirationHandler: 
> ^{
>[[UIApplication sharedApplication] endBackgroundTask:bti];
>}];
>
> Without __block, bti is invalid, and you won't find that out easily because 
> it's unlikely that you'll actually expire. :) m.


Can this be right?
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Localization for nibs

2012-02-18 Thread Stephane Sudre
On Thu, Feb 16, 2012 at 4:37 AM, Satyanarayana Chebrolu
 wrote:
> Hi,
> currently my application supports only English. In the future versions we 
> would like to have it in around 15 languages.
>
> What is the best practice for having localized nibs.
>
> 1) Common approach, different nibs for different languages.
>  +ve, straight forward.
>  -ve, Time consuming and maintenance effort.
> 2) By using Auto layout feature.
>  +ve, available only in Lion
>  -ve, not in Leopard and Snow Leopard

Some things that could be useful to make your decision:

- "When in Rome, do as the Romans do": check what Apple does. As far
as I know, they are still localizing with multiple nibs.

- Check what the guys who will localize the software would rather use.
The localization solutions based on just localizing the strings have
some side issues:

  - you absolutely need to provide context information for all the strings.

  - you generally end up with duplicates in your .strings files (e.g. DL2).

   - it's more difficult to adjust the layout for specific
localization requirements.

   - you absolutely need to provide a working binary, otherwise it's
not possible to do any kind of check.

- With .strings only localization, you're adding code to handle
something that can be done without additional code.

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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