I'm testing Swift in a simple Mac app. I got a NSToolbar in Storyboard and draw a NSSearchfield inside. The NSSearchfiled is connected to the First Responder's method controlTextDidChange (the first responder is the ViewController where I added NSTextFieldDelegate).
This is the method:
#IBAction override func controlTextDidChange(obj: NSNotification!) {
println("searching...")
println(obj.object.stringValue)
}
The method gets correctly called every time a new character is searched and the app does not crash however what's being returned is the following:
searching...
2014-08-03 09:56:57.770 TestApp[1129:24219] -[NSSearchField object]: unrecognized selector sent to instance 0x6080001a07e0
2014-08-03 09:56:57.770 TestApp[1129:24219] -[NSSearchField object]: unrecognized selector sent to instance 0x6080001a07e0
2014-08-03 09:56:57.775 TestApp[1129:24219] (
0 CoreFoundation 0x00007fff92e6af1c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff930ae74e objc_exception_throw + 43
2 CoreFoundation 0x00007fff92e6de4d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff92db63c4 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff92db5f38 _CF_forwarding_prep_0 + 120
5 TestApp 0x000000010000c187 _TFC9TestApp14ViewController20controlTextDidChangefS0_FGSQCSo14NSNotification_T_ + 231
6 TestApp 0x000000010000c582 _TToFC9TestApp14ViewController20controlTextDidChangefS0_FGSQCSo14NSNotification_T_ + 66
7 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
8 AppKit 0x00007fff8d52b168 -[NSApplication sendAction:to:from:] + 410
9 AppKit 0x00007fff8d52af90 -[NSControl sendAction:to:] + 86
10 AppKit 0x00007fff8d6faf91 __26-[NSCell _sendActionFrom:]_block_invoke + 131
11 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
12 AppKit 0x00007fff8d57329e -[NSCell _sendActionFrom:] + 144
13 AppKit 0x00007fff8d92fe8f __64-[NSSearchFieldCell(NSSearchFieldCell_Local) _sendPartialString]_block_invoke + 63
14 libsystem_trace.dylib 0x00007fff9117bc07 _os_activity_initiate + 75
15 AppKit 0x00007fff8d92fe47 -[NSSearchFieldCell(NSSearchFieldCell_Local) _sendPartialString] + 186
16 Foundation 0x00007fff932ee3d3 __NSFireTimer + 95
17 CoreFoundation 0x00007fff92dbf464 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
18 CoreFoundation 0x00007fff92dbf0f3 __CFRunLoopDoTimer + 1059
19 CoreFoundation 0x00007fff92e320fd __CFRunLoopDoTimers + 301
20 CoreFoundation 0x00007fff92d7b4d2 __CFRunLoopRun + 2018
21 CoreFoundation 0x00007fff92d7aaa8 CFRunLoopRunSpecific + 296
22 HIToolbox 0x00007fff90adcaff RunCurrentEventLoopInMode + 235
23 HIToolbox 0x00007fff90adc872 ReceiveNextEventCommon + 431
24 HIToolbox 0x00007fff90adc6b3 _BlockUntilNextEventMatchingListInModeWithFilter + 71
25 AppKit 0x00007fff8d35c2a5 _DPSNextEvent + 1000
26 AppKit 0x00007fff8d35ba79 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 139
27 AppKit 0x00007fff8d34fad3 -[NSApplication run] + 594
28 AppKit 0x00007fff8d33b2de NSApplicationMain + 1778
29 TestApp 0x000000010000da72 top_level_code + 34
30 TestApp 0x000000010000daaa main + 42
31 libdyld.dylib 0x00007fff8cb765c9 start + 1
32 ??? 0x0000000000000003 0x0 + 3
)
I can't figure out where the "unrecognized selector sent to instance" comes from.
controlTextDidChange method expects NSSearchField!, not NSNotification!.
Replace
#IBAction override func controlTextDidChange(obj: NSNotification!) {
println("searching...")
println(obj.object.stringValue)
}
with
#IBAction override func controlTextDidChange(obj: NSSearchField!) {
println("searching...")
println(obj.stringValue)
}
Solved by defining a custom method
#IBAction func controlTextDidChange_Custom(obj: NSSearchField!) {
if (!obj.stringValue.isEmpty) {
println("Searched: \(obj.stringValue)")
} else {
println("EMPTY")
}
}
Related
I'm working with Xcode 12.3 and MacOS 11.1.
A Textfield is embedded in a HStack and this one is embedded in a VStack.
struct ContentView: View {
#State var username: String = ""
var body: some View {
VStack {
HStack() {
Text("Enter Username:")
TextField("", text: $username)
}
Text("Your username: \(username)")
}
}
}
The code runs without any problems as an iOS-App.
However, compiling the code as a MacOS-App results in a runtime error.
2021-01-23 23:18:29.835048+0100 TestMacSwiftUI[6349:280606] [General] ERROR: Setting
<_TtC7SwiftUIP33_C58093E7172B0A541A997680E343D0D516_SystemTextField: 0x7fa1666294b0> as the first responder for window
<NSWindow: 0x7fa166606110>, but it is in a different window ((null))! This would eventually crash when the view is freed.
The first responder will be set to nil.
0 AppKit 0x00007fff22c5a499 -[NSWindow _validateFirstResponder:] + 449
1 AppKit 0x00007fff22c5a294 -[NSWindow _setFirstResponder:] + 31
2 AppKit 0x00007fff22d7e72b -[NSWindow _realMakeFirstResponder:] + 338
3 SwiftUI 0x00007fff42d8627b $s7SwiftUI11FocusBridgeC04moveC02toyAA0C4ItemV_tF + 155
4 SwiftUI 0x00007fff42d86fad $s7SwiftUI11FocusBridgeC27hostDidBecomeFirstResponder33_74086170859BF7C5D78394D4DEE7E0F9LLyyF + 861
5 SwiftUI 0x00007fff42d85b97 $s7SwiftUI11FocusBridgeC23firstResponderDidChange2to04rootF0ySo11NSResponderCSg_AA0F4Node_pSgtF + 583
6 SwiftUI 0x00007fff42c7102b $s7SwiftUI13NSHostingViewC12observeValue10forKeyPath2of6change7contextySSSg_ypSgSDySo05NSKeyf6ChangeH0aypGSgSvSgtFyycfU_ + 299
7 SwiftUI 0x00007fff42632c8c $sIeg_ytIegr_TR + 12
8 SwiftUI 0x00007fff42c79631 $sIeg_ytIegr_TRTA + 17
9 SwiftUI 0x00007fff42b61374 $s7SwiftUI6UpdateO3endyyFZ + 436
10 SwiftUI 0x00007fff42c70e85 $s7SwiftUI13NSHostingViewC12observeValue10forKeyPath2of6change7contextySSSg_ypSgSDySo05NSKeyf6ChangeH0aypGSgSvSgtF + 805
11 SwiftUI 0x00007fff42c71159 $s7SwiftUI13NSHostingViewC12observeValue10forKeyPath2of6change7contextySSSg_ypSgSDySo05NSKeyf6ChangeH0aypGSgSvSgtFTo + 249
12 Foundation 0x00007fff21188ab8 NSKeyValueNotifyObserver + 327
13 Foundation 0x00007fff2124fe45 NSKeyValueDidChange + 431
14 Foundation 0x00007fff212f0539 NSKeyValueDidChangeWithPerThreadPendingNotifications + 146
15 AppKit 0x00007fff22d7e72b -[NSWindow _realMakeFirstResponder:] + 338
16 AppKit 0x00007fff22d93adf -[NSWindow _selectFirstKeyView] + 758
17 AppKit 0x00007fff22d9310f -[NSWindow _setUpFirstResponder] + 189
18 AppKit 0x00007fff22d90577 -[NSWindow _doWindowWillBeVisibleAsSheet:] + 153
19 AppKit 0x00007fff22d8e4bd -[NSWindow _reallyDoOrderWindowAboveOrBelow:relativeTo:findKey:forCounter:force:isModal:] + 1317
20 AppKit 0x00007fff22d8dc42 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 135
21 AppKit 0x00007fff22d8cc52 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 289
22 AppKit 0x00007fff22d8cad0 -[NSWindow orderWindow:relativeTo:] + 155
23 AppKit 0x00007fff22d806f1 -[NSWindow makeKeyAndOrderFront:] + 60
24 TestMacSwiftUI 0x000000010e887d21 $s14TestMacSwiftUI11AppDelegateC29applicationDidFinishLaunchingyy10Foundation12NotificationVF + 3169
25 TestMacSwiftUI 0x000000010e887f62 $s14TestMacSwiftUI11AppDelegateC29applicationDidFinishLaunchingyy10Foundation12NotificationVFTo + 146
26 CoreFoundation 0x00007fff2041dfec __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
27 CoreFoundation 0x00007fff204b989b ___CFXRegistrationPost_block_invoke + 49
28 CoreFoundation 0x00007fff204b980f _CFXRegistrationPost + 454
29 CoreFoundation 0x00007fff203eebde _CFXNotificationPost + 723
30 Foundation 0x00007fff2115dabe -[NSNotificationCenter postNotificationName:object:userInfo:] + 59
31 AppKit 0x00007fff22c4cf6d -[NSApplication _postDidFinishNotification] + 305
32 AppKit 0x00007fff22c4ccbb -[NSApplication _sendFinishLaunchingNotification] + 208
33 AppKit 0x00007fff22c49eb2 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 541
34 AppKit 0x00007fff22c49b07 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 665
35 Foundation 0x00007fff21189056 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 308
36 Foundation 0x00007fff21188ec6 _NSAppleEventManagerGenericHandler + 80
37 AE 0x00007fff26201ed9 _AppleEventsCheckInAppWithBlock + 15850
38 AE 0x00007fff262015f4 _AppleEventsCheckInAppWithBlock + 13573
39 AE 0x00007fff261fa260 aeProcessAppleEvent + 452
40 HIToolbox 0x00007fff286bd612 AEProcessAppleEvent + 54
41 AppKit 0x00007fff22c44276 _DPSNextEvent + 2048
42 AppKit 0x00007fff22c425af -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1366
43 AppKit 0x00007fff22c34b0a -[NSApplication run] + 586
44 AppKit 0x00007fff22c08df2 NSApplicationMain + 816
45 TestMacSwiftUI 0x000000010e8882d4 $sSo21NSApplicationDelegateP6AppKitE4mainyyFZ + 36
46 TestMacSwiftUI 0x000000010e88829e $s14TestMacSwiftUI11AppDelegateC5$mainyyFZ + 46
47 TestMacSwiftUI 0x000000010e888309 main + 41
48 libdyld.dylib 0x00007fff2034b621 start + 1
49 ??? 0x0000000000000003 0x0 + 3
Need help. receiving below error while launching the application
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
0 CoreFoundation 0x00000001160421e6 exceptionPreprocess + 294
1 libobjc.A.dylib 0x0000000116fdf031 objc_exception_throw + 48
2 CoreFoundation 0x0000000116047472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000114f7b652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x0000000112d1bb96 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3064
5 UIKit 0x00000001130dde4a __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
6 UIKit 0x00000001134b0909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
7 UIKit 0x00000001130dda86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
8 UIKit 0x00000001130de2a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
9 UIKit 0x0000000113a4f4d4 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
10 UIKit 0x0000000113a4f36e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
11 UIKit 0x000000011373362d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
12 UIKit 0x000000011392e387 _performActionsWithDelayForTransitionContext + 100
13 UIKit 0x00000001137334f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
14 UIKit 0x00000001134affb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
15 UIKit 0x0000000112d19f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
16 UIKit 0x00000001132eca97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
17 FrontBoardServices 0x000000011d9c32f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
18 FrontBoardServices 0x000000011d9cbcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
19 libdispatch.dylib 0x0000000117c74779 _dispatch_client_callout + 8
20 libdispatch.dylib 0x0000000117c79931 _dispatch_block_invoke_direct + 317
21 FrontBoardServices 0x000000011d9f7470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
22 FrontBoardServices 0x000000011d9f712e -[FBSSerialQueue _performNext] + 439
23 FrontBoardServices 0x000000011d9f768e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
24 CoreFoundation 0x0000000115fe4bb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
25 CoreFoundation 0x0000000115fc94af __CFRunLoopDoSources0 + 271
26 CoreFoundation 0x0000000115fc8a6f __CFRunLoopRun + 1263
27 CoreFoundation 0x0000000115fc830b CFRunLoopRunSpecific + 635
28 GraphicsServices 0x0000000119779a73 GSEventRunModal + 62
29 UIKit 0x0000000112d1d0b7 UIApplicationMain + 159
30 ??? 0x000000013437347e 0x0 + 5171000446
31 ??? 0x0000000134373213 0x0 + 5170999827
Application windows are expected to have a root view controller at the end of application
It seems that you didn't set the RootViewController.It worked fine in old version.But in the new version ,you should set it in AppDelegate
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
var indexVC = new XXXViewController ();//your viewcontroller
Window = new UIWindow ((CGRect)UIScreen.MainScreen.Bounds);
Window .RootViewController = indexVC;
Window .MakeKeyAndVisible ();
return true;
}
I have 3 NSToolbarItems and the first one works just fine, the other two, each time I select them throw
[16392:513506] -[NSToolbarItem isEqualToString:]: unrecognized selector sent to instance 0x6080001203c0
2015-05-26 19:59:26.871 MyApp[16392:513506] (
0 CoreFoundation 0x00007fff89f9703c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8a40176e objc_exception_throw + 43
2 CoreFoundation 0x00007fff89f9a0ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff89edfe24 ___forwarding___ + 1028
4 CoreFoundation 0x00007fff89edf998 _CF_forwarding_prep_0 + 120
5 AppKit 0x00007fff9649d74e +[NSToolbar _shouldIgnoreItemIdentifier:] + 35
6 AppKit 0x00007fff9649d6f7 removeIgnoredIdentifiers + 89
7 AppKit 0x00007fff9675e526 -[NSToolbar selectableItemIdentifiers] + 224
8 AppKit 0x00007fff9675e411 -[NSToolbar _isSelectableItemIdentifier:] + 34
9 AppKit 0x00007fff9675e385 -[NSToolbar setSelectedItemIdentifier:] + 79
10 AppKit 0x00007fff96654f3c -[NSToolbarItemViewer mouseDown:] + 4951
11 AppKit 0x00007fff96bc52fc -[NSWindow _reallySendEvent:isDelayedEvent:] + 14125
12 AppKit 0x00007fff96554d76 -[NSWindow sendEvent:] + 470
13 AppKit 0x00007fff96551312 -[NSApplication sendEvent:] + 2504
14 AppKit 0x00007fff9647ac68 -[NSApplication run] + 711
15 AppKit 0x00007fff963f7354 NSApplicationMain + 1832
16 IPLocation 0x000000010001769d main + 109
17 libdyld.dylib 0x00007fff96ffd5c9 start + 1
18 ??? 0x0000000000000003 0x0 + 3
)
I tried disconnecting and reconnecting them from the storyboard,but nothing changed. The IBAction doesn't even get called.
My ViewController
func toolbarSelectableItemIdentifiers(toolbar: NSToolbar) -> [AnyObject] {
// let array = toolbar.items.filter { contains(Identifier.allValues, $0.itemIdentifier ) }//wrong!
return Identifier.allValues
}
The delegate just needed the name of the identifiers, not the selectable items themselves.
I have a NSTableView that is populated by an array called tableArray. I have a button that is supposed to remove the selected item from the array. In my removeItem: method:
[tableArray removeObjectAtIndex:[tableView selectedRow];
[tableView reloadData];
But I get the error:
2015-05-13 18:16:45.283 FileShedb1.0[979:303] *** -[__NSArrayM objectAtIndex:]: index 18446744073709551615 beyond bounds [0 .. 0]
2015-05-13 18:16:45.288 FileShedb1.0[979:303] (
0 CoreFoundation 0x00007fff8d35ff56 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff93119d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8d2ed392 -[__NSArrayM objectAtIndex:] + 274
3 FileShedb1.0 0x00000001000028a9 -[MPOMainWindowController tableViewSelectionDidChange:] + 201
4 Foundation 0x00007fff8cca0d0e __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 47
5 CoreFoundation 0x00007fff8d3087ba _CFXNotificationPost + 2634
6 Foundation 0x00007fff8cc8cfc3 -[NSNotificationCenter postNotificationName:object:userInfo:] + 65
7 AppKit 0x00007fff8ab10049 -[NSTableView _sendSelectionChangedNotificationForRows:columns:] + 203
8 AppKit 0x00007fff8aae6b0a -[NSTableView _enableSelectionPostingAndPost] + 425
9 AppKit 0x00007fff8aadcd75 -[NSTableView _tileAndRedisplayAll] + 358
10 FileShedb1.0 0x00000001000027bc -[MPOMainWindowController removeFile:] + 188
11 CoreFoundation 0x00007fff8d34f70d -[NSObject performSelector:withObject:] + 61
12 AppKit 0x00007fff8aaa98ca -[NSApplication sendAction:to:from:] + 139
13 AppKit 0x00007fff8aaa97fe -[NSControl sendAction:to:] + 88
14 AppKit 0x00007fff8aaa9729 -[NSCell _sendActionFrom:] + 137
15 AppKit 0x00007fff8aaa8bec -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2014
16 AppKit 0x00007fff8ab28b74 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 489
17 AppKit 0x00007fff8aaa77f6 -[NSControl mouseDown:] + 786
18 AppKit 0x00007fff8aa72c98 -[NSWindow sendEvent:] + 6306
19 AppKit 0x00007fff8aa0c3a5 -[NSApplication sendEvent:] + 5593
20 AppKit 0x00007fff8a9a2a0e -[NSApplication run] + 555
21 AppKit 0x00007fff8ac1eeac NSApplicationMain + 867
22 FileShedb1.0 0x00000001000014c2 main + 34
23 FileShedb1.0 0x0000000100001494 start + 52
)
Anyone know why i'm getting the error?
If no row is selected, selectedRow row returns -1. Put a check for this.
Checkout apple's documentation.
I try to do a simple program in cocoa, a NSTabVew with 2 items, in the first item I set a content to a string var, in the second tab I display this value. I create two Object class (Prima and Seconda), than I add 2 object in IB setting like Prima and Seconda
Prima.m
- (IBAction) salva:(id) sender{
nome = [field stringValue];
NSLog(#"%#",nome);
}
Seconda.m
- (IBAction) visualizza:(id) sender{
NSString *dato;
Prima *prima = [[Prima alloc] init];
dato = prima.nome;
[label setStringValue:dato];
}
when I run the program I get this error:
2011-10-03 11:42:43.511 Prova[44622:707] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:errorDescription:], /SourceCache/AppKit/AppKit-1138/AppKit.subproj/NSCell.m:1564
2011-10-03 11:42:43.511 Prova[44622:707] Invalid parameter not satisfying: aString != nil
2011-10-03 11:42:43.513 Prova[44622:707] (
0 CoreFoundation 0x00007fff8d497986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff90ed9d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8d4977ba +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff8cce914f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 169
4 AppKit 0x00007fff88957685 -[NSCell _objectValue:forString:errorDescription:] + 160
5 AppKit 0x00007fff889575df -[NSCell _objectValue:forString:] + 19
6 AppKit 0x00007fff88957545 -[NSCell setStringValue:] + 41
7 AppKit 0x00007fff88a58039 -[NSControl setStringValue:] + 115
8 Prova 0x0000000100001365 -[Seconda visualizza:] + 133
9 CoreFoundation 0x00007fff8d48711d -[NSObject performSelector:withObject:] + 61
10 AppKit 0x00007fff88a3f852 -[NSApplication sendAction:to:from:] + 139
11 AppKit 0x00007fff88a3f784 -[NSControl sendAction:to:] + 88
12 AppKit 0x00007fff88a3f6af -[NSCell _sendActionFrom:] + 137
13 AppKit 0x00007fff88a3eb7a -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2014
14 AppKit 0x00007fff88abe57c -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 489
15 AppKit 0x00007fff88a3d786 -[NSControl mouseDown:] + 786
16 AppKit 0x00007fff88a0866e -[NSWindow sendEvent:] + 6280
17 AppKit 0x00007fff889a0f19 -[NSApplication sendEvent:] + 5665
18 AppKit 0x00007fff8893742b -[NSApplication run] + 548
19 AppKit 0x00007fff88bb552a NSApplicationMain + 867
20 Prova 0x0000000100000f92 main + 34
21 Prova 0x0000000100000f64 start + 52
22 ??? 0x0000000000000001 0x0 + 1
)
where is the error for you?
It seems that dato is nil, which (based on what you've given us) is probably because things aren't hooked up right in the XIB. Without more information I can't say more.