objective c - "unrecognized selector sent to instance" crash -
i've got trouble ui_user_interface_idiom() here
- (void)viewdidload { [super viewdidload]; self.footercommentactivity = self.commentactivity; self.footernewsactivity = self.newsactivity; [self.othernews settablefooterview:nil]; [self.commenttableview settablefooterview:nil]; if (ui_user_interface_idiom() == uiuserinterfaceidiomphone) { html = [nsstring stringwithformat:@"<html style='-webkit-text-size-adjust: none;'><head><style>p {margin:0px 0px 10px;padding:0;}</style></head><body style='background-color:transparent;padding:0;margin:0;'>%@</body></html>", self.postcontenttext]; } else if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { html = [nsstring stringwithformat:@"<html style='-webkit-text-size-adjust: none;'><head><style>p {margin:0px 0px 10px;padding:0;}</style></head><body style='background-color:transparent;padding:0;margin:0;-webkit-column-count:2;'>%@</body></html>", self.postcontenttext]; } [self.postcontent loadhtmlstring:html baseurl:nil]; self.loadmorecomments = false; self.loadmorenews = false; }
update code no 2: ive changed code viewdidappear function, still crashed
- (void)viewdidappear:(bool)animated { [super viewdidappear:animated]; shareddata = [nsuserdefaults standarduserdefaults]; nsmutablearray *temparray = [nsmutablearray arraywitharray:self.othernewsarray]; (int =0; < temparray.count; i++) { post *othernewspost = [temparray objectatindex:i]; if (othernewspost.postid == self.postid) { [temparray removeobjectatindex:i]; break; } } self.othernewsarraywithoutcurrentpost = [temparray copy]; //update height of main image, text, video. nslog(@"post image: %@",self.postimagename); if (self.postimagename == nil) { self.postimage.image = nil; cgrect imageframe = self.postimage.frame; imageframe.size.height = 0.0f; self.postimage.frame = imageframe; cgrect f = self.postcontent.frame; f.origin.x = 0; // new x f.origin.y = 0; // new y self.postcontent.frame = f; } else { [self.postimage setimagewithurl:[nsurl urlwithstring:self.postimagename] placeholderimage:[uiimage imagenamed:@"postimage-placeholder"]]; // self.postimage.image = [uiimage imagenamed:self.postimagename]; } nsstring *htmlstring = @""; if (self.columns == false) { htmlstring = [nsstring stringwithformat:@"<html style='-webkit-text-size-adjust: none;'><head><style>p {margin:0px 0px 10px;padding:0;}</style></head><body style='background-color:transparent;padding:0;margin:0;'>%@</body></html>", self.postcontenttext]; [self.postcontent loadhtmlstring:htmlstring baseurl:nil]; } else { htmlstring = [nsstring stringwithformat:@"<html style='-webkit-text-size-adjust: none;'><head><style>p {margin:0px 0px 10px;padding:0;}</style></head><body style='background-color:transparent;padding:0;margin:0;-webkit-column-count:2;'>%@</body></html>", self.postcontenttext]; [self.postcontent loadhtmlstring:htmlstring baseurl:nil]; } [self.commenttableview reloaddata]; [self.othernews reloaddata]; if (self.othernews.hidden) { [self adjustviewheightfortable:self.commenttableview]; } else { [self adjustviewheightfortable:self.othernews]; } [self markasread]; [self loadpost]; }
when app start , start login app, getting crashed i'm using ipad simulator here
*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[session status]: unrecognized selector sent instance 0x8889890' *** first throw call stack:
Comments
Post a Comment