Singleton class in Xcode

Coffee Coding · 15K views · 2012 · 14:18

Open on YouTube

Software architecture & designC, C++, Rust, Go & systems languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about sharing data between Objective-C classes and as a worked example of what a singleton class is.

Recommended by 1 people across 1 different months, 2013 to 2015.

What it is

A 2012 screencast by Coffee Coding that explains the singleton pattern in Objective-C, starting with theory and then building a singleton class from scratch in Xcode. It is aimed at iOS beginners who want to know how and why singletons work.

What people said

Recommends user2570984 · 2013-07 · Stack Overflow · on “Passing NSString from one class to another. (ECSlidingViewController?)”

Thank you @Wain. `singleton` was the keyword and that pointed me to the right direction. For other's who ended up here, I learnt about singleton classes with this video [this video] .

Cites user2707185 · 2013-11 · Stack Overflow · on “How can I get my own alert class respond to alertView clickedButtonAtIndex?”

I have a class named AlertView because I use a lot of alerts in my app and I wanted to optimize the usage of my UIAlertViews. But I have one problem when I want my AlertView class respond to the method: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex This is how the UIAlertView looks in my AlertView.h + (void)simpleWithMessage:(NSString *)message withTag:(int)tag withOtherBtnTitle:(NSString *)otherBtnTitle; This is how the UIAlertView looks in my AlertView.m #pragma mark - Simple alert with tag + (void)simpleWithMessageAndTag:(NSString *)message withTag:(int)tag withOtherBtnTitle:(NSString *)otherBtnTitle { UIAlertView *simpleWithMessageWithMessageAndTa

Cites DHEERAJ · 2015-07 · Stack Overflow · on “What do we mean by singleton class in objective c? Is it similar to nonatomic property or not?”

The Main similarity between them is both are THREAD-SAFE Check these links for a good idea of singleton classes [LINK] [LINK] [this video] (Example video)