ios5

Having trouble creating UIImage from CIImage in iOS5

烈酒焚心 提交于 2020-01-09 06:50:41
问题 I'm using the AVFoundation framework. In my sample buffer delegate I have the following code: -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{ CVPixelBufferRef pb = CMSampleBufferGetImageBuffer(sampleBuffer); CIImage *ciImage = [CIImage imageWithCVPixelBuffer:pb]; self.imageView.image = [UIImage imageWithCIImage:ciImage]; } I am able to use the CIImage to run the face detector etc. but

-[Not A Type retain]: message sent to deallocated instance

走远了吗. 提交于 2020-01-09 05:22:06
问题 I have converted my app to use ARC. Before I had the following line of code: NSArray *colors = [NSArray arrayWithObjects:startColor, endColor, nil]; Since the implicit conversion of a non-Objective-C pointer type to 'id' is disallowed with ARC, I rewrote the line like this: NSArray *colors = [NSArray arrayWithObjects:(__bridge id)startColor, (__bridge id)endColor, nil]; Everything works fine on the simulator, however on the device the app crashes on the mentioned line with the error message:

kill items in a dispatch_async queue in iOS

自作多情 提交于 2020-01-09 05:06:26
问题 I am running a bunch of items in the background using dispatch_async and sometimes I want to kill what I have in the queue - is this possible? For instance this code is run on a view, and then the user goes back a screen. All of these fired actions keep running regardless of the back navigation. Ideally I would like to kill these items from running: dispatch_async(dispatch_get_global_queue(2, 0), ^{ for (int i=0; i<[self.manufacturers count]; i++) { NSString *manufacturerID = [[[self

Custom iOS UIDatepicker using UIAppearance

人走茶凉 提交于 2020-01-08 19:41:28
问题 UNIQLO's new alarm app has a custom UIDatePicker : And I want to create my own custom UIDatePicker . I tried to change the appearance of the DatePicker, but looking for UI_APPEARANCE_SELECTOR in the UIDatePicker returns nothing . Meaning that its not possible to change any values, as per the docs: To support appearance customization, a class must conform to the UIAppearanceContainer protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR. How can change my

how to update the textfield value in ios [closed]

梦想的初衷 提交于 2020-01-08 02:13:39
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have one textfield value like 100,000 using NSNumberFormatter, now I want to edit my textfield, to add one more 0 . After I Want to Change like the text like 1,000,000 but my textfield value is changed as 0 回答1

NSURLRequest cachePolicy and connection in UIWebView

跟風遠走 提交于 2020-01-07 08:29:30
问题 I set up a UIWebView with a cachePolicy of NSURLRequestReloadIgnoringLocalAndRemoteCacheData, and everything was fine: when there was a connection, the UIWebView loaded, and when there wasn't, connection:didFailWithError: was called and I got my UIAlertView. But when I change the cachePolicy to NSURLRequestReturnCacheDataElseLoad (which is the policy I actually want), in the absence of a connection, the cached page loads and then, when I click on a link...nothing happens. No connection

Pass values between master and detail

别来无恙 提交于 2020-01-07 04:05:21
问题 Which do you think the best way to pass data between the two sides of a split view? Which do you think the best way to call a method from master to detail or from detail to master? Protocols? Segues? Or...? I have seen seem tutorials in this topic but I can not figure out what is the most trivial way of it. 回答1: Protocols are the best way if you need to use them for multiple UIViewControllers . Though if you need to explicitly communicate between two controllers, try simply storing a weak

MPMoviePlayerController full screen orientation issue

心已入冬 提交于 2020-01-07 02:56:09
问题 My app supports only Landscape. I've added an MPMoviePlayerController to the view of my view controller. When I press full screen button, it works fine and it will rotate in Landscape only for iOS versions prior to iOS 5. However, in iOS 5.0+, it also supports portrait (only when I enter into full screen mode). How can I prevent portrait support in iOS 5.0 and above? 回答1: Try subclassing MPMoviePlayerViewController and overriding the shouldAutorotatoToInterfaceOrientation method to only

How to show SomeViewControler using code?

谁说我不能喝 提交于 2020-01-07 02:17:25
问题 I am brand new in Xcode and iOS development. I am trying to figure out how to open/show some view based on button click. I know that I can do this using ctrl + mouse click on some ViewController using segue but I need to add some logic before. How can I accomplish this? 回答1: There are two ways to make segues work. You can either ctrl drag from a button to a new ViewController (like you have done) or you can ctrl drag from one ViewController to a new ViewController (drag from the little orange

property x not found on object of type y

ぐ巨炮叔叔 提交于 2020-01-07 02:16:23
问题 Newbie here, working on a programmable calculator. In the interface of the model class CalculatorBrain , I declare @property (nonatomic, strong) NSMutableArray *whatHappenedSinceLastClear; Then in the implementation I also declare -(NSMutableArray *)whatHappenedSinceLastClear { if(!_whatHappenedSinceLastClear) _whatHappenedSinceLastClear = [[NSMutableArray alloc] init]; return _whatHappenedSinceLastClear; } and then -(double)runProgram:(id)whatHappenedSinceLastClear { NSMutableArray