Okay, I have a basic understanding of what is happening here, but am having trouble fixing it. I am hoping someone can walk me through what I'm doing wrong here...
I have a nifty app that works great and was built with the storyboard and custom UIViewControllers to handle all my code. I was doing really well, until I needed to handle my push notifications by dropping me in a specific view and loading some data. I made a lot of headway today and just got stuck in a bad way. I am now getting an objc_sendmsg error and I know it has to do with my memory management. I've never initialized a view in this way, so I'm wondering if that's what's causing it. Basically, I can load a view, but I can never push any buttons or get anywhere after that.
Here's the code:
AppDelegate.m
UIStoryboard* storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *detailVC = [storyBoard instantiateViewControllerWithIdentifier:@"Leads_Calls_SB"];
[self.window addSubview:detailVC.view];
[[NSNotificationCenter defaultCenter] postNotificationName:@"callReceived"
object:nil
userInfo:userInfo];
[self.window makeKeyAndVisible];
Leads_CallsDetailViewController.h
@property (strong, nonatomic) IBOutlet UILabel *cName;
@property (strong, nonatomic) IBOutlet UILabel *cStart;
@property (strong, nonatomic) IBOutlet UILabel *cNumber;
@property (strong, nonatomic) IBOutlet UILabel *cStart2;
@property (strong, nonatomic) IBOutlet UILabel *cEnd;
@property (strong, nonatomic) IBOutlet UILabel *cDuration;
@property (strong, nonatomic) IBOutlet UILabel *cStatus;
@property (strong, nonatomic) IBOutlet UILabel *cProvider;
@property (strong, nonatomic) IBOutlet UILabel *cLineType;
@property (strong, nonatomic) IBOutlet UILabel *cCity;
@property (strong, nonatomic) IBOutlet UIView *innerView;
@property (strong, nonatomic, retain) IBOutlet UIButton *backStyle;
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic, retain) NSString *cNotifID;
@property (strong, nonatomic, retain) NSString *cNameText;
@property (strong, nonatomic, retain) NSString *cNumberText;
@property (strong, nonatomic, retain) NSString *cStartText;
@property (strong, nonatomic, retain) NSString *cEndText;
@property (strong, nonatomic, retain) NSString *cCallStatusText;
@property (strong, nonatomic, retain) NSString *cLatitudeText;
@property (strong, nonatomic, retain) NSString *cLongitudeText;
@property (strong, nonatomic, retain) NSString *cCityText;
@property (strong, nonatomic, retain) NSString *cLineTypeText;
@property (strong, nonatomic, retain) NSString *cProviderNameText;
- (IBAction)back:(id)sender;
@property (strong, nonatomic) IBOutlet MKMapView *map;
- (IBAction)forward_lead:(id)sender;
- (IBAction)call_lead:(id)sender;
- (IBAction)add_lead:(id)sender;
@property (strong, nonatomic) IBOutlet UIButton *bottomMessage;
@property (strong, nonatomic) IBOutlet UIButton *bottomCalls;
@property (strong, nonatomic) IBOutlet UIButton *bottomReports;
@property (strong, nonatomic) IBOutlet UIButton *bottomHome;
.m
- (IBAction)back:(id)sender {
if (self.cNotifID != nil)
{
[self.view removeFromSuperview];
}
else {
[self.navigationController popViewControllerAnimated:YES];
}
}
I'm not sure what I'm doing wrong, but no matter what happens if I hit any button on that page or try to dismiss the view, it screams at me and gets angry...I've tried everything I can think of to figure this out.
Thanks guys!