This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MyViewController inherts from UIViewController | |
@interface MyViewController() | |
// ---------QUESTIONS--------- | |
// 1. Should you do this, only to avoid casting later when you need to access MyCustomView specific properties? | |
// 2. How does the compiler treat this property (and the backing ivar) that's re-declared at the inheriting class level? | |
// Does it shadow the version that exists at the UIViewController level? | |
// 3. Wouldn't this cause a leak? | |
@property (nonatomic, strong) MyCustomView *view; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
NSBundle *bundle = [NSBundle bundleForClass:[self class]]; | |
NSLog(@"Strings file: %@", [bundle pathForResource:@"Localizable" ofType:@".strings"]); | |
NSLog(@"Localizations: %@", [bundle localizations]); | |
NSLog(@"Local Dict: %@", [bundle localizedInfoDictionary]); | |
NSLog(@"localizedStringForKey: %@", [bundle localizedStringForKey:@"error.message.title"value:@"Wha Happened?" table:nil]); | |
NSLog(@"Localized String: %@", NSLocalizedString(@"error.message.title", @"Are you sure you want to start a new game?")); | |
// Rest of didFinishLaunchingWithOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Different ways to concatenate strings | |
// | |
// Method 1: Using stringByAppendingString | |
// | |
NSString *string1 = @"First Text "; | |
NSString *string2 = @"Joined With Second"; | |
NSString *stringAppendResult = [string1 stringByAppendingString:string2]; |