Skip to content

Instantly share code, notes, and snippets.

@elizaaverywilson
elizaaverywilson / gist:11021595
Created April 18, 2014 02:20
FInd a view that looks like something you can touch given point
- (UIView*)responderForPoint:(CGPoint)point {
UIView *rootView = self;
while (1) {
if (!rootView.superview) {
rootView = rootView.superview;
}
}
UIView *gameViewRootView = [rootView viewWithTag: NNGameViewRootViewTag];
2014-01-25 15:00:31.500 WTATest3[3210:70b] app did finish launching
2014-01-25 15:00:31.504 WTATest3[3210:70b] view did load
2014-01-25 15:00:31.505 WTATest3[3210:70b] <WTAMainMenuViewController: 0xb03e0e0>
2014-01-25 15:00:31.538 WTATest3[3210:70b] -[WTAMenuCellPropertiesModel reuseIdentifier]: unrecognized selector sent to instance 0xb040640
2014-01-25 15:00:31.543 WTATest3[3210:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WTAMenuCellPropertiesModel reuseIdentifier]: unrecognized selector sent to instance 0xb040640'
*** First throw call stack:
(
0 CoreFoundation 0x0173c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bf8b6 objc_exception_throw + 44
2 CoreFoundation 0x017d9903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
2014-01-25 15:00:31.500 WTATest3[3210:70b] app did finish launching
2014-01-25 15:00:31.504 WTATest3[3210:70b] view did load
2014-01-25 15:00:31.505 WTATest3[3210:70b] <WTAMainMenuViewController: 0xb03e0e0>
2014-01-25 15:00:31.538 WTATest3[3210:70b] -[WTAMenuCellPropertiesModel reuseIdentifier]: unrecognized selector sent to instance 0xb040640
2014-01-25 15:00:31.543 WTATest3[3210:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WTAMenuCellPropertiesModel reuseIdentifier]: unrecognized selector sent to instance 0xb040640'
*** First throw call stack:
(
0 CoreFoundation 0x0173c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bf8b6 objc_exception_throw + 44
2 CoreFoundation 0x017d9903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
2014-01-25 14:47:46.881 WTATest3[2567:70b] app did finish launching
2014-01-25 14:47:46.908 WTATest3[2567:70b] view did load
2014-01-25 14:47:46.909 WTATest3[2567:70b] <WTAMainMenuViewController: 0x8f74510>
2014-01-25 14:47:47.029 WTATest3[2567:70b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 7 beyond bounds [0 .. 6]'
*** First throw call stack:
(
0 CoreFoundation 0x0173c5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bf8b6 objc_exception_throw + 44
2 CoreFoundation 0x016f09c2 -[__NSArrayI objectAtIndex:] + 210
3 CoreFoundation 0x017bb608 -[NSArray objectAtIndexedSubscript:] + 40
#import "WTAMenuCellPropertiesModel.h"
@implementation WTAMenuCellPropertiesModel
- (void) chooseCellData {
CGSize cellSize1 = CGSizeMake(150, 60);
NSDictionary *cell1 = [[NSDictionary alloc] initWithObjectsAndKeys: @"text", @"cell1text", @"size", cellSize1, @"color", [UIColor whiteColor], nil];
NSArray *arrayOfCells = [NSArray arrayWithObjects: cell1, nil];
2014-01-17 17:21:28.373 WTATest3[2022:70b] app did finish launching
2014-01-17 17:21:28.406 WTATest3[2022:70b] view did load
2014-01-17 17:21:28.407 WTATest3[2022:70b] <WTAMainMenuViewController: 0x8bb60a0>
2014-01-17 17:21:28.445 WTATest3[2022:70b] *** Assertion failure in -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:], /SourceCache/UIKit_Sim/UIKit-2903.23/UICollectionView.m:1367
2014-01-17 17:21:28.553 WTATest3[2022:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the view returned from -collectionView:cellForItemAtIndexPath: (<NSIndexPath: 0x8b7a020> {length = 2, path = 0 - 0}) was not retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath: or is nil (<UICollectionViewCell: 0x8c7b9c0; frame = (0 0; 78 50); clipsToBounds = YES; opaque = NO; autoresize = RM+TM; layer = <CALayer: 0x8c7ba50>>)'
*** First throw call stack:
(
0 CoreFoundation 0x017395e4 __exceptionPreprocess
2013-12-21 14:39:08.357 WhenToAct[4967:70b] Unknown class WTAMainMenuViewController in Interface Builder file.
2013-12-21 14:39:08.359 WhenToAct[4967:70b] app did finish launching
2013-12-21 14:39:08.377 WhenToAct[4967:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x8c9e230> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key splashCollectionView.'
*** First throw call stack:
(
0 CoreFoundation 0x017385e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014bb8b6 objc_exception_throw + 44
2 CoreFoundation 0x017c86a1 -[NSException raise] + 17
3 Foundation 0x0117c9ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x010e8cfb _NSSetUsingKeyValueSetter + 88
- (void) viewDidLoad {
[super viewDidLoad];
[self setUpMainMenu];
}
- (void) setUpMainMenu {
NSArray *splashTextArray = [[NSBundle mainBundle] loadNibNamed:@"myXibFile" owner:self options:nil];
for (int i = 0; i < 10; i++) {
int arrayNumber = arc4randon_uniform([splashTextArray count]) + 1;
}
// In the header, some @properties... connected to checkboxes in a window
@property (weak) IBOutlet NSButton *loginItem;
@property (weak) IBOutlet NSButton *flashTimeSeparator;
@property (weak) IBOutlet NSButton *displaySecond;
@property (weak) IBOutlet NSButton *displayMillisecond;
@property (weak) IBOutlet NSButton *twentyFourHour;
@property (weak) IBOutlet NSButton *displayMeridiem;
// Me trying to set state to off
// The state is always yes for some reason, but it [_button state] returns 0
static GCBucketModel *bucket;
+ (id) sharedBucketInstance {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
bucket = [[self alloc] init];
});
return bucket;
}