ios - How to prevent "expression not used" warning with iPad tableView row selection code -
i have ipad app uses tabbar setup custom splitviewcontroller , allows selections standard left-hand table menu (controlled viewcontroller) alter contents right (landscape only) controlled detailviewcontroller. runs fine , in app store. in process of updating arc , ios7 using xcode 5.1.1 , conversion has worked , programme seems run ok in simulator. getting warning (which never had before) in didselectrowatindexpath method of each of views. illustration in class, stylesviewcontroller:
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [(stylesdetailviewcontroller *)detailviewcontroller initwithindexpath:indexpath]; [((stylesdetailviewcontroller *)detailviewcontroller).masterpopover dismisspopoveranimated:yes]; } the warning first line (the sec not used app supports landscape) , "expression result unused". line necessary, programme not crash, assume warning ignored. however, knowing apple, prefer not submit app warnings review. can suggest harmless statment 'use' 'result of expression' , hence quiet compiler?
sending message string 'init' in it's selector object not created on same line of code of import anti-pattern in ios/objective-c. details not exclusively necessary, of import (and relevant) bit of info technically 'init' method returns id, allowed different object 1 message sent to!
your warning telling you not using object. calling of init method outside of it's alloc line may have other unwieldy implications.
one caveat answer: specifics depend on implementations of method in question, , posting method (at to the lowest degree it's signature) help. however, if using method prime object in way can/should happen on , on , apart alloc step, highly encourage avoid utilize of string init in name... utilize loadwith... or similar.
ios objective-c uitableview
No comments:
Post a Comment