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
#! /bin/sh | |
# On alternate invocations, this script | |
# saves the path of the source file currently open in Xcode | |
# and restores the file at that path in Xcode. | |
# | |
# By setting Xcode (in Behaviors) to run this script when "Run Starts" | |
# and when "Run Completes", you can prevent it from switching to main.m | |
# when a run finishes. | |
# See http://stackoverflow.com/questions/7682277/xcode-4-2-jumps-to-main-m-every-time-after-stopping-simulator |
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
(* | |
Running this script will cause Instruments to become active | |
and switch from the Script view (where you edit your UIAutomation script) | |
to the Editor Log view (where you see the logs of executing those scripts) | |
or vice versa. | |
*) | |
-- JW: This block only needs to be executed once, and can then be removed. | |
-- I don't know if leaving it in might cause a performance hit; |
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
# Clears Xcode's console, | |
# then switches back to the iOS Simulator. | |
activate application "Xcode" | |
tell application "System Events" | |
tell process "Xcode" | |
click menu item "Clear Console" of menu 1 of menu item "Debug" of menu 1 of menu bar item "Product" of menu bar 1 | |
end tell | |
end tell | |
activate application "iPhone Simulator" |
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
#!/bin/sh | |
## Checks out the branch with the name recorded in the .PREVIOUS_BRANCH file | |
## in the working directory. To use this script, you should be using the | |
## post-checkout hook that creates such a file. | |
if [ ! -f ./.PREVIOUS_BRANCH ] | |
then | |
echo "No previous branch has been recorded. You're probably not using the post-checkout hook." | |
exit 1 |
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
- (void)testBooleanLiteralsAreOfTypeBool { | |
NSNumber *testBoolNumber = @YES; | |
const char *typeString = [testBoolNumber objCType]; | |
STAssertTrue('c' == *typeString, @"Boxed BOOL is of type %s, not of type 'c' (signed char, aka BOOL).", typeString); | |
} | |
- (void)testBoxedBooleanLiteralsAreOfTypeBool { | |
// Boxing works fine if a BOOL value is boxed directly... | |
BOOL testBool = YES; | |
NSNumber *testBoolNumber = @(testBool); |
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
SLAlert *buyAlert = [SLAlert alertWithTitle:@"Confirm Your In-App Purchase"]; | |
SLAlertHandler *buyHandler = [buyAlert dismissWithButtonTitled:@"Buy"]; | |
[SLAlertHandler addHandler:buyHandler]; |
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
UIATarget.onAlert = function(alert) { | |
// if the alert has the expected title | |
if (alert.staticTexts()[0].label() === "Confirm Your In-App Purchase") { | |
// tap the button | |
alert.buttons()['Buy'].tap(); | |
} | |
} |
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
var button = target.frontMostApp().mainWindow().tableViews()[1].buttons()["$1.99"]; |
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
SLButton *buyButton = [SLButton elementWithAccessibilityLabel:@"$1.99"]; |
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
[[SLTestController sharedTestController] registerTarget:[DownloadManager sharedManager] forAction:@selector(downloadBookWithId:)]; |
OlderNewer