助けてください..私はこの奇妙な問題を理解することができません. 私のアプリは iAd とマルチタスクをサポートしています。アプリは iPhone にデプロイでき、問題なく動作しますが、iPhone 3g (iOS 3.1.2 を使用) にアプリをデプロイしようとすると、コンソールに次のエラーがスローされます。iAds のコードをコメントアウトしようとしましたが、ここで何が起こっているのかわかりません..みんなを助けてください..ありがとう
[Session started at 2010-08-31 13:01:05 -0500.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys003
Loading program into debugger…
warning: Unable to read symbols from "iAd" (not yet mapped into memory).
Program loaded.
target remote-mobile /tmp/.XcodeGDBRemote-32678-64
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11779]
[Switching to thread 11779]
sharedlibrary apply-load-rules all
continue
2010-08-31 13:02:14.666 SugarCRMReleaseOne[5256:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initWithString:relativeToURL:]: nil string parameter'
2010-08-31 13:02:14.709 SugarCRMReleaseOne[5256:207] Stack: (
853417245,
845594132,
852966195,
852966099,
871903965,
871903579,
871903537,
211149,
211529,
147487,
171893,
290105,
279933,
853174415,
818198404,
818198252,
818198196,
818197260,
818200460,
818194688,
818192276,
818173840,
818172052,
834382224,
853165355,
853163039,
834376564,
817839152,
817832496,
8857,
8720
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
kill
quit
編集
1 [syncDelegateImpl loginHandler];
2 -(void) loginHandler { SCRMsugarsoap* service = [[SCRMsugarsoap alloc] initWithUrl:serverURL]; service.logging = はい; service.username = ユーザー名; service.password = パスワード; [service login:self action:@selector(sessionIdHandler:) user_auth: [[[SCRMuser_auth alloc] initWithUsername:userName andPassword:password]autorelease] application_name: @""]; [サービスリリース]; }
3 [service login:self action:@selector(sessionIdHandler:) user_auth: [[[SCRMuser_auth alloc] initWithUsername:userName andPassword:password]autorelease] application_name: @""];
(id) initWithUsername: (NSString*) ユーザー名とパスワード: (NSString*) pass { if(self = [super init]) { Soap *converter = [[Soap alloc] init]; SCRMsugarsoap *service = [[SCRMsugarsoap alloc] init];
[service get_server_version:self action:@selector(get_server_versionHandler:)]; self.user_name = username; self.password = [converter tomd5:pass]; [converter release]; [service release]; } return self;
}
4 [service get_server_version:self action:@selector(get_server_versionHandler:)]; 上記の方法で..
(SoapRequest*) get_server_version: (id) _target アクション: (SEL) _action { NSMutableArray* _params = [NSMutableArray 配列];
NSString* _envelope = [Soap createEnvelope: @"get_server_version" forNamespace: self.namespace withParameters: _params withHeaders: self.headers]; SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: (@"%@/get_server_version", serverURL) postData: _envelope deserializeTo: @"NSString"]; [_request send]; return _request;
}
5 ここで、SOAP Request クラスのメソッドを呼び出そうとします
- (SoapRequest*) create: (SoapHandler*) handler action: (SEL) action service: (SoapService*) service soapAction: (NSString*) soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo { SoapRequest* request = [ SoapRequest 作成: ハンドラー アクション: アクション urlString: service.serviceUrl soapAction: soapAction postData:postData deserializeTo:deserializeTo]; request.defaultHandler = service.defaultHandler; request.logging = service.logging; request.username = service.username; request.password = service.password; 返品リクエスト; }
6 したがって、リクエストを設定しようとすると、以下のメソッドが呼び出されます
+ (SoapRequest*) create: (SoapHandler*) handler action: (SEL) action urlString: (NSString*) urlString soapAction: (NSString*) soapAction postData: (NSString*) postData deserializeTo: (id) deserializeTo {
SoapRequest* request = [[SoapRequest alloc] init];
//request.url = nil;
//if(urlString!=nil)
//{
request.url=[NSURL URLWithString: urlString];
//}
request.soapAction = soapAction;
request.postData = [postData retain];
request.handler = handler;
request.deserializeTo = deserializeTo;
request.action = action;
request.defaultHandler = nil;
return [request autorelease];
}
URL の設定中に objc_exception_throw がスローされます。iPhone 4 では問題なく動作しますが、iPhone 3 にデプロイしようとするとエラーがスローされます。
アプリにマルチタスクと iAd フレームワークがあり、次の方法でバージョンを確認しました。
if ([[UIDevice currentDevice].systemVersion floatValue] >=3.2)
{
do iphone 4 stuff
}
else
{
do iphone 3 stuff
}