ios - NSCFNumber getCString maxLength编码在创建地理围栏时出错
<p>当我尝试将半径添加到围栏应用程序时,出现<code></code>崩溃。<br>这是我的代码:<br><pre><code>NSString *identifier = ;
CLLocationDegrees latitude = [ doubleValue];
CLLocationDegrees longitude =[ doubleValue];
CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake(latitude, longitude);
CLLocationDistance regionRadius = [ doubleValue];
NSLog(@"nslog is %f",regionRadius);
if(regionRadius > _locationManager.maximumRegionMonitoringDistance)
{
regionRadius = _locationManager.maximumRegionMonitoringDistance;
}
NSString *version = [ systemVersion];
CLRegion * region =nil;
if( >= 7.0f) // for iOS > 7
{
region =[ initWithCenter:centerCoordinate
radius:regionRadius
identifier:identifier];
}
else // for iOS < 7
{
region = [ initCircularRegionWithCenter:centerCoordinate
radius:regionRadius
identifier:identifier];
}
</code></pre><br>这里的Stacktrace是<br><pre><code>0 KNOXXi 0x00064c8b - + 854
1 KNOXXi 0x000640cf - + 86
2 KNOXXi 0x00065d25 __25-_block_invoke + 536
3 KNOXXi 0x0006369d __59-_block_invoke + 196
4 KNOXXi 0x0002762d __64-_block_invoke46 + 36
5 libdispatch.dylib 0x3992f833 <redacted> + 10
6 libdispatch.dylib 0x3992f81f <redacted> + 22
7 libdispatch.dylib 0x3993649f <redacted> + 278
8 CoreFoundation 0x2e7648a1 <redacted> + 8
9 CoreFoundation 0x2e763175 <redacted> + 1300
10CoreFoundation 0x2e6cdebf CFRunLoopRunSpecific + 522
11CoreFoundation 0x2e6cdca3 CFRunLoopRunInMode + 106
12GraphicsServices 0x33601663 GSEventRunModal + 138
13UIKit 0x3101a14d UIApplicationMain + 1136
14KNOXXi 0x00026411 main + 224
15libdyld.dylib 0x39954ab7 <redacted> + 2
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p>试试这个<br><br>NSString * identifier = [[字典valueForKey:@“id”] stringvalue];</p>
<p style="font-size: 20px;">关于ios - NSCFNumber getCString maxLength编码在创建地理围栏时出错,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/24670443/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/24670443/
</a>
</p>
页:
[1]