ios6

Convert date to next day's date in iOS

ぃ、小莉子 提交于 2019-12-03 21:39:48
I have a date in string format just like 30-11-2012 . I want the date next to it like 01-12-2012 again in string format. Is there any way of getting it? You should use NSCalendar for best compatibility NSDate *today = [NSDate dateWithNaturalLanguageString:@"2011-11-30"]; NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *dayComponent = [NSDateComponents new]; dayComponent.day = 1; today = [calendar dateByAddingComponents:dayComponent toDate:today options:0]; //2011-12-01 12:00:00 +0000 I got the answer by someone I forget the name, I was about to accept his/her answer but

iOS BLE - How to keep app active in the background?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 21:33:43
I am trying to find a clever way to keep a BLE app active in the background on iOS 6, without breaking any of Apple's rules. I plan to use the phone as a peripheral device and another BLE circuit as the central. My app will automatically be opened when a user arrives to a building using geofencing. After that the iPhone will connect to the first BLE central device it sees (the device will be in its white list). The user will then be able to move throughout the building switching to different BLE "nodes". My question is: What do I need to do in the background when a user is stationary at their

infinite loop trying to create a Custom View from xib in IB

女生的网名这么多〃 提交于 2019-12-03 21:09:40
问题 this is a follow-up to this question (custom UIView how-to with IB / Xcode 4.5.1 and iOS Simulator 6.0) but not necessary to read - this is my first time trying to create a custom UIView and there is clearly something that I'm not getting so thx in advance for any help that you can provide. I have a custom UIView that is derived from Interface Builder. I want to set the set the size to 200w x 200h and the backgroundColor to Green. When I created I did the following: Created a new Custom

How to post to a friend's wall in facebook iOS SDK 3.1?

ⅰ亾dé卋堺 提交于 2019-12-03 21:05:57
I have the SDK 3.1 working for iOS 6 for posting status updates and I have the facebook user id of the person who I want to post on their wall. I just want it to say "hi." to just one person's wall. I can target their feed with "/[id]/feed" but then I have to supply a graph object? if I use startForPostWithGraphPath() anyways. I figured it out! First of course implement FBFriendPickerDelegate per here, unless you already have their friend ID somehow. http://developers.facebook.com/docs/howtos/filter-devices-friend-selector-using-ios-sdk/ Then the important part, how to post to friend's wall: -

how to play online video those are on server

允我心安 提交于 2019-12-03 21:00:06
I have videos on my server. I would like to play those video on iPhone and iPad. Could anyone suggest how to deal with such case? I know how to play video when the same video is in my project using MPMoviePlayerController . Dilip You can use WebView to play video. In .h file add this code : #import <MediaPlayer/MediaPlayer.h> @interface VideoViewController : UIViewController<UIWebViewDelegate> @property (nonatomic, strong) UIWebView *playerView; And in .m file : @synthesize playerView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super

iOS6.1: Problems while trying to access WiFi RSSI (MobileWiFi.framework)

杀马特。学长 韩版系。学妹 提交于 2019-12-03 20:43:55
I'm trying to access the RSSI values of several APs around me using an iPod Touch 4G with iOS6.1 and Xcode 4.6.3 with a valid Provisioning Profile. I've read some discussions about this topic and the best way to do this seems to be using the private Framework MobileWifi. Since this project is for private usage only I'm ok with that. According to this website I need a special entitlement in order to access the MobileWiFi functions. I've never worked with entitlements before, but according to some examples my .entitlement file looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE

How to rotate UIImage

橙三吉。 提交于 2019-12-03 20:37:02
问题 I'm developing an iOS app for iPad. Is there any way to rotate a UIImage 90º and then add it to a UIImageView? I've tried a lot of different codes but none worked... Thanks! 回答1: You may rotate UIImageView itself with: UIImageView *iv = [[UIImageView alloc] initWithImage:image]; iv.transform = CGAffineTransformMakeRotation(M_PI_2); Or if you really want to change image, you may use code from this answer, it works. 回答2: To rotate the pixels you can use the following. This creates an

Will identifierForVendor change when updating from iOS6 to iOS7

独自空忆成欢 提交于 2019-12-03 20:35:33
We're currently using identifierForVendor which was introduced with iOS6. Now iOS7 was released and i wonder if this identifier will stay the same for my apps after the update process. If i recover my device with iOS7 then it will obviously change, since it will be a fresh start. How about the update via iTunes / OTA? I've also tested this behaviour with a little app that would just display identifierForVendor and it stayed the same before/after the update from iOS6 to iOS7. What's also important to know is that the identifierForVendor isn't related to the apple developer account, but to the

Sharing Passbook Passes .pkpass

萝らか妹 提交于 2019-12-03 20:34:21
I created a simple demo passbook pass in iOS 6. I emailed it to myself and it works fine. Now I need to share it with people. I uploaded the .pkpass file to the server but safari is not able to recognize the file format or mime type and hence it does not download it. Any ideas how can I share it? Safari should recognise these. I think you probably need to add the MIME type to your web server, so it knows how to present the file to visitors. Edit: the MIME type you need to add to your web server is application/vnd.apple.pkpass Passbook is only availiable on the iPhone 5 or phone users that have

iOS 6 CoreLocation does not work

醉酒当歌 提交于 2019-12-03 20:16:25
I make a location app. But Core Location does not work. I tested other iPhone application on my iPhone. Like google earth, a navigation software. The other applications do not work also. Why doesn't update location? Why 'locationManager:didUpdateToLocation:fromLocation:' message called 2 times only? Maybe... My iPhone broken down? or iOS 6 CoreLocation frameworks have some bug? Location service - On on iPhone settings Info.plist armv7 accelerometer location-services gps microphone magnetometer Code Example: - (CLLocationManager *)setupLocationManager { if ([CLLocationManager