Welcome, Guest
Username Password: Remember me

Crash on [SCTableViewModel keyboardWillShow]
(1 viewing) (1) Guest

TOPIC: Crash on [SCTableViewModel keyboardWillShow]

Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #1

Hello,

in the Beta 2 version, i got a crash by pop a view controller to another with
textfield & keyboard!

Any idea?


Here the error message:

 
'NSInvalidArgumentException', reason: '-[NSCFString view]: unrecognized selector sent to instance 0x5a68a40'
*** Call stack at first throw:
(
0 CoreFoundation 0x016edbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x018425c2 objc_exception_throw + 47
2 CoreFoundation 0x016ef6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0165f366 ___forwarding___ + 966
4 CoreFoundation 0x0165ef22 _CF_forwarding_prep_0 + 50
5 FACTS Mobile FIPS 0x0007eee0 -[SCTableViewModel keyboardWillShow:] + 412
6 Foundation 0x003be6c1 _nsnote_callback + 145
7 CoreFoundation 0x016c5f99 __CFXNotificationPost_old + 745
8 CoreFoundation 0x0164533a _CFXNotificationPostNotification + 186
9 Foundation 0x003b4266 -[NSNotificationCenter postNotificationName:object:userInfo:] + 134
10 UIKit 0x009acede -[UIInputViewTransition postNotificationsForTransitionStart] + 1107
11 UIKit 0x009ad3ad -[UIPeripheralHost(UIKitInternal) executeTransition:] + 953
12 UIKit 0x009a591a -[UIPeripheralHost(UIKitInternal) setInputViews:] + 49
13 UIKit 0x00720f81 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 184
14 UIKit 0x0072154e -[UIResponder becomeFirstResponder] + 527
15 UIKit 0x00683aad -[UIView(Hierarchy) deferredBecomeFirstResponder] + 74
16 UIKit 0x0068d006 -[UIView(Hierarchy) _postMovedFromSuperview:] + 232
17 UIKit 0x00685dfc -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080
18 UIKit 0x0068414f -[UIView(Hierarchy) addSubview:] + 57
19 UIKit 0x00899471 -[UINavigationTransitionView transition:fromView:toView:] + 551
20 UIKit 0x00898ed5 -[UINavigationTransitionView transition:toView:] + 56
21 UIKit 0x0070b606 -[UINavigationController _startDeferredTransitionIfNeeded] + 266
22 UIKit 0x0070b292 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 485
23 UIKit 0x0070b41e -[UINavigationController popViewControllerAnimated:] + 57
24 UIKit 0x0070a856 -[UINavigationController navigationBar:shouldPopItem:] + 148
25 UIKit 0x006ad104 -[UINavigationBar _popNavigationItemWithTransition:] + 116
26 UIKit 0x006b5751 -[UINavigationBar _handleMouseUpAtPoint:] + 605
27 UIKit 0x006790d1 -[UIWindow _sendTouchesForEvent:] + 567
28 UIKit 0x0065a37a -[UIApplication sendEvent:] + 447
29 UIKit 0x0065f732 _UIApplicationHandleEvent + 7576
30 GraphicsServices 0x01dd3a36 PurpleEventCallback + 1550
31 CoreFoundation 0x016cf064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
32 CoreFoundation 0x0162f6f7 __CFRunLoopDoSource1 + 215
33 CoreFoundation 0x0162c983 __CFRunLoopRun + 979
34 CoreFoundation 0x0162c240 CFRunLoopRunSpecific + 208
35 CoreFoundation 0x0162c161 CFRunLoopRunInMode + 97
36 GraphicsServices 0x01dd2268 GSEventRunModal + 217
37 GraphicsServices 0x01dd232d GSEventRun + 115
38 UIKit 0x0066342e UIApplicationMain + 1160
39 FACTS Mobile FIPS 0x00002084 main + 102
40 FACTS Mobile FIPS 0x00002015 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
 


Best Regards,
gemuese
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #2

Hi gemuese,

Since STV is monitoring the keyboard, table resizing, and a lot of other stuff, you have to do two things to be able to successfully present one of your own custom view controllers:

1- Before you push (or present modally) your custom view controller, you have to call the SCTableViewModel method called "prepareModelForCustomDetailViewAppearing".

2- Before your custom view controller disappears, you have to call the SCTableViewModel method called "prepareModelForCustomDetailViewDisappearing" (usually in your view controller's viewWillDisappear method).

These methods are present in our latest beta version, which I'll send you a copy of right away.


**** EDIT ****
The above is no longer required by STV to display custom detail views! For more information, please refer to the following post: www.sensiblecocoa.com/forum/bug-reports/...=6&start=12#2119
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Last Edit: 1 year, 2 months ago by tarekskr.

Re: Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #3

It doesn't work or i do the wrong thing!

Is it correct to put this code in the view controller's which contain custom table view cells?

 
 
- (void)viewWillAppear:(BOOL)animated
{
[model prepareModelForCustomDetailViewAppearing];
 
[super viewWillAppear:animated];
}
 
- (void)viewWillDisappear:(BOOL)animated
{
[model prepareModelForCustomDetailViewDisappearing];
 
[super viewWillDisappear:animated];
}
 
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #4

Hi gemuese,

prepareModelForCustomDetailViewAppearing must be called from your main view controller, before actually calling pushViewController or presentModalViewController.

Please tell me if you still need more help.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #5

I be afraid that this is not easy to do.

To call the Method [model prepareModelForCustomDetailViewAppearing], i need an instance of the SCTableViewModel class. To instanciate a SCTableViewModel i need the tableview, right? But the tableview will be created first on viewDidLoad by interface builder... so, it is not possible to call that method for the model before i push it to the navigation controller...
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: Crash on [SCTableViewModel keyboardWillShow] 1 year, 4 months ago #6

Hi again gemuese,

I think we have a misunderstanding here...

Please find attached a sample application that illustrates how to display your custom view controllers under STV 2.0 (please provide your own STV files under the "Sensible TableView" folder).

Please tell me if you're still having problems. This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Time to create page: 1.14 seconds