im trying subclass uitableviewcell.
at first i was using uitableviewcontroller with no problem and everything works
well. the problem was i couldnt insert static view top of uitableview. so i
started to use uiview + uitableview. i set delegate and datasource to my uitable
but when i tried to compile my solution i get this error :
2015-03-04 15:00:53.087 News[7410:750801] *** Assertion failure in -[SubcategoryTableViewCell _setHostsLayoutEngine:], /SourceCache/UIKit/UIKit-3318.16.14/NSLayoutConstraint_UIKitAdditions.m:2760
2015-03-04 15:00:58.132 News[7410:750801] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.'
*** First throw call stack:
(0x182b59e48 0x19324c0e4 0x182b59d08 0x1839dd554 0x1873d6088 0x1873df4f0 0x1876f3c60 0x18771475c 0x1877eccc8 0x1877ecc68 0x1877ec984 0x1875c96f8 0x187832244 0x1877eccc8 0x1877ecc68 0x1877ec984 0x1875c96f8 0x1876f3c44 0x18771475c 0x1877eccc8 0x1877ec984 0x187714264 0x1877eccc8 0x1877ecc68 0x1877ec984 0x1877136ec 0x187446cac 0x1000292e8 0x187421854 0x1873e369c 0x1873e58f0 0x1873e582c 0x1873e5178 0x10003ad30 0x100344e30 0x100344df0 0x10034975c 0x182b116a0 0x182b0f748 0x182a3d1f4 0x18bbd35a4 0x18736e784 0x100029bf4 0x1938baa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
on this part of code :
- (SubcategoryTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *reuseIdentifier = @"PlaceholderCell2";
SubcategoryTableViewCell * sctvCell = [self.tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
if (sctvCell == nil) {
sctvCell= [[SubcategoryTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
}
in storyboard i set my uitableviewcell to my cell custome class. and it works
perfectly with uitableview controller.
this is my class and subclass code :