Skip to content

Instantly share code, notes, and snippets.

@bored-engineer
Created August 19, 2011 20:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bored-engineer/1157934 to your computer and use it in GitHub Desktop.
Save bored-engineer/1157934 to your computer and use it in GitHub Desktop.
Alert
//[[[UIAlertView alloc] initWithTitle:@"Alert title" message:msg delegate:self //cancelButtonTitle:@"Don't remember" otherButtonTitles:@"OK" , @"remember later", nil] //autorelease];[alert show];
var $ = require('./NodObjC');
$.import('Foundation');
$.import('UIKit');
var pool = $.NSAutoreleasePool('alloc')('init');
var alert = $.UIAlertView('alloc');
//console.log(alert.methods());
alert('initWithTitle', $._('Alert title'), 'message', $._('Don\'t remember'), "delegate", null, 'defaultButton', $._('Don\'t remember'), 'cancelButton', $._('Don\'t remember'), 'otherButtons', null);
alert('autorelease');
alert('show');
pool('drain');
@TooTallNate
Copy link

NodObjC-equivalent:

var alert = $.UIAlertView('alloc')('initWithTitle', $._('Alert title')
                     , 'message', msg
                     , 'delegate', self
                     , 'cancelButtonTitle', $._('Don\'t remember')
                     , 'otherButtonTitles', null)
alert('autorelease')
alert('show')

@bored-engineer
Copy link
Author

.Methods returns :
[ '_addButtonWithTitle:',
'_addButtonWithTitle:label:buttonClass:',
'_addSubview:positioned:relativeTo:',
'_adjustLabelFontSizes',
'_alertSheetAnimationDidStop:finished:',
'_alertSheetTextFieldDidEndEditing:',
'_alertSheetTextFieldDidStartEditing:',
'_alertSheetTextFieldReturn:',
'_appSuspended:',
'_bottomVerticalInset',
'_bubbleAnimationNormalDidStop:finished:',
'_bubbleAnimationShrinkDidStop:finished:',
'_buttonClicked:',
'_buttonHeight',
'_canShowAlerts',
'_cancelAnimated:',
'_cleanupAfterPopupAnimation',
'_cleanupKBWatcher',
'_createBodyTextLabelIfNeeded',
'_createSubtitleLabelIfNeeded',
'_createTaglineTextLabelIfNeeded',
'_createTitleLabelIfNeeded',
'_currentOrientation',
'_dimView',
'_dimsBackground',
'_growAnimationDidStop:finished:',
'_handleKeyEvent:',
'_isAnimating',
'_jiggleStage1AnimationDidStop:finished:',
'_jiggleStage2AnimationDidStop:finished:',
'_jiggleStage3AnimationDidStop:finished:',
'_jiggleStage4AnimationDidStop:finished:',
'_jiggleStage5AnimationDidStop:finished:',
'_jiggleStage6AnimationDidStop:finished:',
'_keyboardDidHide:',
'_keyboardHiddingAnimationDidStop:finished:',
'_keyboardWillHide:',
'_keyboardWillShow:',
'_layoutIfNeeded',
'_layoutPopupAlertWithOrientation:animated:',
'_manualKeyboardIsVisible',
'_maxHeight',
'_needsKeyboard',
'_performPopoutAnimationAnimated:',
'_performPopup:',
'_performPopup:animationType:',
'_popoutAnimationDidStop:finished:',
'_prepareForDisplay',
'_prepareToBeReplaced',
'_presentSheetFromView:above:',
'_presentSheetStartingFromYCoordinate:',
'_removeAlertWindowOrShowAnOldAlert',
'_repopup',
'_repopupNoAnimation',
'_rotatingAnimationDidStop:',
'_setAlertSheetStyleFromButtonBar:',
'_setFirstOtherButtonIndex:',
'_setTextFieldsHidden:',
'_setupKBWatcher',
'_setupTitleStyle',
'_shouldOrderInAutomaticKeyboard',
'_showKeyboard:animated:',
'_showManualKBIfNecessary',
'_slideSheetOut:',
'_temporarilyHideAnimated:',
'_titleHorizontalInset',
'_titleVerticalBottomInset',
'_titleVerticalTopInset',
'_truncateViewHeight:toFitInFrame:withMinimumHeight:',
'_updateFrameForDisplay',
'_updateKeyboardStateForPreviousResponder:',
'_useUndoStyle:',
'_willRotateKeyboard',
'addButtonWithTitle:',
'addButtonWithTitle:buttonClass:',
'addButtonWithTitle:label:',
'addTextFieldWithValue:label:',
'alertSheetStyle',
'backgroundSize',
'becomeFirstResponder',
'blocksInteraction',
'bodyMaxLineCount',
'bodyText',
'bodyTextLabel',
'buttonAtIndex:',
'buttonCount',
'buttonTitleAtIndex:',
'buttons',
'canBecomeFirstResponder',
'cancelButtonIndex',
'context',
'dealloc',
'defaultButton',
'defaultButtonIndex',
'delegate',
'destructiveButton',
'dimsBackground',
'dismiss',
'dismissAnimated:',
'dismissWithClickedButtonIndex:animated:',
'firstOtherButtonIndex',
'forceHorizontalButtonsLayout',
'groupsTextFields',
'initWithFrame:',
'initWithTitle:buttons:defaultButtonIndex:delegate:context:',
'initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:',
'initWithTitle:message:delegate:defaultButton:cancelButton:otherButtons:',
'isBodyTextTruncated',
'isVisible',
'keyboard',
'layout',
'layoutAnimated:',
'message',
'numberOfButtons',
'numberOfLinesInTitle',
'numberOfRows',
'popupAlertAnimated:',
'popupAlertAnimated:animationType:',
'popupAlertAnimated:animationType:atOffset:',
'popupAlertAnimated:atOffset:',
'presentSheetFromAboveView:',
'presentSheetFromBehindView:',
'presentSheetFromButtonBar:',
'presentSheetInView:',
'presentSheetToAboveView:',
'replaceAlert:',
'requiresPortraitOrientation',
'resignFirstResponder',
'runsModal',
'setAlertSheetStyle:',
'setBlocksInteraction:',
'setBodyText:',
'setBodyTextMaxLineCount:',
'setCancelButtonIndex:',
'setContext:',
'setDefaultButton:',
'setDefaultButtonIndex:',
'setDelegate:',
'setDestructiveButton:',
'setDimView:',
'setDimsBackground:',
'setForceHorizontalButtonsLayout:',
'setGroupsTextFields:',
'setKeyboardShowsOnPopup:',
'setMessage:',
'setNumberOfRows:',
'setRunsModal:',
'setShowsOverSpringBoardAlerts:',
'setSubtitle:',
'setSuspendTag:',
'setTableShouldShowMinimumContent:',
'setTaglineText:',
'setTitle:',
'setTitleMaxLineCount:',
'show',
'showWithAnimationType:',
'showsOverSpringBoardAlerts',
'subtitle',
'suspendTag',
'table',
'tableShouldShowMinimumContent',
'tableView',
'taglineTextLabel',
'textField',
'textFieldAtIndex:',
'textFieldCount',
'title',
'titleLabel',
'titleMaxLineCount',
'titleRect' ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment