Changeset 631

Show
Ignore:
Timestamp:
07/12/08 16:50:14 (6 months ago)
Author:
steile
Message:

Add +sharedFrontRowPreferences? to return the shared
front row preferences object, from either RUIPreferences or BRPreferences,
depending on which one is present (RUIPreferences is preferred).

ATV 2.1 renamed RUIPreferences to BRPreferences, but it is otherwise
compatible.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireCompatibilityClasses/SapphireFrontRowCompat.h

    r499 r631  
    366366 */ 
    367367+ (NSArray *)callStackReturnAddressesForException:(NSException *)exception; 
     368 
     369/*! 
     370 * @brief Get the sharedFrontRowPreferences object. 
     371 * 
     372 * On Apple TV < 2.1, the RUIPreferences class is used for this.  On 2.1, the class is renamed to BRPreferences. 
     373 * 
     374 * @return the preferences object 
     375 */ 
     376+ (RUIPreferences *)sharedFrontRowPreferences; 
    368377@end 
    369378 
  • trunk/SapphireCompatibilityClasses/SapphireFrontRowCompat.m

    r501 r631  
    421421        return [[exception userInfo] objectForKey:NSStackTraceKey]; 
    422422} 
    423 @end 
     423 
     424+ (RUIPreferences *)sharedFrontRowPreferences { 
     425  Class preferencesClass = NSClassFromString(@"RUIPreferences"); 
     426  if(!preferencesClass) preferencesClass = NSClassFromString(@"BRPreferences"); 
     427   
     428  if(preferencesClass) 
     429    return [preferencesClass sharedFrontRowPreferences]; 
     430  else 
     431    return nil; 
     432
     433 
     434@end