objective-c

Trying to change MKPointAnnotation colour but losing the title

送分小仙女□ 提交于 2021-02-09 08:32:32
问题 I am trying to change my pin colour to purple, when I do it I lose the title though. Code is: - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBarHidden=YES; //init the location manager self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; [self.locationManager requestWhenInUseAuthorization]; self.mapView.showsUserLocation=YES; self.userGeoPoint=self.message[@"userLocation"]; self.pinView = [

This coder requires that replaced objects be returned from initWithCoder:

跟風遠走 提交于 2021-02-09 03:55:22
问题 My application is working fine with iOS 11.2 but in iOS 11.3 is going crash. i got exception Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder I have one viewController with tableView and this tableView have 2 cells somehow this table view can't able to load a cell in cellForRowAtIndexPath Method. LPDiscoverFeedCell *cell = (LPDiscoverFeedCell *)[tableView dequeueReusableCellWithIdentifier

When is an IBOutlet UIViewController inited, if set as a property? How to optimize IBOutlet UIViewControllers' loading?

两盒软妹~` 提交于 2021-02-09 00:40:50
问题 I have my main app view controller (File's Owner), its First Responder, View, and 3 other UIViewControllers in the same nib file. Every one of the 3 UIViewControllers is referenced on the main UIViewController as an IBOutlet. My question is, when does the main UIViewController init those 3 UIViewControllers, in its life cycle (my guess is sometime before calling viewDidLoad) and should I worry with optimizing how and when they are loaded. The reasoning is obviously that if the app loads the

When is an IBOutlet UIViewController inited, if set as a property? How to optimize IBOutlet UIViewControllers' loading?

。_饼干妹妹 提交于 2021-02-09 00:36:39
问题 I have my main app view controller (File's Owner), its First Responder, View, and 3 other UIViewControllers in the same nib file. Every one of the 3 UIViewControllers is referenced on the main UIViewController as an IBOutlet. My question is, when does the main UIViewController init those 3 UIViewControllers, in its life cycle (my guess is sometime before calling viewDidLoad) and should I worry with optimizing how and when they are loaded. The reasoning is obviously that if the app loads the

When is an IBOutlet UIViewController inited, if set as a property? How to optimize IBOutlet UIViewControllers' loading?

荒凉一梦 提交于 2021-02-09 00:26:12
问题 I have my main app view controller (File's Owner), its First Responder, View, and 3 other UIViewControllers in the same nib file. Every one of the 3 UIViewControllers is referenced on the main UIViewController as an IBOutlet. My question is, when does the main UIViewController init those 3 UIViewControllers, in its life cycle (my guess is sometime before calling viewDidLoad) and should I worry with optimizing how and when they are loaded. The reasoning is obviously that if the app loads the

When is an IBOutlet UIViewController inited, if set as a property? How to optimize IBOutlet UIViewControllers' loading?

风流意气都作罢 提交于 2021-02-09 00:24:59
问题 I have my main app view controller (File's Owner), its First Responder, View, and 3 other UIViewControllers in the same nib file. Every one of the 3 UIViewControllers is referenced on the main UIViewController as an IBOutlet. My question is, when does the main UIViewController init those 3 UIViewControllers, in its life cycle (my guess is sometime before calling viewDidLoad) and should I worry with optimizing how and when they are loaded. The reasoning is obviously that if the app loads the

How to change the background color of an NSPopupButton?

十年热恋 提交于 2021-02-08 15:54:46
问题 I am trying to tackle a problem which sounds pretty simple: changing the background color of an NSPopupButton. Interface Builder only allows changing the style to a pre-defined one and doesn't allow changing the background color. Also, setting up an IBOutlet didn't help since NSPopupButton doesn't have a setBackgroundColor method. I also tried subclassing NSPopupButton to override the drawRect method. Here's what I have tried: - (void)drawRect:(NSRect)dirtyRect { [[NSColor redColor] setFill];

How to change the background color of an NSPopupButton?

天大地大妈咪最大 提交于 2021-02-08 15:54:00
问题 I am trying to tackle a problem which sounds pretty simple: changing the background color of an NSPopupButton. Interface Builder only allows changing the style to a pre-defined one and doesn't allow changing the background color. Also, setting up an IBOutlet didn't help since NSPopupButton doesn't have a setBackgroundColor method. I also tried subclassing NSPopupButton to override the drawRect method. Here's what I have tried: - (void)drawRect:(NSRect)dirtyRect { [[NSColor redColor] setFill];

Want to make UITextView react to return key

回眸只為那壹抹淺笑 提交于 2021-02-08 15:51:30
问题 I'm trying to implement a program in Xcode that's somewhat like a command line. I basically have a UITextView that can take multiple lines of text. Right now, I have a button that will make the necessary changes after the user is done entering commands, but I want to be able to have a method that gets called after the user hits the return key in the UITextView, so basically it makes changes after each command. Is it possible to do this? 回答1: If you set a delegate to the UITextView which

Run javascript without UIWebView possible?

微笑、不失礼 提交于 2021-02-08 15:22:06
问题 Is it possible to run some javascript code (having perhaps an NSString as input) without using a UIWebView ? I would like to run this code in a separate thread so UIWebView is not possible and I don't really want to render anything, just get back the results. 回答1: I have not tried this, but here is one idea: Write code to allocate an empty UIWebView but doesn't add it as a subview anywhere, and just directly call - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script on your