TwoStepsForward
Lost but trying
Profile
Posts: 6
Reg: Apr 04, 2013
San Antonio
5,660
08/18/14 10:06 PM (10 years ago)

selector ‘setSeparatorinset:' Error

Hello…. I am developing my first iPad App, and received two error codes when I ran the iPad 6.1 simulator in Xcode….and I can't figure out what to do about the errors. Here's my code and the error messages (separated from the code with XXX): //table layout options... int tableRowHeight = 30; //table size depends on device, it's updated in the loadData method... menuTable = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStylePlain]; [menuTable setRowHeight:tableRowHeight]; [menuTable setBackgroundColor:[UIColor whiteColor]]; [menuTable setSectionHeaderHeight:0]; [menuTable setShowsVerticalScrollIndicator:FALSE]; [menuTable setShowsHorizontalScrollIndicator:FALSE]; [menuTable setDataSource:self]; [menuTable setDelegate:self]; //ios7 doens't extend separator to left edge for each row. Lame! if([menuTable respondsToSelector:@selector(setSeparatorInset:)]){ XXXXUndeclared selector ‘setSeparatorinset:’XXXX [menuTable setSeparatorInset:UIEdgeInsetsZero]; XXXXNo visible @interface for ‘UITableView’declares the selector ‘setSeparatorinset:’XXXX } //add the table as a sub-view... [self.view addSubview:menuTable]; } return self; } Any help would be greatly appreciated! Thanks, Two Steps Forward
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/18/14 10:46 PM (10 years ago)
You must be targeting iOS 6 for a particular reason, such as for the original iPad. Otherwise, Apple has moved 90% of eligible devices over to iOS 7. If you must compile for iOS 6, then you will need to exclude the iOS 7 specific code: #define IS_OS_7_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) if (IS_OS_7_OR_LATER) { if ([menuTable respondsToSelector:@selector(setSeparatorInset:)]) { [menuTable setSeparatorInset:UIEdgeInsetsZero]; } }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/18/14 10:55 PM (10 years ago)
OR ANOTHER WAY if ( floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1 ) { if ([menuTable respondsToSelector:@selector(setSeparatorInset:)]) { [menuTable setSeparatorInset:UIEdgeInsetsZero]; } }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/18/14 10:58 PM (10 years ago)
OR YET ANOTHER WAY #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7 //pre iOS 7, which means iOS 4.x, 5.x, 6.x #else // iOS 7 and beyond if ([menuTable respondsToSelector:@selector(setSeparatorInset:)]) { [menuTable setSeparatorInset:UIEdgeInsetsZero]; } #endif
 
TwoStepsForward
Lost but trying
Profile
Posts: 6
Reg: Apr 04, 2013
San Antonio
5,660
like
08/19/14 05:43 AM (10 years ago)
Hi Niraj, Thanks for providing these options. But, before I try one of them, I would like to know if I should change to iO7 and how to do that. Within Xcode, all I see is the iO6 Simulator. I have never upgraded to Maverick. Could that be why I don't see iO7? Thanks, Two Steps Forward
 
TwoStepsForward
Lost but trying
Profile
Posts: 6
Reg: Apr 04, 2013
San Antonio
5,660
like
08/19/14 05:47 AM (10 years ago)
Hi Again, Niraj, I sent too fast….I forgot to ask one other question…If I do not have iO7 and make one of the suggested changes, can I make the change in the Xcode window, or do I need to make it in the Buzztouch window? And, if it is in the Buzztouch window, where do I find the code that is the problem? I know that changes in the Buzztouch windows change the Xcode windows, but I don't know if it also goes the other way. Thanks again, Two Steps Forward
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/19/14 05:49 AM (10 years ago)
You must be on a Mac running a supported version of OS X for Xcode 5. This means only Mountain Lion and Mavericks.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/19/14 05:51 AM (10 years ago)
Make your changes inside Xcode.
 
TwoStepsForward
Lost but trying
Profile
Posts: 6
Reg: Apr 04, 2013
San Antonio
5,660
like
08/19/14 08:32 AM (10 years ago)
Hi Again, Niraj, I sent too fast….I forgot to ask one other question…If I do not have iO7 and make one of the suggested changes, can I make the change in the Xcode window, or do I need to make it in the Buzztouch window? And, if it is in the Buzztouch window, where do I find the code that is the problem? I know that changes in the Buzztouch windows change the Xcode windows, but I don't know if it also goes the other way. Thanks again, Two Steps Forward
 
TwoStepsForward
Lost but trying
Profile
Posts: 6
Reg: Apr 04, 2013
San Antonio
5,660
like
08/19/14 08:33 AM (10 years ago)
Thanks for your help…I'll follow your directions and hopefully get it working right!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.