ios7

Using a UIColor category in iOS 7 and Objective c

依然范特西╮ 提交于 2019-12-11 08:29:15
问题 I have a UIColor+MyLayout.m file such as: @implementation UIColor (Layout) - (UIColor *) textBackground { UIColor *lightGreen = [UIColor colorWithRed:0.0f/255.0f green:178.0f/255.0f blue:238.0f/255.0f alpha:1.0f]; return lightGreen; } @end I have added the .h file to my viewcontroller.m, but how do I call this into a UIColor? UIColor *myColor = ? 回答1: Would be better if you do the following: @implementation UIColor (Layout) + (UIColor *) textBackground { UIColor *lightGreen = [UIColor

EKCalendarEKCalendar CGcolor is not setting color in iPhone's calendar

吃可爱长大的小学妹 提交于 2019-12-11 08:20:02
问题 i have two type of events,so i have set two different color to differentiate between events in calendar,but i am not able to set color of EkCalendar, here is my code NSDateComponents* deltaComps = [[NSDateComponents alloc] init]; //[deltaComps setDay:3]; [deltaComps setMinute:02]; NSDate* tomorrow = [[NSCalendar currentCalendar] dateByAddingComponents:deltaComps toDate:[NSDate date] options:0]; //NSDate* dayAfterTomorrow = [[NSCalendar currentCalendar] dateByAddingComponents:deltaComps toDate

Cordova geolocation in IOS not working

大城市里の小女人 提交于 2019-12-11 08:18:46
问题 I am working in a project that uses Cordova geolocation plugin that will search for users around you. However, I cannot get the geolocation from the simulator, nor on the device. Before I use to get the coordinates but very unstable. After some code to fix the bug, I am now getting an error most of the time. I tried this for a week with no success. Any input, or advice? The JavaScript file: /***********Geolocation GEOLOCATION*************/ // Wait for device API libraries to load document

MPMediaPickerController background colors of icons, when aren´t selected

混江龙づ霸主 提交于 2019-12-11 08:15:21
问题 I need change the gray color of the icons in MPMediaPickerController, when they are not selected, and the background is opaque, like faded, i need remove this too. i'm using ios7.1 and the next code to show MPMediaPickerController element, on my viewController. - (IBAction)addSongs:(id)sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; [self presentViewController

How to set colour on a button from colour picker methods?

别说谁变了你拦得住时间么 提交于 2019-12-11 07:25:47
问题 I generate some buttons in a for loop, each with its own tag. Now I want to tap on a button and open a colour picker and set the colour of the button. My problem is that when I open the colour picker and choose a color it gets set on a different button. I want to tap on a button and choose the colour for the tapped button only. The code i am using is: for(int i=0;i<=5;i++){ btnphoto=[[UIButton alloc]initWithFrame:CGRectMake(10,(30*i)+110,50,20)]; [btnphoto setTitle:@"Photo" forState

Change height constraint of table view outside of viewDidAppear in iOS 7

痞子三分冷 提交于 2019-12-11 07:17:37
问题 In my View Controller's .xib file I'm using a UITableView which has a dynamic number of rows. Because it's not the only element in the .xib file (there are other elements below and above it), I need to change it's height constraint after I know the number of rows. To achieve this, I'm using this solution that works fine. Therefore: @implementation MyViewController { __weak IBOutlet UITableView *_tableView; __weak IBOutlet NSLayoutConstraint *_tableViewHeightConstraint; } - (void)viewDidAppear

How to properly set the Radius of CLRegion?

邮差的信 提交于 2019-12-11 06:58:52
问题 This is my code for creating a geofence: Geofence *geofence = [[Geofence alloc] init]; [geofence setRadius:100.0]; [geofence setIdentifier: @"Fence1"]; [geofence setLocation:currentlocation]; CLRegion *region1 = [[CLCircularRegion alloc] initWithCenter:[geofence.location coordinate] radius:geofence.radius identifier:geofence.identifier]; region1.notifyOnEntry=YES; region1.notifyOnExit=YES; [self.locationManager startMonitoringForRegion:region1]; I could say that, the above code works, meaning

Where is the iOS 7 simulator Japanese keyboard dictionary located?

空扰寡人 提交于 2019-12-11 06:42:25
问题 this question is a bit similar to this one. How do I enable the Japanese keyboard on the iPhone simulator? I get it to worked in Xcode 4.6, iOS Simulator 6. Things go all well. But when I upgraded to Xcode 5, iOS Simulator 7, the dictionary is gone... I can't write kanji, or even kana... where has the dictionary gone? How do I make it work in the iOS Simulator (because I don't have the real device) like back there? Edit Note: Ok, don't get it wrong. I changed the keyboard to japanese. Since I

Put MKPointAnnotation on MKDirections at a specific distance

时光怂恿深爱的人放手 提交于 2019-12-11 06:28:41
问题 I'm using MKDirections to draw a route from point A to point B, and I'm looking to put a MKPointAnnotation at specific distance from the starting point. For example, I have a MKMap with MKDirections drawn from LA to NY. I then would like to place a pin at the 10 mile marker for the route the user has decided to take. Any thoughts on how to find the lat/long, using the chosen route at a specific distance? Thanks. - (void)showDirections:(MKDirectionsResponse *)response { NSInteger iDistance = 0

IOS AMSlideMenu open menu callback

泄露秘密 提交于 2019-12-11 06:23:44
问题 I'm new in IOS, and can't understand some things about delegates and protocols. In my project I'm using AMSlideMenu for slide menu. I need to update same data in slide menu. For that I need to catch openMenu callback. In instruction for slide menu I found this If you want to get menu's open/close callbacks, then set MainVC's delegate property, and implement protocol named 'AMSlideMenuProtocols'. @optional - (void)leftMenuWillOpen; - (void)leftMenuDidOpen; - (void)rightMenuWillOpen; - (void