This file contains hidden or 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)didReceiveMemoryWarning | |
| { | |
| if([self isViewLoaded] && self.view.window == nil) { | |
| // viewWillUnloadでやっていた処理を書く | |
| self.view = nil; | |
| // viewDidUnloadでやっていた処理を書く | |
| } | |
| [super didReceiveMemoryWarning]; | |
| } |
This file contains hidden or 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
| @interface TestView : UIView | |
| @end | |
| @implementation TestView | |
| - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event | |
| { | |
| UIView *view = [super hitTest:point withEvent:event]; | |
| if(view == self) { | |
| return nil; |
This file contains hidden or 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
| // Xcode4.4 | |
| // llvm4の機能のうち一部が、 | |
| // iOS 5.1 SDK で使えない | |
| // 例 | |
| NSNumber *b = @YES; // error | |
| NSArray *array = @[ @1, @2, @3 ]; | |
| NSNumber *n = array[1]; // error |
This file contains hidden or 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
| require 'osx/cocoa' | |
| data = OSX::NSPropertyListSerialization.dataWithPropertyList_format_options_error_(obj, OSX::NSPropertyListBinaryFormat_v1_0, 0, nil) | |
| data.writeToFile_atomically_(path, true) |
This file contains hidden or 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 isEqual(NSObject *a, NSObject *b) | |
| { | |
| if (a) { | |
| if (b) { | |
| return [a isEqual:b]; | |
| } | |
| } else { // a == nil | |
| if (!b) { | |
| return YES; | |
| } |
This file contains hidden or 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
| @import SystemConfiguration; | |
| #import <SystemConfiguration/CaptiveNetwork.h> | |
| - (NSString *)currentSSID | |
| { | |
| NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces()); | |
| if (!interfaceNames.count) { | |
| return nil; | |
| } |
This file contains hidden or 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
| - (NSDictionary *)embeddedMobileprovisionPlist | |
| { | |
| NSString *path = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]; | |
| if (!path) { | |
| return nil; | |
| } | |
| NSData *profileData = [NSData dataWithContentsOfFile:path]; | |
| if (!profileData) { | |
| return nil; |
This file contains hidden or 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
| openssl asn1parse -inform DER -in foo.mobileprovision |
This file contains hidden or 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
| // Swift 3 | |
| import UIKit | |
| class TestViewController: UIViewController { | |
| var text: String! | |
| static func create(with text: String) -> Self { | |
| let vc = instantiateFromStoryboard() |
OlderNewer