iOS Question setObjectForKey: object cannot be nil (key: hc_username)

pierrem

Member
Licensed User
Longtime User
Hello,

while porting from B4A to B4I, with Httpjob + HttpUtils2Service as inserted class module ...
this following error I do not understand.
if someone can explain what i'm doing wrong ...


the calling code is :

B4X:
If searchType.value == False Then
        param="requete=search&nom="&searchMotif.Text
    Else If searchType.value == True Then
        param="requete=search&numeroclub="&searchMotif.Text
    End If
    jobS.Initialize("jobSearch",Me)
    jobS.PostString("http://www.mysite.com/request.php",param)
*request.php doen't require any auth (ie "(key: hc_username)" in err msg)


B4X:
Copying updated assets files (16)
Application_Start
whoiam :**********/ whoiamId :5972--> registered :true
Application_Active
Error occurred on line: 113 (HttpJob)
*** setObjectForKey: object cannot be nil (key: hc_username)
Stack Trace: (
  CoreFoundation       <redacted> + 154
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 818
  B4i test             -[B4IHttp ExecuteCredentials::::] + 112
  B4i test             -[b4i_httputils2service _submitjob:] + 1798
  CoreFoundation       <redacted> + 68
  CoreFoundation       <redacted> + 282
  B4i test             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
  B4i test             -[B4IShell runMethod:] + 496
  B4i test             -[B4IShell raiseEventImpl:method:args::] + 1768
 B4i test             -[B4IShellBI raiseEvent:event:params:] + 1332
 B4i test             __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
 libdispatch.dylib    <redacted> + 10
 libdispatch.dylib    <redacted> + 22
 libdispatch.dylib    <redacted> + 268
 CoreFoundation       <redacted> + 8
 CoreFoundation       <redacted> + 1300
 CoreFoundation       CFRunLoopRunSpecific + 522
 CoreFoundation       CFRunLoopRunInMode + 106
 GraphicsServices     GSEventRunModal + 138
 UIKit                UIApplicationMain + 1136
 B4i test             main + 108
 libdyld.dylib        <redacted> + 2
)
 

narek adonts

Well-Known Member
Licensed User
Longtime User
Upvote 0

pierrem

Member
Licensed User
Longtime User
[update]
after restart of b4i and new compil,
it runs

Great !

Oupsssssss
just tried ... same error
 
Last edited:
Upvote 0
Top