ios7

Placing PlaceHolder In TextField

拈花ヽ惹草 提交于 2019-12-11 18:07:01
问题 I want to add mandatory field mark in textfield placeholder text like below image please suggest me i am totally confused how to do it 回答1: You can use : NSMutableAttributedString *attriButedString = [[NSMutableAttributedString alloc]initWithString:@"Mandatory*"]; [attriButedString addAttribute:NSForegroundColorAttributeName value:[NSColor lightGrayColor] range:NSMakeRange(0, 9)]; [attriButedString addAttribute:NSForegroundColorAttributeName value:[NSColor redColor] range:NSMakeRange(9, 1)];

Can't send Video to MFMessageComposeViewController

故事扮演 提交于 2019-12-11 17:54:42
问题 I have to send Video through message. I attached 30KB size of video. But it alerts "Video is too long". Below i mentioned the code to send video through message. NSString *message = [NSString stringWithFormat:@"Download this Video!"]; MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init]; messageController.messageComposeDelegate = self; [messageController setBody:message]; if ([MFMessageComposeViewController canSendAttachments]) { NSLog(@

Saving in Core Data with context crashing

此生再无相见时 提交于 2019-12-11 17:54:06
问题 I have a method which creates a separate thread: // Create thread dispatch_queue_t uniqueQueue = dispatch_queue_create("Unique Email Queue", NULL); // Run block on another thread called downloadQueue dispatch_async(uniqueQueue, ^{ // Get the persistance store coordinator AppDelegate* appDelegate = [UIApplication sharedApplication].delegate; self.persistentStoreCoordinator = appDelegate.persistentStoreCoordinator; // Setup the managed object context NSManagedObjectContext *managedObjectContext

How to identify animations completed or not? [closed]

前提是你 提交于 2019-12-11 17:26:55
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I am trying to find out whether my animation runs and completed or else it is still in process?? animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320 , 480)]; animationImageView.animationImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"eg1"],[UIImage

Get Bounding Box from lat/long and distance

情到浓时终转凉″ 提交于 2019-12-11 16:16:46
问题 Im using twitter stream api for my ios project. Stream API has a location parameter. How can i get bounding box coordinates from user location(lat/long) and 1km distance ? Is there any API or tool in MapKit or mathematical functions ? Input (latitude = 37.785834, longitude = -122.406417) Distance = 1000 meter Output latMin: 37.789934 longMin : -122.416417 latMax: 37.787834 longMax : -122.396417 回答1: Yep, check out the functions in <MapKit/MKGeometry.h> like MKMetersPerMapPointAtLatitude() ,

MonoTouch UIImage.FromFile not loading retina assets

不打扰是莪最后的温柔 提交于 2019-12-11 14:35:10
问题 I am testing in the simulator with iOS7. All my assets are retina only with the @2x name. I have a very weird behaviour with UIImage.FromFile. Please note that the behaviour is the same with simulator iPad and simulator iPad Retina. Basically: UIImage.FromBundle("Images/close.png"), this will work: it loads the close@2x.png and scales it down UIImage.FromFile("Images/close.png"), this doesn't work UIImage.FromFile("Images/close@2x.png"), this loads the image but i'm not sure it will do the

iOS 7. Keep UITableView section header from sticking on top

本秂侑毒 提交于 2019-12-11 14:24:19
问题 I'm designing a menu with categories and subcategories: when the user clicks a category, it should unfold to show its subcategories in an accordion style. My first approach (and the easiest, I guess), is setting a table section per category: section headers would contain the category, and the inner cells would be subcategories, but the default behavior of the section headers staying at the top doesn't fit too well with the design of my interface. My questions: - Is there any iOS7 feature to

UICollectionView: How to handle updates both before and after view is loaded?

…衆ロ難τιáo~ 提交于 2019-12-11 13:56:36
问题 I'm having issues updating a collection view when receiving those updates via KVO. e.g. for deletion I perform the following: dispatch_async(dispatch_get_main_queue(), ^{ NSUInteger index = [self.albumObjects indexOfObject:oldObject]; NSIndexPath* indexPath = [NSIndexPath indexPathForItem:index inSection:0]; [self.dataSource removeObjectAtIndex:index]; [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; } The above gives me the error: attempt to delete item 0 from section 0 which only

Subclassing UICollectionViewFlowLayout sometimes crashes on iOS6

戏子无情 提交于 2019-12-11 13:54:05
问题 I want a UICollectionView where the flowlayout direction is horizontal. I've implemented the method targetContentOffsetForProposedContentOffset:withScrollingVelocity: to always "snap" the view to a cell in the collection view when scrolling in the table. I have subclassed UICollectionViewFlowLayout like this (With the code for my implemented method from here: targetContentOffsetForProposedContentOffset:withScrollingVelocity without subclassing UICollectionViewFlowLayout) @implementation

Phonegap - developing and launching app on simulator

耗尽温柔 提交于 2019-12-11 13:46:21
问题 i'm developing using phonegap and when i want to launch the app in the ios simulator i do from terminal : phonegap run ios but it takes a few seconds is really slow to launch and refresh the app again and again like this. What i'm asking for is how to refresh app in simulator easly if possible quickly? 回答1: You can load the corresponding project blahblah.xcodeproj in XCode and supposedly you could run it from there, but I am having an impossible time getting it to detect changes to html and