小编use*_*201的帖子

为什么断言失败 - [UISectionRowData refreshWithSection:tableView:tableViewRowData:]?

 Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /SourceCache/UIKit/UIKit-2380.17/UITableViewRowData.m:400

 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException',     reason:'Failed to allocate data stores for 997008923 rows in section 0. Consider using fewer rows'
Run Code Online (Sandbox Code Playgroud)

我的代码

 -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {

   return 1;

  }


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

   return [appDelegate.purchaseArray count];

}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:  (NSIndexPath *)indexPath
   {
    static NSString *CellIdentifier = @"cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault         reuseIdentifier:CellIdentifier];
    }
    return cell;
}    

-(void)viewWillAppear:(BOOL)animated
{ …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview

5
推荐指数
2
解决办法
6339
查看次数

如何在iPhone中的谷歌地图sdk中获取当前位置

我想将相机设置在当前位置,并将缩放级别设置为10.所以我编写了这样的代码,对于当前位置,我从这篇文章中得到提示.

如何在IOS 6的Google Map API中使用委托

这是我的代码

mapView_=[[GMSMapView alloc]initWithFrame:CGRectZero];

CLLocationCoordinate2D currentPosition = mapView_.myLocation.coordinate;

 GMSCameraPosition* camera =
[GMSCameraPosition cameraWithTarget: currentPosition zoom: 10];
 mapView_.camera = camera;
 mapView_.delegate=self;

  mapView_.mapType = kGMSTypeSatellite;
  mapView_.myLocationEnabled = YES;

  self.view = mapView_;
  mapView_.settings.myLocationButton = YES;
Run Code Online (Sandbox Code Playgroud)

但设备中的坐标为0.00.

请问任何可以帮助解决这个问题?

iphone google-maps google-maps-sdk-ios

4
推荐指数
1
解决办法
2万
查看次数