NSIntegerをパラメーターとして受け取るNSURLデリゲートメソッドがあります
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
符号付きlongであるNSIntegerの範囲は-2147483647〜2147483647です。私の問題は、正の範囲を超える値を取得することがあり、これにより値が不要な負の数になることです。
だから私はNSIntegerをNSUIntegerに変更しました
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSUInteger)bytesWritten totalBytesWritten:(NSUInteger)totalBytesWritten totalBytesExpectedToWrite:(NSUInteger)totalBytesExpectedToWrite
私の質問は、そのような変更を行っても大丈夫かどうかです。これまでのところ問題はありません。メソッドが呼び出され、期待どおりの結果が得られています。
予期せぬ問題が発生する可能性があります。