Skip to content

Instantly share code, notes, and snippets.

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
@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];
#import "NNForwardTouchView.h"
#import "NNGameViewsManagerModel.h"
#import "DDTTYLogger.h"
#import "DDLog.h"
#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_DEBUG;
#else
static const int ddLogLevel = LOG_LEVEL_OFF;
NSObject *object = [[NSObject alloc] init];
NSObject *object2 = object
Does `object2` == `object`?
Does `object2` have the same memory address as `object`?
If I go like:
[object setValue:differentValue], does object2.value change?
What about the other way around?
2014-05-10 15:36:42.914 Niknik[632:60b] -[NNSelectionButton selected]: unrecognized selector sent to instance 0xa2b0c80
(lldb) po button
<NNSelectionButton: 0xa2b0c80; baseClass = UIButton; frame = (0 0; 172 218); opaque = NO; layer = <CALayer: 0xa2b0e10>>
(lldb) p button.selected
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.
(lldb)
# Created by http://www.gitignore.io
### Xcode ###
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
fifties;
twenties;
value;
while (value > 0) {
if ((value / 10) % 2) {
while (value > 0) {
value - 20;
twenties++;
#pragma mark Info Disclosure button
- (IBAction)infoDisclosureButtonClick:(id)sender {
UIButton *infoDisclosureButton = (UIButton*)sender;
// View hiearchy: InfoDisclosureButton -> Cell Content View -> Some Cell Internal View -> Cell
UITableViewCell *cell = (UITableViewCell*)infoDisclosureButton.superview.superview.superview;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
NSInteger index = indexPath.row;
NNItem *item = self.items[(NSUInteger)index];
- (UIResponder*)responderOf:(UIView*)view forPoint:(CGPoint)point {
DDLogDebug(@"View:%@ subviews: %@", view, view.subviews);
if (!view || view.hidden || !CGRectContainsPoint([self.rootView convertRect:view.frame fromView:view.superview], point)) {
return nil;
}
if ([self object:view isKindOfAClass: [self allowedResponderClasses]] && view.userInteractionEnabled && ((UIControl*)view).enabled) {
DDLogDebug(@"View confirmed: %@", view);
DEWs-Mac-Pro:Niknik ethen$ ls
Base.lproj Libraries NNAppDelegate.m NNConstant.m NiknikTests _Attack _GameSettings _Inventory _JoinView _Player history.txt
Images.xcassets NNAppDelegate.h NNConstant.h NNConstantTests.m Supporting Files _BoundaryLines _GameView _Items _MainMenuView _Store
DEWs-Mac-Pro:Niknik ethen$ ls _Items
NNDisclosureButton.h NNItem.h NNItemDescriptionTableViewCell.h NNItemDescriptionTableViewDataSource.h NNItemDescriptionUnit.h NNKnifeWeaponItem.h NNWeaponItem.h
NNDisclosureButton.m NNItem.m NNItemDescriptionTableViewCell.m NNItemDescriptionTableViewDataSource.m NNItemDescriptionUnit.m NNKnifeWeaponItem.m NNWeaponItem.m
DEWs-Mac-Pro:Niknik ethen$ git mv _Items/NNDislosureButton.h _ItemDescription/NNDisclosureButton.h
fatal: bad source, source=_Items/NNDislosureButton.h, destination=_ItemDescription/NNDisclosureButton.h