(CocoaTouch) Cleanups

This commit is contained in:
Twinaphex 2015-05-05 22:52:42 +02:00
parent 9dafeaec3a
commit aac9012485

View File

@ -214,7 +214,6 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
size_t i;
RARunActionSheetDelegate* delegate = [[RARunActionSheetDelegate alloc] initWithCallbackBlock:callback];
UIActionSheet* actionSheet = [UIActionSheet new];
actionSheet.title = BOXSTRING(title);
actionSheet.delegate = delegate;
@ -399,7 +398,8 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (id)initWithSetting:(rarch_setting_t*)setting action:(void (^)())action
{
if ((self = [super init])) {
if ((self = [super init]))
{
_setting = setting;
_action = action;
}
@ -494,15 +494,12 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)resetValue:(UIGestureRecognizer*)gesture
{
struct string_list* items;
RAMenuItemGeneralSetting __weak* weakSelf;
RAMenuItemGeneralSetting __weak* weakSelf = self;
struct string_list *items = string_split("OK", "|");
if (gesture.state != UIGestureRecognizerStateBegan)
return;
weakSelf = self;
items = (struct string_list*)string_split("OK", "|");
RunActionSheet("Really Reset Value?", items, self.parentTable,
^(UIActionSheet* actionSheet, NSInteger buttonIndex)
{
@ -641,11 +638,10 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)wasSelectedOnTableView:(UITableView*)tableView ofController:(UIViewController*)controller
{
struct string_list* items;
RAMenuItemEnumSetting __weak* weakSelf = self;
rarch_setting_t *setting = self.setting;
struct string_list *items = string_split(setting->values, "|");
items = (struct string_list*)string_split(setting->values, "|");
RunActionSheet(setting->short_description, items, self.parentTable,
^(UIActionSheet* actionSheet, NSInteger buttonIndex)
{
@ -890,9 +886,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
- (void)menuRefresh
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return;
if (!menu->need_refresh)
if (!menu || !menu->need_refresh)
return;
menu_entries_deferred_push(menu->menu_list->selection_buf,