这是我的代码UITableView
.每当我加载视图时,我都会收到以下错误:
***断言失败 - [UITableView _configureCellForDisplay:forIndexPath:],/ BuildRoot/Library/Cache/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962 UITableView(; layer =; contentOffset :{0,0}; contentSize:{343,190}>)无法从其dataSource()获取单元格
创建表的方法是相同的.我一直在使用tableviews很长一段时间.但是,我无法弄清楚这是错的.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 3;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
switch (indexPath.row) {
case 0:
return 70;
break;
case 1:
return 50;
break;
case 3:
return 50;
break;
default:
return 70;
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *Id = @"CellID2";
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:Id forIndexPath:indexPath];
if(cell == …
Run Code Online (Sandbox Code Playgroud) 我尝试使用coreLocation在Apple Watch上获取用户当前位置.每当我运行时-[CLLocationManager requestLocation]
,应用程序退出并发出以下错误.
2016-02-07 16:38:39.392 Placescope Apple Watch Extension[6255:1471552] *** Assertion failure in -[CLLocationManager requestLocation], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreLocationFramework_Sim/CoreLocation-1861.3.25.31/Framework/CoreLocation/CLLocationManager.m:816 2016-02-07 16:38:39.395 Placescope Apple Watch Extension[6255:1471552] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Delegate must respond to locationManager:didUpdateLocations:' *** First throw call stack: ( 0 CoreFoundation 0x00bb9fc4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00671df4 objc_exception_throw + 50 2 CoreFoundation 0x00bb9e5a +[NSException raise:format:arguments:] + 138 3 Foundation 0x0029a008 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118 4 CoreLocation 0x0013a4f9 CLClientGetCapabilities + 12683 5 Placescope Apple Watch …