Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSInvalidArgumentException occurred! #1

Open
Sweeper777 opened this issue Jun 15, 2016 · 0 comments
Open

NSInvalidArgumentException occurred! #1

Sweeper777 opened this issue Jun 15, 2016 · 0 comments

Comments

@Sweeper777
Copy link

I am using Swift so I don't know whether that is the problem.

So I have a UITextField and an SZTextView (a subclass of UITextView). I wrote these two lines in viewDidLoad:

NBEmojiSearchView().installOnTextView(txtContent)
NBEmojiSearchView().installOnTextField(txtTitle)

just like you did in README.md

When viewDidLoad was called, I got this exception and the app crashes:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
*** First throw call stack:
(
    0   CoreFoundation                      0x0081d494 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02bf5e02 objc_exception_throw + 50
    2   CoreFoundation                      0x0081d3bd +[NSException raise:format:] + 141
    3   Foundation                          0x013e4455 +[NSJSONSerialization JSONObjectWithData:options:error:] + 67
    4   NBEmojiSearchView                   0x002b2ed4 -[NBEmojiManager loadEmoji] + 356
    5   NBEmojiSearchView                   0x002b2c1d -[NBEmojiManager init] + 125
    6   NBEmojiSearchView                   0x002b4b30 -[NBEmojiSearchView manager] + 96
    7   NBEmojiSearchView                   0x002b582b -[NBEmojiSearchView tableView:numberOfRowsInSection:] + 91
    8   UIKit                               0x01aa12f5 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 3174
    9   UIKit                               0x01aa5e82 -[UITableViewRowData numberOfRows] + 98
    10  UIKit                               0x0183ed39 -[UITableView noteNumberOfRowsChanged] + 141
    11  UIKit                               0x0183e1f4 -[UITableView reloadData] + 2189
    12  NBEmojiSearchView                   0x002b509d -[NBEmojiSearchView setFont:] + 141
    13  NBEmojiSearchView                   0x002b456d -[NBEmojiSearchView init] + 221
    14  MyApp                         0x00074db1 _TTOFCSo17NBEmojiSearchViewcfT_S_ + 33
    15  MyApp                         0x00074996 _TFCSo17NBEmojiSearchViewCfT_S_ + 86
    16  MyApp                         0x0006f7ce _TFC11PocketDiary21DiaryEditorController11viewDidLoadfT_T_ + 2718
    17  MyApp                         0x0006f952 _TToFC11PocketDiary21DiaryEditorController11viewDidLoadfT_T_ + 34
    18  UIKit                               0x0189bb72 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 44
    19  UIKit                               0x018a0692 -[UIViewController loadViewIfRequired] + 1384
    20  UIKit                               0x018a0ab1 -[UIViewController view] + 35
    21  UIKit                               0x018fb935 -[UINavigationController preferredContentSize] + 212
    22  UIKit                               0x01871eec -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 67
    23  UIKit                               0x0186dafc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 105
    24  UIKit                               0x018b0e3b __40+[UIViewController _scheduleTransition:]_block_invoke + 18
    25  UIKit                               0x016dd7cb _runAfterCACommitDeferredBlocks + 337
    26  UIKit                               0x016f3a60 _cleanUpAfterCAFlushAndRunDeferredBlocks + 103
    27  UIKit                               0x01701ef6 _afterCACommitHandler + 102
    28  CoreFoundation                      0x0072f75e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    29  CoreFoundation                      0x0072f6be __CFRunLoopDoObservers + 398
    30  CoreFoundation                      0x0072503c __CFRunLoopRun + 1340
    31  CoreFoundation                      0x00724846 CFRunLoopRunSpecific + 470
    32  CoreFoundation                      0x0072465b CFRunLoopRunInMode + 123
    33  GraphicsServices                    0x05de0664 GSEventRunModal + 192
    34  GraphicsServices                    0x05de04a1 GSEventRun + 104
    35  UIKit                               0x016cfeb9 UIApplicationMain + 160
    36  MyApp                         0x0006cb51 main + 145
    37  libdyld.dylib                       0x045a6a25 start + 1
    38  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

What causes this? Is it because I'm using Swift?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant