RE: How to get iOS version at runtime?

2014-07-18 Thread Julius Oklamcak
[[UIDevice currentDevice] systemVersion] returns a string, i.e. "7.1.2". if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedDescending) // older than 8.0 else // 8.0 and newer -Original Message- From: cocoa-dev-bounces+juliuso

RE: Best way to make Finder/Mail style toolbars?

2014-03-09 Thread Julius Oklamcak
> What does the code you're using look like? (Also, are you on 10.9?) The following works for me from 10.6 to 10.9 (I've left out code that creates an NSSearchField, NSPopUpButton and NSTextField controls - all look the same): - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:

RE: iOS 7 GUI update lag during drag touches

2013-10-03 Thread Julius Oklamcak
> CGPoint apoint=[[touches anyObject] locationInView:[self view]]; > [layer setPosition:apoint]; You need to disable implicit CALayer animation(s): [CATransaction begin]; [CATransaction setDisableActions:YES]; [layer setPosition:apoint]; [CATransaction commit]; __

RE: Button on side menu not working

2013-07-28 Thread Julius Oklamcak
There could be two reasons: > [self.view sendSubviewToBack:_menuView.view]; Is placing other UIViews in the view hierarchy on top of the menu view and they could be eating touches. > _menuView.view.frame=CGRectMake(-160,0,160,440); > self.view.frame=CGRectMake(160, 20, 320, 548); UIViews that a

RE: Moving a textField from under keyboard

2013-06-28 Thread Julius Oklamcak
> I'm looking for "something" OR some method that knows how to change (I think) the position (I think) of the view containing a UITextField so the TextField is visible after a keyboard comes up and covers it. Then the view goes back to normal position once the keyboard is dismissed. > > Is there a

RE: iOS splash screen animation

2013-04-10 Thread Julius Oklamcak
> When my app starts, I'd like to show a splash screen with a logo, > etc, and animate it to the main screen after a short delay. > [snip] > Any suggestions what I could be doing wrong? Do this in your root view controller's -viewWillAppear: method. You also need to ensure that it only happens onc

RE: How can I get rid of this warning message?

2013-01-21 Thread Julius Oklamcak
> Ok, I agree that the selector is unknown, but we know from the > previous line that the target responds to it. So I'd like to > prevent this particular warning. I'm sure I ought to know how > do do this, but how do I go about removing this warning message? > Ideally, I'd like to do this on a file

RE: [Q] a view is associated with more than one view controller?

2012-10-25 Thread Julius Oklamcak
> If anyone knows how to solve this problem, please show me your guidance. >From some work I did earlier this year for a client, UIImagePickerController needs to be presented modally or in a UIPopoverController. It also doesn't handle being a root view controller very well (window.rootViewControll

RE: How to (slowly) rotate a view

2012-08-05 Thread Julius Oklamcak
FWIW: UIView sets the delegate of its CALayer to itself - one of the things that it appears to do is to disable any implicit animations. If you add your own CALayer to a UIView's CALayer, then you're in full control. As already pointed out, it's easier using one of the UIView animation class method

RE: PDF Rendering on iPad's

2012-07-25 Thread Julius Oklamcak
Dave, > I have a few questions about rendering PDFs and wondered if > anyone here could help. In my open source iOS PDF viewer (https://github.com/vfr/Reader) I employ two techniques: 1) Show a low resolution image of the page below the CATiledLayer-based zoom-able page view. These low resolutio

RE: wacky image stretching on rotation (repost)

2012-07-06 Thread Julius Oklamcak
I would suspect that the UIImageView's autoresizingMask might be the culprit - if it isn't UIViewAutoresizingNone, then the frame may be resizing itself when rotated. Sometimes it is less trouble to create your own UITableViewCell subclass and have full control over your subviews instead of trying

RE: Xcode 4.3, XIB files and deployment target iOS 3.1

2012-07-06 Thread Julius Oklamcak
Presuming that the firstgen iPod touch has iOS 3.x on it, it is probably crashing here: > self.window.rootViewController = self.tabBarController; Since rootViewController was introduced to UIWindow in iOS 4.0. Pre-iOS 4.0 you need to use (from what I recall): [self.window addSubview:self.tabBarC

RE: wacky image stretching on rotation (repost)

2012-07-06 Thread Julius Oklamcak
Check self.thumbImageView.contentMode - it's probably the default UIViewContentModeScaleToFill (should be UIViewContentModeCenter). Also ensure that the UIImage that you provide really has square dimensions. I had the exact same issue when rotating the UIImageView of a UIButton... > I have a UIIma

RE: NSOperationQueue

2012-06-01 Thread Julius Oklamcak
>> At the moment that the operations are queued, there are some operations in the queue not yet run, and some running. The code that creates the operations doesn't know which ones are needed more urgently (the latest ones), so it can only assign a high priority to all of them, so they all end up wi

RE: Executing a very low-priority operation in iOS

2012-04-25 Thread Julius Oklamcak
> Normally I'd set up a timer to fire in a minute, set up an NSBlockOperation, > and let it go. When it finishes, I'd repeat the process. But I don't see any > way to adjust the priority of an NSOperationQueue. NSBlockOperation inherits from NSOperation so you should be able to -setQueuePriority:

RE: uiviewcontroller

2012-04-19 Thread Julius Oklamcak
Have a look at +attemptRotationToDeviceOrientation in iOS 5: http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewC ontroller_Class/Reference/Reference.html#//apple_ref/occ/clm/UIViewControlle r/attemptRotationToDeviceOrientation > is the official or unofficial way to force

RE: Static TableView Leaks...

2012-04-06 Thread Julius Oklamcak
> leak: > Malloc 48 bytes per incident > libsystem_c.dylib > studup https://devforums.apple.com/message/630695#640345 Known bug in iOS 5.1 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

RE: Delaying Between applicationWillResignActive andapplicationDidEnterBackground

2012-03-21 Thread Julius Oklamcak
Have you looked into using UIApplication's -beginBackgroundTaskWithExpirationHandler: in the UIApplicationDelegate's -applicationDidEnterBackground: to give you some background run time to finish the loop? > My biggest problem is this: My game runs in a tight loop. When I get applicationWillRes

RE: receptionist pattern question: NSOperationQueue vs. GCD

2012-02-16 Thread Julius Oklamcak
> On iOS, NSOperationQueue doesn't use GCD at all. Actually, posts by Apple people in the Developer Forums and the documentation differs on this: http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/NSOper ationQueue_class/Reference/Reference.html "Note: In iOS 4 and later, oper

RE: iOS: Adding pinch-zoom to UIImageView

2012-01-17 Thread Julius Oklamcak
You need to implement the -viewForZoomingInScrollView: UIScrollViewDelegate method and return the image view. Please have a look at Apple's ScrollViewSuite sample code: http://developer.apple.com/library/ios/#samplecode/ScrollViewSuite/Introduct ion/Intro.html > I just added this: >    [scrollVi

RE: Problems with UIAlertView

2011-08-17 Thread Julius Oklamcak
> I'm looking at popovers. I'm wondering if there is any way that I'm overlooking to make popovers modal. The UIViewController that you present in the popover has a property named modalInPopover: "The default value of this property is NO. Setting it to YES causes an owning popover controller to d