iPhone/Objective-C - 将字符串传递给方法时出现奇怪的错误
我正在使用 http://www.sudzc.com/ 在我的 iPhone 应用程序中访问 SOAP Web 服务。我在 ASP.NET 中有一个方法,它接受一个字符串并返回一个字符串(确切地说是 facebook 访问令牌)。
这个字符串
如下:
iOCCeM4WGIwBlDxECRFr4AfIEsW598Z4sYjk2uMxsyo.eyJpdiI6IkZPQlN1YWlGNXY0aWs3SmFMWFUwcVEifQ.ITh3ZBGrbgU8DsYWz6d-S4Q1iNlQ8DwKGZB6RZvOkTUpa0VmW7qFS6MO1tkauHoJMFrOlwSrvVuMEO_SQTh8xtR2d0219PPSshiYBHYkjsokSYTuyIaSclVIrL2vh7xH
我时不时地在我的应用程序中收到如下错误,但我不太确定为什么。实际的字符串是我数据库中的一个 nvarchar(255)
字段。
此错误不会一直发生。但这样的事已经发生过好几次了。
任何有关我如何解决此问题的帮助将不胜感激。
提前致谢。
Entity: line 20: parser error : AttValue: " or ' expected
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : attributes construct error
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : Couldn't find end of Start Tag hr line 20
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 31: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : Couldn't find end of Start Tag table line 31
<table width=100% bgcolor="#ffffcc">
^
Entity: line 46: parser error : Opening and ending tag mismatch: br line 29 and table
</table>
^
Entity: line 52: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : Couldn't find end of Start Tag table line 52
<table width=100% bgcolor="#ffffcc">
^
Entity: line 67: parser error : Opening and ending tag mismatch: br line 50 and table
</table>
^
Entity: line 71: parser error : Opening and ending tag mismatch: br line 69 and body
</body>
^
Entity: line 72: parser error : Opening and ending tag mismatch: br line 50 and html
</html>
^
Entity: line 73: parser error : Premature end of data in tag br line 48
^
Entity: line 73: parser error : Premature end of data in tag br line 29
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag font line 24
^
Entity: line 73: parser error : Premature end of data in tag body line 18
^
Entity: line 73: parser error : Premature end of data in tag html line 1
^
2011-05-06 16:15:55.939 MyProject[9206:707] -[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10
2011-05-06 16:15:56.040 MyProject[9206:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10'
*** Call stack at first throw:
(
0 CoreFoundation 0x3237064f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x365b3c5d objc_exception_throw + 24
2 CoreFoundation 0x323741bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x32373649 ___forwarding___ + 508
4 CoreFoundation 0x322ea180 _CF_forwarding_prep_0 + 48
5 MyProject 0x000093ab -[MyAccountVC handlerGetUserByAccessToken:] + 46
6 CoreFoundation 0x322ddf03 -[NSObject(NSObject) performSelector:withObject:] + 22
7 MyProject 0x00026309 -[SoapRequest handleError:] + 148
8 MyProject 0x00026737 -[SoapRequest connectionDidFinishLoading:] + 254
9 Foundation 0x31f4a2f5 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 68
10 Foundation 0x31f4a277 _NSURLConnectionDidFinishLoading + 78
11 CFNetwork 0x35e71411 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 136
12 CFNetwork 0x35e65f49 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 100
13 CFNetwork 0x35e65e3b _ZN19URLConnectionClient13processEventsEv + 70
14 CFNetwork 0x35e65ded _ZN13URLConnection24multiplexerClientPerformEP18RunLoopMultiplexer + 36
15 CFNetwork 0x35e65d5f _ZN17MultiplexerSource7performEv + 126
16 CFNetwork 0x35e65cdd _ZN17MultiplexerSource8_performEPv + 8
17 CoreFoundation 0x32347a79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
18 CoreFoundation 0x3234975f __CFRunLoopDoSources0 + 382
19 CoreFoundation 0x3234a4eb __CFRunLoopRun + 230
20 CoreFoundation 0x322daec3 CFRunLoopRunSpecific + 230
21 CoreFoundation 0x322dadcb CFRunLoopRunInMode + 58
22 GraphicsServices 0x3058241f GSEventRunModal + 114
23 GraphicsServices 0x305824cb GSEventRun + 62
24 UIKit 0x35550d69 -[UIApplication _run] + 404
25 UIKit 0x3554e807 UIApplicationMain + 670
26 MyProject 0x00003f73 main + 70
27 MyProject 0x00003f28 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
I am using http://www.sudzc.com/ to access SOAP Web Services in my iPhone application. I have a method in ASP.NET that takes a string
and returns a string (facebook access token to be exact).
This string
is the following:
iOCCeM4WGIwBlDxECRFr4AfIEsW598Z4sYjk2uMxsyo.eyJpdiI6IkZPQlN1YWlGNXY0aWs3SmFMWFUwcVEifQ.ITh3ZBGrbgU8DsYWz6d-S4Q1iNlQ8DwKGZB6RZvOkTUpa0VmW7qFS6MO1tkauHoJMFrOlwSrvVuMEO_SQTh8xtR2d0219PPSshiYBHYkjsokSYTuyIaSclVIrL2vh7xH
Every now and then I get an error like the following in my application and I'm not quite sure why. The actual string is a nvarchar(255)
field within my database.
This error does not happen all the time. But it has happened quite a few times.
Any help would be greatly appreciated as to how I can fix this issue.
Thanks in advance.
Entity: line 20: parser error : AttValue: " or ' expected
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : attributes construct error
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 20: parser error : Couldn't find end of Start Tag hr line 20
<span><H1>Server Error in '/' Application.<hr width=100% size=1 colo
^
Entity: line 31: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 31: parser error : Couldn't find end of Start Tag table line 31
<table width=100% bgcolor="#ffffcc">
^
Entity: line 46: parser error : Opening and ending tag mismatch: br line 29 and table
</table>
^
Entity: line 52: parser error : AttValue: " or ' expected
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : attributes construct error
<table width=100% bgcolor="#ffffcc">
^
Entity: line 52: parser error : Couldn't find end of Start Tag table line 52
<table width=100% bgcolor="#ffffcc">
^
Entity: line 67: parser error : Opening and ending tag mismatch: br line 50 and table
</table>
^
Entity: line 71: parser error : Opening and ending tag mismatch: br line 69 and body
</body>
^
Entity: line 72: parser error : Opening and ending tag mismatch: br line 50 and html
</html>
^
Entity: line 73: parser error : Premature end of data in tag br line 48
^
Entity: line 73: parser error : Premature end of data in tag br line 29
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag br line 27
^
Entity: line 73: parser error : Premature end of data in tag font line 24
^
Entity: line 73: parser error : Premature end of data in tag body line 18
^
Entity: line 73: parser error : Premature end of data in tag html line 1
^
2011-05-06 16:15:55.939 MyProject[9206:707] -[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10
2011-05-06 16:15:56.040 MyProject[9206:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSError AccessToken]: unrecognized selector sent to instance 0x4b87a10'
*** Call stack at first throw:
(
0 CoreFoundation 0x3237064f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x365b3c5d objc_exception_throw + 24
2 CoreFoundation 0x323741bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x32373649 ___forwarding___ + 508
4 CoreFoundation 0x322ea180 _CF_forwarding_prep_0 + 48
5 MyProject 0x000093ab -[MyAccountVC handlerGetUserByAccessToken:] + 46
6 CoreFoundation 0x322ddf03 -[NSObject(NSObject) performSelector:withObject:] + 22
7 MyProject 0x00026309 -[SoapRequest handleError:] + 148
8 MyProject 0x00026737 -[SoapRequest connectionDidFinishLoading:] + 254
9 Foundation 0x31f4a2f5 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 68
10 Foundation 0x31f4a277 _NSURLConnectionDidFinishLoading + 78
11 CFNetwork 0x35e71411 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 136
12 CFNetwork 0x35e65f49 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 100
13 CFNetwork 0x35e65e3b _ZN19URLConnectionClient13processEventsEv + 70
14 CFNetwork 0x35e65ded _ZN13URLConnection24multiplexerClientPerformEP18RunLoopMultiplexer + 36
15 CFNetwork 0x35e65d5f _ZN17MultiplexerSource7performEv + 126
16 CFNetwork 0x35e65cdd _ZN17MultiplexerSource8_performEPv + 8
17 CoreFoundation 0x32347a79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
18 CoreFoundation 0x3234975f __CFRunLoopDoSources0 + 382
19 CoreFoundation 0x3234a4eb __CFRunLoopRun + 230
20 CoreFoundation 0x322daec3 CFRunLoopRunSpecific + 230
21 CoreFoundation 0x322dadcb CFRunLoopRunInMode + 58
22 GraphicsServices 0x3058241f GSEventRunModal + 114
23 GraphicsServices 0x305824cb GSEventRun + 62
24 UIKit 0x35550d69 -[UIApplication _run] + 404
25 UIKit 0x3554e807 UIApplicationMain + 670
26 MyProject 0x00003f73 main + 70
27 MyProject 0x00003f28 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来我的 Web 服务已关闭,而且我根本没有在 Objective-C 中正确处理它。这就是为什么它返回 HTML(ASP.NET 错误页面)而不是字符串。
Looks like my web service is down and I'm simply not handling it properly in Objective-C. Hence why it's returning HTML (ASP.NET error page) instead of the string.